]> xenbits.xensource.com Git - seabios.git/commitdiff
acpi: strip compiler info in built-in DSDT if any
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 3 Oct 2013 13:06:24 +0000 (16:06 +0300)
committerKevin O'Connor <kevin@koconnor.net>
Wed, 20 Nov 2013 01:40:23 +0000 (20:40 -0500)
IASL stores it's revision in each table header it generates.
That's a problem since guests see a change each time
they move between hypervisors.
We generally fill our own info for tables,
but we forgot to do this for the built-in DSDT.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
src/fw/acpi.c

index 4504a860eec0024d5f9235c60ad0532b4768e900..042d571ef20b44c1b13385f718d830b38015336f 100644 (file)
@@ -676,13 +676,16 @@ acpi_setup(void)
 
     if (CONFIG_ACPI_DSDT && fadt && !fadt->dsdt) {
         /* default DSDT */
-        void *dsdt = malloc_high(sizeof(AmlCode));
+        struct acpi_table_header *dsdt = malloc_high(sizeof(AmlCode));
         if (!dsdt) {
             warn_noalloc();
             return;
         }
         memcpy(dsdt, AmlCode, sizeof(AmlCode));
         fill_dsdt(fadt, dsdt);
+        /* Strip out compiler-generated header if any */
+        memset(dsdt, 0, sizeof *dsdt);
+        build_header(dsdt, DSDT_SIGNATURE, sizeof(AmlCode), 1);
     }
 
     // Build final rsdt table