Skip to contentSkip to conversation

hvmloader: Fix FADT table with QEMU Upstream.

PATCH Superseded Anthony PERARD 3 participants 3 messages Jul 26, 2011

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hvmloader: Fix FADT table with QEMU Upstream.

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).

To fix this, this patch set some value related to the QEMU upstream: The SMI command port, and the acpi_enable/acpi_disable values.

---
 tools/firmware/hvmloader/seabios.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
tools/firmware/hvmloader/seabios.c +8 -0
index 8cd0108..1b89ba7 100644
@@ -28,6 +28,9 @@
 #include "smbios_types.h"
 #include "acpi/acpi2_0.h"
 
+/* Upstream QEMU require to set more field in the FADT */
+extern struct acpi_20_fadt Fadt;
+
 #define ROM_INCLUDE_SEABIOS
 #include "roms.inc"
 
@@ -91,6 +94,11 @@ static void add_table(uint32_t t)
 static void seabios_acpi_build_tables(void)
 {
     uint32_t rsdp = (uint32_t)scratch_alloc(sizeof(struct acpi_20_rsdp), 0);
+
+    Fadt.smi_cmd = 0xb2;
+    Fadt.acpi_enable = 0xf1;
+    Fadt.acpi_disable = 0xf0;
+
     acpi_build_tables(rsdp);
     add_table(rsdp);
 }
Signature · 1 line
Anthony PERARD
#1 lore raw
Quoted 6 lines · Anthony PERARD

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).

To fix this, this patch set some value related to the QEMU upstream: The SMI command port, and the acpi_enable/acpi_disable values.

Would it be harmful to include these new values in the Fadt for every BIOS rather than adding special cases?

If this really needs to be Sea BIOS specific then I think it would be better done as a function call (e.g. acpi_enable_whatever()) into the ACPI code (where the rest of the Fadt init lives) from the seabios hooks rather than splitting the initialisation between two locations (or maybe better this should be the default and the ROMBIOS hooks should disable it if necessary).

Ian.

Quoted 32 lines
---
 tools/firmware/hvmloader/seabios.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
tools/firmware/hvmloader/seabios.c +8 -0
index 8cd0108..1b89ba7 100644
@@ -28,6 +28,9 @@
 #include "smbios_types.h"
 #include "acpi/acpi2_0.h"
 
+/* Upstream QEMU require to set more field in the FADT */
+extern struct acpi_20_fadt Fadt;
+
 #define ROM_INCLUDE_SEABIOS
 #include "roms.inc"
 
@@ -91,6 +94,11 @@ static void add_table(uint32_t t)
 static void seabios_acpi_build_tables(void)
 {
     uint32_t rsdp = (uint32_t)scratch_alloc(sizeof(struct acpi_20_rsdp), 0);
+
+    Fadt.smi_cmd = 0xb2;
+    Fadt.acpi_enable = 0xf1;
+    Fadt.acpi_disable = 0xf0;
+
     acpi_build_tables(rsdp);
     add_table(rsdp);
 }
#2 lore raw
Quoted 11 lines · Ian Campbell
Quoted 6 lines · Anthony PERARD

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).

To fix this, this patch set some value related to the QEMU upstream: The SMI command port, and the acpi_enable/acpi_disable values.

Would it be harmful to include these new values in the Fadt for every BIOS rather than adding special cases?

Quoted 6 lines

If this really needs to be Sea BIOS specific then I think it would be better done as a function call (e.g. acpi_enable_whatever()) into the ACPI code (where the rest of the Fadt init lives) from the seabios hooks rather than splitting the initialisation between two locations (or maybe better this should be the default and the ROMBIOS hooks should disable it if necessary).

Descriptive macros and/or comments that describe the magic numbers being poked into the FADT would also be helpful.

-- Keir

Quoted 42 lines

Ian.

Quoted 23 lines
---
 tools/firmware/hvmloader/seabios.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
tools/firmware/hvmloader/seabios.c +3 -0
index 8cd0108..1b89ba7 100644
@@ -28,6 +28,9 @@
 #include "smbios_types.h"
 #include "acpi/acpi2_0.h"
 
+/* Upstream QEMU require to set more field in the FADT */
+extern struct acpi_20_fadt Fadt;
+
 #define ROM_INCLUDE_SEABIOS
 #include "roms.inc"
 
@@ -91,6 +94,11 @@ static void add_table(uint32_t t)
 static void seabios_acpi_build_tables(void)

tools/firmware/hvmloader/seabios.c static void add_table(uint32_t t) · line 104

Quoted 10 lines
tools/firmware/hvmloader/seabios.c +5 -0
 {
     uint32_t rsdp = (uint32_t)scratch_alloc(sizeof(struct acpi_20_rsdp), 0);
+
+    Fadt.smi_cmd = 0xb2;
+    Fadt.acpi_enable = 0xf1;
+    Fadt.acpi_disable = 0xf0;
+
     acpi_build_tables(rsdp);
     add_table(rsdp);
 }

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel