Commit Graph
76 Commits
Author SHA1 Message Date
Keir Fraser dc6c53ebb6 hvmloader: Add a xenbus frontend so it can read values from xenstore
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-09 12:33:57 +01:00
Keir Fraser 6456803dab rombios: move the stack to 0x9e000 and protect it with an e820 entry
so that we don't corrupt E820_RAM memory with stack ops in S3 wakeup.
It has to move up so the lowest contiguous RAM area is >= 512MiB.

This relies on the previous fix to let DS != SS

Signed-off-by: Paul Durrant <Paul.Durrant@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-08 09:51:40 +01:00
Keir Fraser b0e6d9b53a hvmloader: fix vgatype detecting issue
When graphics card is assigned to a guest as a secondary VGA,
without gfx_passthru and emulated VGA is the primary VGA,
hvmloader misreads gfx_passthru is specified if VGA device is
found after the emulated VGA.

This patch fix this issue. If emulated VGA is found, hvmloader
preserves it and loads vgabios of the emulated VGA.

Signed-off-by: Noboru Iwamatsu <n_iwamatsu@jp.fujitsu.com>
2010-02-22 10:04:22 +00:00
Keir Fraser 37fddaa5fe hvmloader: Only mark LTP1 present in ACPI DSDT if parport really is there.
Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
2009-12-24 09:10:25 +00:00
Keir Fraser c70ad37a1f HVM vcpu add/remove: setup dsdt infrastructure by mk_dsdt.c for vcpu add/remove
In order to support HVM vcpu add/remove, we need set dsdt
infrastructure.
-- By using mk_dsdt.c, it auto-produce related asl code when
compiling.
-- It define processor related objects and control methods (_MAT,
_EJ0, _STA, etc).
-- It also define GPE _L02 and Notify control method for SCI
interrupt, which will trigger HVM acpi driver to add/remove cpu.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-14 09:14:26 +00:00
Keir Fraser 91cb4623df x86 hvm: Guests should scan CPUID range 40000000-4000ff00 for Xen leaves.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-09-16 08:55:23 +01:00
Keir Fraser 049607ff33 x86 passthru:: graphics passthrough
This patch supports basic gfx passthrough on xen side:
  - add a VGA type for gfx passthrough, and get the size of VGA bios
  of passthrouged gfx in hvmloader
  - add a config option 'gfx_passthru' for gfx passthrough

Signed-off-by: Ben Lin <ben.y.lin@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
2009-09-01 11:36:16 +01:00
Keir Fraser 016a8a4a48 hvmloader: Add new test for MSR_SHADOW_GS_BASE validity after SWAPGS instruction.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-16 10:30:50 +01:00
Keir Fraser 89c6cf58e8 x86 hvm: Allow delivery of legacy 8259 interrupts to VCPUs != 0.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-01 20:22:29 +01:00
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 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 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 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 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 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 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 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 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 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 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 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 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 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
Keir Fraser 68a232d6d9 hvmloader: Parse Etherboot option ROMs the conventional way.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-04-02 13:46:57 +01:00
Keir Fraser 75d2b7df30 hvmloader: Properly implement some more SMBIOS fields.
In particular:
 - BIOS release date
 - BIOS characteristics
 - BIOS extended characteristics (Targeted Content Distribution is
   required to be specified to pass WHQL).
 - CPU speed

Based on a patch by Kamala Narasimhan <kamala.narasimhan@citrix.com>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-04-01 17:21:05 +01:00
Keir Fraser 399874b1de hvmloader: Remove dead function check_amd().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-06 18:31:02 +00:00
Keir Fraser 50b12df836 x86 vmx: Remove vmxassist.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-06 12:07:55 +00:00
Keir Fraser 2c16ce588c hvm: Etherboot for E100 NIC
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-01-31 16:23:35 +00:00
Keir Fraser 956eabb460 hvmloader: Expand iomem allocation pool to 0xf0000000-0xfc000000.
Check for exhaustion of allocation pool, warn user, and fail to
initialise the relevant PCI BAR.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-01-22 11:18:10 +00:00
Keir Fraser b126cbcb88 hvmloader: Assign PCI resources in descending order of size for better packing.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-01-22 10:54:00 +00:00
Keir Fraser 86f69d44ae hvm: Extboot support for Xen
This patch adds extboot to Xen.  It should be pretty harmless as the
moment because it's never enabled.  extboot allows arbitrary block
devices to be used to boot guests including SCSI and PV disks.  I've
tested it with both Windows and Linux guests in QEMU.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2008-01-17 16:39:14 +00:00
Keir Fraser 07847be650 x86, hvm: Config option to allow vmxassist to be disabled.
hvmloader is modified to dynamically detect this, allowing possibility
of optional full vmxassist replacement in 3.2 stable branch in future.
Currently 'vmxassist=y' is not much use since no replacement is
implemented.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-24 13:23:22 +00:00