Skip to contentSkip to conversation

acpi: strip compiler info in built-in DSDT

PATCH In review Michael S. Tsirkin 2 participants 2 messages Nov 14, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi: strip compiler info in built-in DSDT

IASL stores it's revision in each table header it generates. That's not nice since guests will see a change each time they move between hypervisors.
We generally fill our own info for tables,
but we (and seabios) forgot to do this for the built-in DSDT.

---

Probably not important enough for 1.7. Queued for 1.8.

 hw/i386/acpi-build.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
hw/i386/acpi-build.c +7 -1
index 486e705..8ae4f26 100644
@@ -921,10 +921,16 @@ build_mcfg_q35(GArray *table_data, GArray *linker, AcpiMcfgInfo *info)
 static void
 build_dsdt(GArray *table_data, GArray *linker, AcpiMiscInfo *misc)
 {
-    void *dsdt;
+    AcpiTableHeader *dsdt;
+
     assert(misc->dsdt_code && misc->dsdt_size);
+
     dsdt = acpi_data_push(table_data, misc->dsdt_size);
     memcpy(dsdt, misc->dsdt_code, misc->dsdt_size);
+
+    memset(dsdt, 0, sizeof *dsdt);
+    build_header(linker, table_data, dsdt, ACPI_DSDT_SIGNATURE,
+                 misc->dsdt_size, 1);
 }
 
 /* Build final rsdt table */
Signature · 1 line
MST
Tested-by on v1 1/1
#1 lore raw
Quoted 7 lines · Michael S. Tsirkin

IASL stores it's revision in each table header it generates. That's not nice since guests will see a change each time they move between hypervisors.
We generally fill our own info for tables,
but we (and seabios) forgot to do this for the built-in DSDT.

Modifications in DSDT table:

 OEM ID:            "BXPC" -> "BOCHS "
 OEM Table ID:      "BXDSDT" -> "BXPCDSDT"
 Compiler ID:       "INTL" -> "BXPC"
 Compiler Version:  0x20130823 -> 0x00000001
Quoted 29 lines

---

Probably not important enough for 1.7. Queued for 1.8.

 hw/i386/acpi-build.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
hw/i386/acpi-build.c +7 -1
index 486e705..8ae4f26 100644
@@ -921,10 +921,16 @@ build_mcfg_q35(GArray *table_data, GArray *linker, AcpiMcfgInfo *info)
 static void
 build_dsdt(GArray *table_data, GArray *linker, AcpiMiscInfo *misc)
 {
-    void *dsdt;
+    AcpiTableHeader *dsdt;
+
     assert(misc->dsdt_code && misc->dsdt_size);
+
     dsdt = acpi_data_push(table_data, misc->dsdt_size);
     memcpy(dsdt, misc->dsdt_code, misc->dsdt_size);
+
+    memset(dsdt, 0, sizeof *dsdt);
+    build_header(linker, table_data, dsdt, ACPI_DSDT_SIGNATURE,
+                 misc->dsdt_size, 1);
 }
 
 /* Build final rsdt table */