diff options
author | Keir Fraser <keir@xen.org> | 2011-07-28 15:40:54 +0100 |
---|---|---|
committer | Keir Fraser <keir@xen.org> | 2011-07-28 15:40:54 +0100 |
commit | 9f1687725292f90c8bc9e7266f062b2e7ec029df (patch) | |
tree | 28718e9d06fbba98745c3f91086e0f7081fd5491 /tools/firmware | |
parent | 96b740e209d0bea4c16d93211ceb139fc98d10c2 (diff) | |
download | xen-9f1687725292f90c8bc9e7266f062b2e7ec029df.tar.gz xen-9f1687725292f90c8bc9e7266f062b2e7ec029df.tar.bz2 xen-9f1687725292f90c8bc9e7266f062b2e7ec029df.zip |
hvmloader: Enable SCI in QEMU has it disabled.
When booting a Windows guest, the OS report an issue with the ACPI (in
a BSOD). The exact issue is "SCI_EN never becomes set in PM1 Control
Register." (quoted from WinDbg help).
So this patch enables the flags SCI_EN if it is not yet enabled.
Reported-by: Tobias Geiger <tobias.geiger@vido.info>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'tools/firmware')
-rw-r--r-- | tools/firmware/hvmloader/acpi/acpi2_0.h | 4 | ||||
-rw-r--r-- | tools/firmware/hvmloader/acpi/static_tables.c | 1 | ||||
-rw-r--r-- | tools/firmware/hvmloader/hvmloader.c | 22 |
3 files changed, 26 insertions, 1 deletions
diff --git a/tools/firmware/hvmloader/acpi/acpi2_0.h b/tools/firmware/hvmloader/acpi/acpi2_0.h index 324cd43e38..dcc362ad5d 100644 --- a/tools/firmware/hvmloader/acpi/acpi2_0.h +++ b/tools/firmware/hvmloader/acpi/acpi2_0.h @@ -20,6 +20,7 @@ #include <stdint.h> #include <xen/xen.h> +#include <xen/hvm/ioreq.h> #define ASCII32(a,b,c,d) \ (((a) << 0) | ((b) << 8) | ((c) << 16) | ((d) << 24)) @@ -252,6 +253,9 @@ struct acpi_20_fadt { #define ACPI_CPU_SW_SLP (1 << 13) #define ACPI_USE_PLATFORM_CLOCK (1 << 15) +/* PM1 Control Register Bits */ +#define ACPI_PM1C_SCI_EN (1 << 0) + /* * Firmware ACPI Control Structure (FACS). */ diff --git a/tools/firmware/hvmloader/acpi/static_tables.c b/tools/firmware/hvmloader/acpi/static_tables.c index cf4b8dc825..da61304f46 100644 --- a/tools/firmware/hvmloader/acpi/static_tables.c +++ b/tools/firmware/hvmloader/acpi/static_tables.c @@ -18,7 +18,6 @@ #include "acpi2_0.h" #include "../config.h" -#include <xen/hvm/ioreq.h> /* * Firmware ACPI Control Structure (FACS). diff --git a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c index 5e7d128307..4129670fc7 100644 --- a/tools/firmware/hvmloader/hvmloader.c +++ b/tools/firmware/hvmloader/hvmloader.c @@ -26,6 +26,7 @@ #include "pci_regs.h" #include "option_rom.h" #include "apic_regs.h" +#include "acpi/acpi2_0.h" #include <xen/version.h> #include <xen/hvm/params.h> @@ -379,6 +380,25 @@ static const struct bios_config *detect_bios(void) return NULL; } +static void acpi_enable_sci(void) +{ + uint8_t pm1a_cnt_val; + +#define PIIX4_SMI_CMD_IOPORT 0xb2 +#define PIIX4_ACPI_ENABLE 0xf1 + + /* + * PIIX4 emulation in QEMU has SCI_EN=0 by default. We have no legacy + * SMM implementation, so give ACPI control to the OSPM immediately. + */ + pm1a_cnt_val = inb(ACPI_PM1A_CNT_BLK_ADDRESS_V1); + if ( !(pm1a_cnt_val & ACPI_PM1C_SCI_EN) ) + outb(PIIX4_SMI_CMD_IOPORT, PIIX4_ACPI_ENABLE); + + pm1a_cnt_val = inb(ACPI_PM1A_CNT_BLK_ADDRESS_V1); + BUG_ON(!(pm1a_cnt_val & ACPI_PM1C_SCI_EN)); +} + int main(void) { const struct bios_config *bios; @@ -481,6 +501,8 @@ int main(void) bios->acpi_build_tables(); } + acpi_enable_sci(); + hypercall_hvm_op(HVMOP_set_param, &p); } |