Commit Graph
148 Commits
Author SHA1 Message Date
Keir Fraser ef63071d01 hvmloader: Scan for gpxe-capable NICs until one is found.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-06-03 16:12:34 +01:00
Keir Fraser ab438874b6 hvm: add ACPI power button for HVM
This patch adds the ACPI fixed hardware power button for HVM.
It enables a graceful shutdown of a guest OS by direction of Dom0.
(if a proper action for the power button is set inside the guest)

usage:
  xm trigger <Domain> power

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-04-02 12:40:09 +01:00
Keir Fraser c2901a5cc4 hvmloader: ROMBIOS must POST in big real mode, since it supports PMM,
and hence Option ROMs can expect noi segment limit checks.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-31 14:04:50 +01:00
Keir Fraser 539cb7fec6 hvmloader acpi: Reserve ioport ranges for expanded PHP
Now there are two control registers plus one register for
each of the 32 PHP slots. A total of 34 registers. Accordingly the
ioport space required has expanded by from 3 to 34 bytes.

Signed-off-by: Simon Horman <horms@verge.net.au>

hvmloader acpi: Use If and Else instead of Switch

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-03-31 13:27:03 +01:00
Keir Fraser 0456ddb432 Disable xen platform PCI device when xen_platform_pci=0 is specified
- Change guest firmware to use new fixed byte port 0x10.
 - Add "xen_platform_pci" option into guest config file and APIs.
    xen_platform_pci=0: Disable xen platform device.
    xen_platform_pci=1: Enable xen platform device. (default)
 - Add "disable_pf" entry into xenstore.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
2009-03-18 11:37:59 +00:00
Keir Fraser 57f692c8e9 hvmloader: Allow any unused PCI device to be used for PCI hotplug
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-03-17 10:48:52 +00:00
Keir Fraser 4c0b25e05d hvmloader acpi: Describe PIRQ routing for all 32 PCI devices on bus 0.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-09 09:13:50 +00:00
Keir Fraser 83833d973b rombios: Indirect through 32-bit jump table from within the 32-bit bios.
This gets rid of shenanigans with relocating the jump table around the
place.

Also clean up bios_info table while we are updating it.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-23 14:32:41 +00:00
Keir Fraser f7c23cc9a9 hvmloader: ACPI compiler is not to be buil;t and installed on target system.
Since it is a build prerequisite (in some cases) simply fail the build
if it is not found when it turns out to be required. Just as we would
for any other tool-chain prereq.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-20 15:10:28 +00:00
Keir Fraser 5abf934455 hvmloader: remove videoram allocation; move reserve base to 0xfc000000.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-01-13 15:42:47 +00:00
Keir Fraser 4ef2a41a2d hvmloader: Fix SMBIOS memory device length boundary condition.
dev_memsize ends up 0 when it shouldn't be on 16G boundary conditions.

