[HVM] ACPI support patch 1 of 4: main components.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sat, 17 Jun 2006 08:00:16 +0000 (09:00 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sat, 17 Jun 2006 08:00:16 +0000 (09:00 +0100)
commitf4cdf1dbe8685fabfc0607f38e6d6fe6cf016d21
tree25dbf3b355e3ce79eed61e0a94a4496c352a53bc
parentd994f818463594643d00d3f9383a76b0ad4dd8b7
[HVM] ACPI support patch 1 of 4: main components.

The patch support ACPI UP Guest Windows 2000,  XP and 2003, based on
this we are going to add more support on SMP and 64bit Windows( which
are only working in ACPI mode) later. We tested: in ia32 guest:

  a. Installation and boot of  Windows XP sp2 and 2003 server in ACPI
mode
  b  when boot to both window, no yellow mark in device manger and  USB,
network card and IDE DMA are working.
  c. clean boot (without ACPI related errors) on UP and  4 vcpu rhel4u1
SMP guest and got ioapic Interrupt assigned according to ACPI DSDT
table's _PRT table's GSI.

To minimize the implementation efforts to satisfy the ACPI OS
installation and boot, we implemented  ACPI only event logical model by
emulating ACPI hardware based on PIIX4 (Intel 82371ab) by:  Populating
the PIIX4  ACPI bridge PCI configuration space; Adding ACPI timer
(required during windows installation/boot), PM1 event register block
and PM1 control register block (both are required during
installation/boot, shutdown, entering and leaving PM S state if adding
those features later), we provided full ACPI hardware registers above
using byte/word/dword access per ACPI spec requirement.

The patch also fixed many existing hvm ACPI related bugs, such as
warnings when boot to ACPI  UP and SMP guest Linux OS; adding new ACPI
_PRT table reporting PCI IRQ routing table in PIC mode,  adding new _PRT
table in APIC mode, that fixed no IRQ GSI cause it is forced to shutdown
when OS find new device to assign IRQ without ACPI event service; The
patch also fixed the ACPI DSDT table's  PCI resource conflict with guest
e820 table when booting and installing ACPI Windows; we also added ACPI
shutdown service by incorporating the code in ACPI "hardware enable
register writer" from  Ben's Virtual Iron's team's patch in changeset
9989:f8d20c3e4225.

We only provide minimum power management requirement support per spec-c1
and S5 for shutdown, may be S4 (hibernating which is meaningful for user
to save their working section)  in the future.

Please note, current patch needs to  have following switches in guest
configuration to enable proper ACPI support
  a. need to add ACPI=1 (apic=1 if boot SMP Linux guest plus vcpu=
number want to test) in xmexample.hvm
  b. need to add USB support: USB=1 and usbdevice='device' (or
='tablet') as the pm register base is static..., I will adding dynamic
ACPI FADT table for pm register base pointer later.

When installing guest OS in ACPI mode, need to manually tell Windows
setup program to install single core ACPI HAL:
   After passing the 1st screen of windows setup of install Windows,
   the first thing you'll see at the bottom of the screen is the
   option to press F6 if you need to install a SCSI or RAID
   controller. Don't press F6. Press F5 instead. This will take
   you to a separate menu of Hardware Abstraction Layer's where
   you can choose an appropriate HAL .The choices will be:

   ACPI Multiprocessor PC
   ACPI Uniprocessor PC
   Advanced Configuration and Power Interface (ACPI) PC
   ...
   Standard PC
   Standard PC with C-Step i486

Please select "Advanced Configuration and Power Interface (ACPI) PC"
using current patch.

Signed-off-by: Winston Wang <winston.l.wang@intel.com>
tools/firmware/acpi/Makefile
tools/firmware/acpi/acpi2_0.h
tools/firmware/acpi/acpi_dsdt.asl
tools/firmware/acpi/acpi_dsdt.c
tools/firmware/acpi/acpi_fadt.h
tools/ioemu/hw/pc.c
tools/ioemu/hw/pci.c
tools/ioemu/hw/piix4acpi.c [new file with mode: 0644]
tools/ioemu/target-i386-dm/Makefile