Commit Graph
189 Commits
Author SHA1 Message Date
Keir Fraser 57f1362319 hvmloader: Fix 22383:cba667fb80cf iterating over defns 0..255
We need to declare devfn as wider than 8 bits for a loop 0<devfn<256
to terminate.

Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-10 14:15:23 +00:00
Keir Fraser cf17821447 hvmloader: fix off-by-one-bit error when initialising PCI devices
hvmloader is responsible for - amoungst other things - initialising
the PCI device BARs prior to loading the guest BIOS.  The previous
code only probed for devfn up to 128.  The lower 3 bits are function
IDs so this meant that only devices in slots 0-15 were actually being
initialized.

Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
Acked-by: Gianni Tedesco <gianni.tedesco@citrix.com>
2010-11-10 13:58:16 +00:00
Keir Fraser e0dbccc8fe hvmloader: Fix acpi static tables for new ACPI ioports location.
This change some fadt values -- the address of the acpi ioports -- and
the pm1a_evt_address value wrote for the pci bus.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
2010-11-09 20:37:46 +00:00
Anthony Perard 8fe49db6bd firmware, qemu: Change ACPI IO values to match QEMU BIOS
As part of the QEMU/Xen merge, this patch comes to change the value of
sleep states and add some information in the PCI registers to match the
implementation of the BIOS of QEMU.

It also does a hypercall (HVM_PARAM_ACPI_IOPORTS_LOCATION) that tell the
Xen to use the new Port I/O instead of the old one.

[ Also, in this patch, update QEMU_TAG to the qemu-xen revision
  with the corresponding qemu change. -iwj ]

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-09 18:03:55 +00:00
Keir Fraser e9cc934b59 hvmloader: Fix e820 printing routine -- addresses are 64-bit
Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-09 10:34:43 +00:00
Keir Fraser d47f1a444a hvmloader: reduce iasl verbosity
I don't think anyone really needs iasl's banner displayed during the
build process.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-10-24 13:18:26 +01:00
Keir Fraser da7abb1417 hvmloader: Properly block on xenstore daemon rather than merely yielding.
Signed-off-by: Keir Fraser <keir@xen.org>
2010-10-20 16:36:32 +01:00
Keir Fraser 9365b5518a hvmloader: clear the whole shared-info page when shutting down xenbus
since the contents might be in the wrong word-size for later users.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-22 15:19:25 +01:00
Keir Fraser 8bced86016 hvmloader: clear the xenbus event-channel when we're done with it.
Otherwise a later xenbus client that naively waits for the rising edge
could get stuck.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-20 13:42:17 +01:00
Keir Fraser 0e0a3eacbc hvmloader: customize the SMBIOS strings based on xenstore keys
...written at domain creation time by xapi.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-09 12:34:40 +01:00
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 a6e99ed7e7 Add the USE_PLATFORM_TIMER flag to the FADT, to make w2k3 use the PMTIMER
...because the default timesource (TSC) drifts under load.

The flag is only defined in ACPI 3.0, and we provide ACPI 2.0 tables,
but Windows seems happy enough to obey it anyway.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-06-04 10:06:23 +01:00
Keir Fraser 022cf55cf1 hvmloader: Replace unportable usage of GNU head with portable awk.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-02-22 18:42:50 +00: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 819de76727 hvmloader: Fix an ACPI asl bug.
Fix an ACPI asl bug by explicitly convert PRS to buffer, otherwise PRS
would be parsed as integer if less than 32/64 bits (according to ACPI
1.0 or 2.0).

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2010-02-15 08:14:21 +00:00
Keir Fraser 5f5e014566 Vcpu hotplug: Move ACPI processor from \_PR to \_SB
Move processor from \_PR to \_SB. ACPI processor can be defined
under \_PR or \_SB. However, recently os like linux 2.6.30/32 support
cpu hotplug better for \_SB processor object.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-02-15 08:13:26 +00:00
Keir Fraser 98650e12c1 hvmloader: Fix parallel build of ACPI tables.
Make build.c dependency on ssdt_{pm,tpm}.h explicit, else they can be
built in the wrong order.