Signed-off-by: Bill Rieske <brieske@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-12 10:23:55 +00:00
Keir Fraser 9f8501582f Use -MMD -MF in tools/* rather than -Wp,-M...
If you use -MMD -MF then the correct .o filename is written to the
.*.d file as the compiler driver arranges everything.  This was done
in 19010:275abe1c5d24 for the hypervisor.

In this patch we do the same elsewhere in the xen-unstable tree,
particularly tools/.  Specifically:
 * Change tools/Rules.mk to add -MMD -MF ... to CFLAGS and set DEPS.
 * Remove -Wp,-MD... from every other Makefile
 * Remove setting of DEPS from every other Makefile
 * Ensure that every Makefile says -include $(DEPS)
 * Ensure that every Makefile's clean target removes $(DEPS)

Some Makefiles were already halfway there, but often for a different
variable name eg PROG_DEP.  The variable name is now standardised in
Rules.mk as DEPS.

I have done a test build with this change, on Debian etch.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-01-12 10:16:05 +00:00
Keir Fraser 0d1fa649fe hvmloader: MTRR UC type covers the pci regions only.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-09 13:00:10 +00:00
Keir Fraser 31b8c8391c hvmloader: Dynamically size the PCI hole.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-09 12:41:25 +00:00
Keir Fraser e3a9e577ae hvmloader: Reserve BIOS memory and VGA memory at top of 4GB memory hole.
To make memory management easier in hvmloader, defer building a
generic E820 map until the end of hvmloader bootstrap.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-08 16:59:21 +00:00
Keir Fraser ad8b20cc85 x86, hvm: Move E820 table creation into hvmloader, extend
hvm_info_table to describe memory parameters in a simpler form from
domain builder to hvmloader.

Also move reserved special page mappings immediately below the 4GB
boundary.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-08 15:27:20 +00:00
Keir Fraser 54562e0cdf hvmloader: Simplify access to hvm_info_table.
Also require the table to be present.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-08 13:49:05 +00:00
Keir Fraser 872a09d262 rombios: Allow option ROMs to extend up to 0xEA000.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-06 16:02:10 +00:00
Keir Fraser cbd07b72a3 Download external tarballs from xenbits.xensource.com
I have copied the tarballs that the xen-unstable build downloads to
xenbits.xensource.com (which also hosts our hg and git).  This patch
changes the download URLs to use that location.

That way the build will depend on only one external machine, under one
administration, rather than many.  Also it means that the build won't
break if these sites become permanently unavailable or are rearranged
and we don't run a risk of having to panic and beg if a file should go
missing.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-01-05 11:19:16 +00:00
Keir Fraser 9976adf65a acpi: Reserve IO ports used by hotplug
In DSDT, reserve the IO port ranges: [0x10c0, 0x10c2] and [0xb044,
0xb047] that are used by the virtual PCI hotplug.
Or else, for a hotplugged-in device, the port IO BAR assigned by guest
OS may conflict with the ranges here.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-12-29 14:13:07 +00:00
Keir Fraser 20553adcd9 hvmloader: enable bus mastering of PCI device
Without this, init routine in some PCI option ROM doesn't work well.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-12-11 13:26:02 +00:00
Keir Fraser 8d4638d15e Use virtual 8086 mode for VMX guests with CR0.PE == 0
When a VMX guest tries to enter real mode, put it in virtual 8086 mode
instead, if that's possible.  Handle all errors and corner cases by
falling back to the real-mode emulator.

This is similar to the old VMXASSIST system except it uses Xen's
x86_emulate emulator instead of having a partial emulator in the guest
firmware.  It more than doubles the speed of real-mode operation on
VMX.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2008-12-09 16:28:02 +00:00
Keir Fraser ba10bcb00f hvmloader: Pass BDF to PCI option ROMs.
Signed-off-by: Shan Haitao <Haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-24 13:57:48 +00:00
Keir Fraser 6641cb8ee3 hvmloader: Load physical PCI option ROMs where available.
Signed-off-by: Shan Haitao <Haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-24 13:43:28 +00:00
Keir Fraser 66d936fdab hvmloader: Relocate the etherboot ROM to be near the end of VGA
BIOS. Current Xen hard coded VGA ROM at 0xC0000 and etherboot ROM
at 0xD0000. This makes the space in [0xC0000 - 0xDFFFF] to be
fragments, which makes it hard to find enough space to hold another
Option ROM.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
2008-11-24 11:17:44 +00:00
Keir Fraser 7e02a88ed3 hvmloader: Remove unneeded legacy flag from FADT flags field.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
rHG: changed tools/firmware/hvmloader/acpi/static_tables.c
2008-10-23 11:18:34 +01:00
Keir Fraser 5e58cce9f7 hvm: Battery Management virtual firmware and toolstack changes
Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
2008-10-14 11:08:15 +01:00
Keir Fraser 39f97ffa29 x86, hvm: Hyper-V guest interface support with small set of enlightenments
A minimal implementation of the Viridian (Hyper-V) guest
interface. The only enlightenments advertised and supported are vAPIC
MSRs and long-spin-wait notifications. The set of enlightenments can
easily be extended in future, as they are found to provide a
performance win, and configured via an extended HVM_PARAM_VIRIDIAN hvm
parameter.

Signed-off-by: Peter Johnston <peter.johnston@citrix.com>
Signed-off-by: Tim Deegan <tim.deegan@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-10-14 10:45:29 +01:00
Keir Fraser 3fddebffd7 hvmloader: smbios support for large memory guests
This reports more than one memory device if the memory for the guest
is larger than 16G.

Signed-off-by: Bill Rieske <brieske@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-10-09 17:18:11 +01:00
Keir Fraser 3321e0ef95 hvm: Remove extboot from virtual firmware.
Device model is not present in external qemu repository, and
functionality was never exposed through the toolstack.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-29 15:45:38 +01:00
Keir Fraser d6c3ce8cb9 Update the URL for the ACPI compiler sources.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2008-08-29 16:07:36 +01:00
Keir Fraser 1ceec08ea2 hvmloader: skip upper field of 64 bit base address register.
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
2008-08-28 09:59:49 +01:00
Keir Fraser f844c8910a hvmloader: Fix e820_malloc() after bug I introduced in c/s 18383
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-27 15:16:13 +01:00
Keir Fraser d818f3cb7c hvm: Use main memory for video memory.
When creating an HVM domain, if e.g. another domain is created before
qemu allocates video memory, the extra 8MB memory ballooning is not
available any more, because it got consumed by the other domain.

This fixes it by taking video memory from the main memory:

- make hvmloader use e820_malloc to reserve some of the main memory
  and notify ioemu of its address through the Xen platform PCI card.
- add XENMAPSPACE_mfn to the xen_add_to_physmap memory op, to allow
  ioemu to move the MFNs between the original position and the PCI
  mapping, when LFB acceleration is disabled/enabled
- add a remove_from_physmap memory op, to allow ioemu to unmap it
  completely for the case of old guests with acceleration disabled.
- add xc_domain_memory_translate_gpfn_list to libxc to allow ioemu to
  get the MFNs of the video memory.
- have xend save the PCI memory space instead of ioemu: if a memory
  page is there, the guest can access it like usual memory, so xend
  can safely be responsible to save it.  The extra benefit is that
  live migration will apply the logdirty optimization there too.
- handle old saved images, populating the video memory from ioemu if
  really needed.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 14:53:39 +01:00
Keir Fraser 64a86b092f hvmloader: Debug build incorporates HVM environment tests which must
pass for the HVM guest to successfully boot.

Currently only one test (REP INS across page boundaries) but more will
be added in future.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-21 15:18:05 +01:00
Keir Fraser 0a72f4c6f8 firmware: Fix build dependencies.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-31 11:51:14 +01:00
Keir Fraser 3c1221fce3 hvmloader: Load ACPI tables outside BIOS area, so they are writable by
OSPM (particularly the S3 firmware_waking_vector).

TODO: rombios must enter protected mode to fetch the vector on S3 resume.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-29 15:10:58 +01:00
Keir Fraser 7eb8d34c18 tools: Declare functions static where they should be, and provide
proper prototypes for others as required.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2008-07-15 13:19:26 +01:00
Keir Fraser f178c63b8f hvmloader, rombios: Make use of new rom-lock facility in ioemu platform device.
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-11 12:31:32 +01:00
Keir Fraser 9a5fd91e50 hvmloader: Set up any Intel ICH for legacy IDE.
Signed-off-by: Li Zhang <li.zhang@intel.com>
2008-06-27 14:15:11 +01:00
Keir Fraser cc8cdb7e47 hvmloader: No need to map shared_info page into the legacy VGA MMIO
hole. We can access address 0xfffff000 from 32-bit protected mode.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-28 10:02:00 +01:00
Keir Fraser b6615aaac9 hvmloader: Fix pci_setup() to not skip BAR remapping for virtual VGA devices.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-22 11:04:02 +01:00
Keir Fraser e6b2e11c90 hvmloader: Lay out memory a bit differently -
* Cleanly define a scratch area for temporary storage
 * Raise Etherboot ROM out of the way of larger VGA BIOSes

Also detect virtual VGA adaptors more cleanly.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-21 11:23:03 +01:00
Keir Fraser 232cae0f1c hvm: rombios interface for HVM S3
- add S3 package in ACPI DSDT table. Guest OS will get S3 value from
   this package and write the value to PM1A control register to
   trigger S3 suspend.
 - Add S3 resume logic in rombios post code. the CMOS shutdown register
   is used to indicate if this is a S3 resume.
 - if it is s3 resume, rombios will get wakeup vector from ACPI FACS
   table and jump to wakeup vector. Per ACPI spec, the wakeup vector
   jumping must be the forms CS:IP, in which CS=3D(wakeup vector>>4)
   IP=3D(wakeup vector)&0xF, for example, for vector=3D0x12345,
   CS:IP=3D0x1234:0x5

Note: clobber_entry_point will clobber the post entry, which make S3
resume not work. We will directly jmp to POST Entry if it in S3
Resume path.

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Ke Liping <liping.ke@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-20 14:36:05 +01:00
Keir Fraser a6a8223242 x86, hvm: Lots of MTRR/PAT emulation cleanup.
- Move MTRR MSR initialisation into hvmloader.
 - Simplify initialisation logic by overlaying UC on default WB rather
   than vice versa.
 - Clean up hypervisor HVM MTRR/PAE code's interface with rest of
   hypervisor.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-04-16 13:36:44 +01:00
Keir Fraser b42f8b07d1 hvmloader: Explicitly revert to text section after declaring bss fields.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-04-15 18:11:44 +01:00
Keir Fraser 1eaea3f0b6 hvmloader: Framework for multiprocessor initialisation.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-04-15 16:39:00 +01:00
Keir Fraser f541851c79 hvmloader: Small cleanups.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-04-14 14:10:11 +01:00
Keir Fraser f342e8630c hvmloader: Fix build with gcc 4.1 and later.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-04-10 09:12:44 +01:00
Keir Fraser 472f532c1d hvmloader: Fix parsing Etherboot roms to avoid an infinite loop.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-04-09 13:52:34 +01:00