Also, improve naming of target DSDT structures, and specify -p option
to iasl so that all generated files for a given target have
target-unique names, hence build can proceed safely in parallel.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-02-12 09:16:10 +00:00
Keir Fraser 1ffced4c92 hvmloader: Fix comment style in ssdt_tpm.asl
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-02-12 09:14:16 +00:00
Keir Fraser 11c76718f8 hvmloader: Build a compatibility DSDT with only 15 processor objects.
Deploy this smaller DSDT where possible: this is required to boot
Windows 2000, which only supports up to 15 processors and will blue
screen if it sees more processor objects than that (even inactive
ones).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-02-11 22:42:18 +00:00
Keir Fraser 5f6338c27e hvmloader: Remove checked-in ready-compiled SSDT_PM and SSDT_TPM.
These can be built at the same time as the DSDT.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-02-11 21:49:47 +00:00
Keir Fraser e5a69893b2 hvmloader: Do not leave compiled DSDT checked in to tree.
It's big and small changes generate huge diffs. People building the
firmware will have to ensure they have iasl installed.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-02-11 21:21:41 +00:00
Keir Fraser e5dc62c4d4 hvmloader: Fix CPU hotplug notify handler in ACPI DSDT.
By merging PRSC and NTFY methods we simplify the code, improve
efficiency, and fix a bug where PRSC iterated 0-255 but NTDY could
only handle CPU numbers 0-127.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-02-03 09:16:11 +00:00
Keir Fraser 9e2b86f486 hvm: Add ACPI fixed sleep button
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
2010-01-20 20:34:19 +00:00
Keir Fraser 4bce6df7bd hvmloader: mp table fix
The bug causes noapic PAE Windows 2k3 boot failure.

Signed-off-by: Yang Xiaowei <xiaowei.yang@intel.com>
2009-12-30 12:49:10 +00:00
Keir Fraser 16d3c5de3c hvmloader: Fix Windows XP standby with cirrus VGA
Fix it by telling OSPM don't power down vga card on entering S3
state. The trick works for XP and Windows2003, but Vista still refuse
to allow S3.

It is picked from kvm-userdapce.git commit 60e85d, author "Gleb
Natapov".

Signed-off-by: Yu Ke <ke.yu@intel.com>
2009-12-28 09:38:34 +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 cf75018188 HVM vcpu add/remove: parse 'vcpu_avail' to firmware and set up madt
accordingly

-- currently firmware has got 'vcpus' from xend, this patch add parse
   'vcpu_avail' to firmware;
-- setup madt 'lapic' subitems of processors accoring to vcpus and
   vcpu_avail which finally come from config;

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-14 09:25:47 +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 0dfc46719e hvmloader: Fix bug in 20510:749b5d46e7a9 (GPE notifications)
The GPE notification decision tree was inverted.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-01 14:08:27 +00:00
Keir Fraser dd14c75ad4 build: Execute mk_dsdt with path
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-11-27 07:56:38 +00:00
Keir Fraser c7679119e4 hvmloader: Auto-generate IRQ routing tables in ACPI DSDT.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-26 15:27:00 +00:00
Keir Fraser c3517d3d2a hvmloader: Auto-generate the lengthy pattern-based sections of ACPI DSDT.
At the same time, replace a lengthy linear GPE notification method,
with a logarithmic binary chop. Based on a patch by Simon Horman.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-26 13:51:16 +00:00
Keir Fraser 83371c34bc hvmloader: Advertise ECC memory in SMBIOS tables.
Microsoft's Windows logo certified hardware requires ECC; since the
SVVP certification runs the same test on the guest, Xen domains will
currently fail it.

From: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-25 14:04:46 +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 990e56e3ec hvmloader: Regression tests need 16MB to run. Check for this.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-06 11:14:48 +01:00
Keir Fraser bce51ea9a8 hvmloader: Fix get_memsize() to cast high_mem_pgend to 64 bits.
Signed-off-by: Joe Jin <joe.jin@oracle.com>
2009-07-24 10:37:52 +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 83d82e6f35 hvmloader: pass-through: multi-function PCI hot-plug
This registers information to allow guests to recognise non-zero
functions when hot-plugged.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-27 09:53:19 +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 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