Skip to contentSkip to conversation

merge SSDT into DSDT

PATCH In review Igor Mammedov 2 participants 10 messages Jan 22, 2016 – Feb 1, 2016

lore
Share & tools
lore
#0 lore raw

cover merge SSDT into DSDT

Merging both tables will allow for futher ASL simplification and cleanups per device/subsystem And it also allows to reduce number of expected binary blobs for ACPI tests which reduces tests maintenance.

Boot tested with RHEL72, WS2003, WS2012R2 guests.

git tree for testing:
https://github.com/imammedo/qemu.git merge_ssdt_into_dsdt_v1

Igor Mammedov (3):
pc: acpi: merge SSDT into DSDT
tests: pc: acpi: drop not needed 'expected SSDT' blobs
tests: pc: acpi: add expected DSDT.bridge blobs and update DSDT blobs

 hw/i386/acpi-build.c                 | 246 ++++++++++++++++-------------------
 tests/acpi-test-data/pc/DSDT         | Bin 3028 -> 5478 bytes
 tests/acpi-test-data/pc/DSDT.bridge  | Bin 0 -> 7337 bytes
 tests/acpi-test-data/pc/SSDT         | Bin 2486 -> 0 bytes
 tests/acpi-test-data/pc/SSDT.bridge  | Bin 4345 -> 0 bytes
 tests/acpi-test-data/q35/DSDT        | Bin 7666 -> 8321 bytes
 tests/acpi-test-data/q35/DSDT.bridge | Bin 0 -> 8338 bytes
 tests/acpi-test-data/q35/SSDT        | Bin 691 -> 0 bytes
 tests/acpi-test-data/q35/SSDT.bridge | Bin 708 -> 0 bytes
 9 files changed, 111 insertions(+), 135 deletions(-)
 create mode 100644 tests/acpi-test-data/pc/DSDT.bridge
 delete mode 100644 tests/acpi-test-data/pc/SSDT
 delete mode 100644 tests/acpi-test-data/pc/SSDT.bridge
 create mode 100644 tests/acpi-test-data/q35/DSDT.bridge
 delete mode 100644 tests/acpi-test-data/q35/SSDT
 delete mode 100644 tests/acpi-test-data/q35/SSDT.bridge
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/3 pc: acpi: merge SSDT into DSDT

Since both tables are built dynamically now, there is no point in keeping ASL in them in separate tables.
So do the same as we do for ARM where we have only DSDT table, i.e. move SSDT ASL into DSDT and drop SSDT altogether.
This patch doesn't change moved SSDT ASL in any way, but it opens a way to relatively independently simplify generated ASL on per device/subsystem basis in followup series.
It also simplifies bios-tables-test where expected SSDT blobs could be dropped and only DSDT ones have to be maintained.

---
 hw/i386/acpi-build.c | 246 +++++++++++++++++++++++----------------------------
 1 file changed, 111 insertions(+), 135 deletions(-)
hw/i386/acpi-build.c +111 -135
index 78758e2..b9a2ddd 100644
@@ -1936,24 +1936,113 @@ static Aml *build_q35_osc_method(void)
 }
 
 static void
-build_ssdt(GArray *table_data, GArray *linker,
+build_dsdt(GArray *table_data, GArray *linker,
            AcpiCpuInfo *cpu, AcpiPmInfo *pm, AcpiMiscInfo *misc,
            PcPciInfo *pci, PcGuestInfo *guest_info)
 {
+    CrsRangeEntry *entry;
+    Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs;
+    GPtrArray *mem_ranges = g_ptr_array_new_with_free_func(crs_range_free);
+    GPtrArray *io_ranges = g_ptr_array_new_with_free_func(crs_range_free);
     MachineState *machine = MACHINE(qdev_get_machine());
     uint32_t nr_mem = machine->ram_slots;
-    Aml *ssdt, *sb_scope, *scope, *pkg, *dev, *method, *crs, *field;
-    PCIBus *bus = NULL;
-    GPtrArray *io_ranges = g_ptr_array_new_with_free_func(crs_range_free);
-    GPtrArray *mem_ranges = g_ptr_array_new_with_free_func(crs_range_free);
-    CrsRangeEntry *entry;
     int root_bus_limit = 0xFF;
+    PCIBus *bus = NULL;
     int i;
 
-    ssdt = init_aml_allocator();
+    dsdt = init_aml_allocator();
 
     /* Reserve space for header */
-    acpi_data_push(ssdt->buf, sizeof(AcpiTableHeader));
+    acpi_data_push(dsdt->buf, sizeof(AcpiTableHeader));
+
+    build_dbg_aml(dsdt);
+    if (misc->is_piix4) {
+        sb_scope = aml_scope("_SB");
+        dev = aml_device("PCI0");
+        aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A03")));
+        aml_append(dev, aml_name_decl("_ADR", aml_int(0)));
+        aml_append(dev, aml_name_decl("_UID", aml_int(1)));
+        aml_append(sb_scope, dev);
+        aml_append(dsdt, sb_scope);
+
+        build_hpet_aml(dsdt);
+        build_piix4_pm(dsdt);
+        build_piix4_isa_bridge(dsdt);
+        build_isa_devices_aml(dsdt);
+        build_piix4_pci_hotplug(dsdt);
+        build_piix4_pci0_int(dsdt);
+    } else {
+        sb_scope = aml_scope("_SB");
+        aml_append(sb_scope,
+            aml_operation_region("PCST", AML_SYSTEM_IO, 0xae00, 0x0c));
+        aml_append(sb_scope,
+            aml_operation_region("PCSB", AML_SYSTEM_IO, 0xae0c, 0x01));
+        field = aml_field("PCSB", AML_ANY_ACC, AML_NOLOCK, AML_WRITE_AS_ZEROS);
+        aml_append(field, aml_named_field("PCIB", 8));
+        aml_append(sb_scope, field);
+        aml_append(dsdt, sb_scope);
+
+        sb_scope = aml_scope("_SB");
+        dev = aml_device("PCI0");
+        aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A08")));
+        aml_append(dev, aml_name_decl("_CID", aml_eisaid("PNP0A03")));
+        aml_append(dev, aml_name_decl("_ADR", aml_int(0)));
+        aml_append(dev, aml_name_decl("_UID", aml_int(1)));
+        aml_append(dev, aml_name_decl("SUPP", aml_int(0)));
+        aml_append(dev, aml_name_decl("CTRL", aml_int(0)));
+        aml_append(dev, build_q35_osc_method());
+        aml_append(sb_scope, dev);
+        aml_append(dsdt, sb_scope);
+
+        build_hpet_aml(dsdt);
+        build_q35_isa_bridge(dsdt);
+        build_isa_devices_aml(dsdt);
+        build_q35_pci0_int(dsdt);
+    }
+
+    build_cpu_hotplug_aml(dsdt);
+    build_memory_hotplug_aml(dsdt, nr_mem, pm->mem_hp_io_base,
+                             pm->mem_hp_io_len);
+
+    scope =  aml_scope("_GPE");
+    {
+        aml_append(scope, aml_name_decl("_HID", aml_string("ACPI0006")));
+
+        aml_append(scope, aml_method("_L00", 0, AML_NOTSERIALIZED));
+
+        if (misc->is_piix4) {
+            method = aml_method("_E01", 0, AML_NOTSERIALIZED);
+            aml_append(method,
+                aml_acquire(aml_name("\\_SB.PCI0.BLCK"), 0xFFFF));
+            aml_append(method, aml_call0("\\_SB.PCI0.PCNT"));
+            aml_append(method, aml_release(aml_name("\\_SB.PCI0.BLCK")));
+            aml_append(scope, method);
+        } else {
+            aml_append(scope, aml_method("_L01", 0, AML_NOTSERIALIZED));
+        }
+
+        method = aml_method("_E02", 0, AML_NOTSERIALIZED);
+        aml_append(method, aml_call0("\\_SB." CPU_SCAN_METHOD));
+        aml_append(scope, method);
+
+        method = aml_method("_E03", 0, AML_NOTSERIALIZED);
+        aml_append(method, aml_call0(MEMORY_HOTPLUG_HANDLER_PATH));
+        aml_append(scope, method);
+
+        aml_append(scope, aml_method("_L04", 0, AML_NOTSERIALIZED));
+        aml_append(scope, aml_method("_L05", 0, AML_NOTSERIALIZED));
+        aml_append(scope, aml_method("_L06", 0, AML_NOTSERIALIZED));
+        aml_append(scope, aml_method("_L07", 0, AML_NOTSERIALIZED));
+        aml_append(scope, aml_method("_L08", 0, AML_NOTSERIALIZED));
+        aml_append(scope, aml_method("_L09", 0, AML_NOTSERIALIZED));
+        aml_append(scope, aml_method("_L0A", 0, AML_NOTSERIALIZED));
+        aml_append(scope, aml_method("_L0B", 0, AML_NOTSERIALIZED));
+        aml_append(scope, aml_method("_L0C", 0, AML_NOTSERIALIZED));
+        aml_append(scope, aml_method("_L0D", 0, AML_NOTSERIALIZED));
+        aml_append(scope, aml_method("_L0E", 0, AML_NOTSERIALIZED));
+        aml_append(scope, aml_method("_L0F", 0, AML_NOTSERIALIZED));
+    }
+    aml_append(dsdt, scope);
 
     bus = PC_MACHINE(machine)->bus;
     if (bus) {
@@ -1985,7 +2074,7 @@ build_ssdt(GArray *table_data, GArray *linker,
                             io_ranges, mem_ranges);
             aml_append(dev, aml_name_decl("_CRS", crs));
             aml_append(scope, dev);
-            aml_append(ssdt, scope);
+            aml_append(dsdt, scope);
         }
     }
 
@@ -2069,7 +2158,7 @@ build_ssdt(GArray *table_data, GArray *linker,
         aml_append(dev, aml_name_decl("_CRS", crs));
         aml_append(scope, dev);
     }
-    aml_append(ssdt, scope);
+    aml_append(dsdt, scope);
 
     /*  create S3_ / S4_ / S5_ packages if necessary */
     scope = aml_scope("\\");
@@ -2098,7 +2187,7 @@ build_ssdt(GArray *table_data, GArray *linker,
     aml_append(pkg, aml_int(0)); /* reserved */
     aml_append(pkg, aml_int(0)); /* reserved */
     aml_append(scope, aml_name_decl("_S5", pkg));
-    aml_append(ssdt, scope);
+    aml_append(dsdt, scope);
 
     if (misc->applesmc_io_base) {
         scope = aml_scope("\\_SB.PCI0.ISA");
@@ -2117,7 +2206,7 @@ build_ssdt(GArray *table_data, GArray *linker,
         aml_append(dev, aml_name_decl("_CRS", crs));
 
         aml_append(scope, dev);
-        aml_append(ssdt, scope);
+        aml_append(dsdt, scope);
     }
 
     if (misc->pvpanic_port) {
@@ -2151,7 +2240,7 @@ build_ssdt(GArray *table_data, GArray *linker,
         aml_append(dev, method);
 
         aml_append(scope, dev);
-        aml_append(ssdt, scope);
+        aml_append(dsdt, scope);
     }
 
     sb_scope = aml_scope("\\_SB");
@@ -2190,14 +2279,14 @@ build_ssdt(GArray *table_data, GArray *linker,
                 aml_append(sb_scope, scope);
             }
         }
-        aml_append(ssdt, sb_scope);
+        aml_append(dsdt, sb_scope);
     }
 
     /* copy AML table into ACPI tables blob and patch header there */
-    g_array_append_vals(table_data, ssdt->buf->data, ssdt->buf->len);
+    g_array_append_vals(table_data, dsdt->buf->data, dsdt->buf->len);
     build_header(linker, table_data,
-        (void *)(table_data->data + table_data->len - ssdt->buf->len),
-        "SSDT", ssdt->buf->len, 1, NULL);
+        (void *)(table_data->data + table_data->len - dsdt->buf->len),
+        "DSDT", dsdt->buf->len, 1, NULL);
     free_aml_allocator();
 }
 
@@ -2423,116 +2512,6 @@ build_dmar_q35(GArray *table_data, GArray *linker)
                  "DMAR", table_data->len - dmar_start, 1, NULL);
 }
 
-static void
-build_dsdt(GArray *table_data, GArray *linker,
-           AcpiPmInfo *pm, AcpiMiscInfo *misc)
-{
-    Aml *dsdt, *sb_scope, *scope, *dev, *method, *field;
-    MachineState *machine = MACHINE(qdev_get_machine());
-    uint32_t nr_mem = machine->ram_slots;
-
-    dsdt = init_aml_allocator();
-
-    /* Reserve space for header */
-    acpi_data_push(dsdt->buf, sizeof(AcpiTableHeader));
-
-    build_dbg_aml(dsdt);
-    if (misc->is_piix4) {
-        sb_scope = aml_scope("_SB");
-        dev = aml_device("PCI0");
-        aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A03")));
-        aml_append(dev, aml_name_decl("_ADR", aml_int(0)));
-        aml_append(dev, aml_name_decl("_UID", aml_int(1)));
-        aml_append(sb_scope, dev);
-        aml_append(dsdt, sb_scope);
-
-        build_hpet_aml(dsdt);
-        build_piix4_pm(dsdt);
-        build_piix4_isa_bridge(dsdt);
-        build_isa_devices_aml(dsdt);
-        build_piix4_pci_hotplug(dsdt);
-        build_piix4_pci0_int(dsdt);
-    } else {
-        sb_scope = aml_scope("_SB");
-        aml_append(sb_scope,
-            aml_operation_region("PCST", AML_SYSTEM_IO, 0xae00, 0x0c));
-        aml_append(sb_scope,
-            aml_operation_region("PCSB", AML_SYSTEM_IO, 0xae0c, 0x01));
-        field = aml_field("PCSB", AML_ANY_ACC, AML_NOLOCK, AML_WRITE_AS_ZEROS);
-        aml_append(field, aml_named_field("PCIB", 8));
-        aml_append(sb_scope, field);
-        aml_append(dsdt, sb_scope);
-
-        sb_scope = aml_scope("_SB");
-        dev = aml_device("PCI0");
-        aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A08")));
-        aml_append(dev, aml_name_decl("_CID", aml_eisaid("PNP0A03")));
-        aml_append(dev, aml_name_decl("_ADR", aml_int(0)));
-        aml_append(dev, aml_name_decl("_UID", aml_int(1)));
-        aml_append(dev, aml_name_decl("SUPP", aml_int(0)));
-        aml_append(dev, aml_name_decl("CTRL", aml_int(0)));
-        aml_append(dev, build_q35_osc_method());
-        aml_append(sb_scope, dev);
-        aml_append(dsdt, sb_scope);
-
-        build_hpet_aml(dsdt);
-        build_q35_isa_bridge(dsdt);
-        build_isa_devices_aml(dsdt);
-        build_q35_pci0_int(dsdt);
-    }
-
-    build_cpu_hotplug_aml(dsdt);
-    build_memory_hotplug_aml(dsdt, nr_mem, pm->mem_hp_io_base,
-                             pm->mem_hp_io_len);
-
-    scope =  aml_scope("_GPE");
-    {
-        aml_append(scope, aml_name_decl("_HID", aml_string("ACPI0006")));
-
-        aml_append(scope, aml_method("_L00", 0, AML_NOTSERIALIZED));
-
-        if (misc->is_piix4) {
-            method = aml_method("_E01", 0, AML_NOTSERIALIZED);
-            aml_append(method,
-                aml_acquire(aml_name("\\_SB.PCI0.BLCK"), 0xFFFF));
-            aml_append(method, aml_call0("\\_SB.PCI0.PCNT"));
-            aml_append(method, aml_release(aml_name("\\_SB.PCI0.BLCK")));
-            aml_append(scope, method);
-        } else {
-            aml_append(scope, aml_method("_L01", 0, AML_NOTSERIALIZED));
-        }
-
-        method = aml_method("_E02", 0, AML_NOTSERIALIZED);
-        aml_append(method, aml_call0("\\_SB." CPU_SCAN_METHOD));
-        aml_append(scope, method);
-
-        method = aml_method("_E03", 0, AML_NOTSERIALIZED);
-        aml_append(method, aml_call0(MEMORY_HOTPLUG_HANDLER_PATH));
-        aml_append(scope, method);
-
-        aml_append(scope, aml_method("_L04", 0, AML_NOTSERIALIZED));
-        aml_append(scope, aml_method("_L05", 0, AML_NOTSERIALIZED));
-        aml_append(scope, aml_method("_L06", 0, AML_NOTSERIALIZED));
-        aml_append(scope, aml_method("_L07", 0, AML_NOTSERIALIZED));
-        aml_append(scope, aml_method("_L08", 0, AML_NOTSERIALIZED));
-        aml_append(scope, aml_method("_L09", 0, AML_NOTSERIALIZED));
-        aml_append(scope, aml_method("_L0A", 0, AML_NOTSERIALIZED));
-        aml_append(scope, aml_method("_L0B", 0, AML_NOTSERIALIZED));
-        aml_append(scope, aml_method("_L0C", 0, AML_NOTSERIALIZED));
-        aml_append(scope, aml_method("_L0D", 0, AML_NOTSERIALIZED));
-        aml_append(scope, aml_method("_L0E", 0, AML_NOTSERIALIZED));
-        aml_append(scope, aml_method("_L0F", 0, AML_NOTSERIALIZED));
-    }
-    aml_append(dsdt, scope);
-
-    /* copy AML table into ACPI tables blob and patch header there */
-    g_array_append_vals(table_data, dsdt->buf->data, dsdt->buf->len);
-    build_header(linker, table_data,
-        (void *)(table_data->data + table_data->len - dsdt->buf->len),
-        "DSDT", dsdt->buf->len, 1, NULL);
-    free_aml_allocator();
-}
-
 static GArray *
 build_rsdp(GArray *rsdp_table, GArray *linker, unsigned rsdt)
 {
@@ -2612,7 +2591,7 @@ static
 void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
 {
     GArray *table_offsets;
-    unsigned facs, ssdt, dsdt, rsdt;
+    unsigned facs, dsdt, rsdt, fadt;
     AcpiCpuInfo cpu;
     AcpiPmInfo pm;
     AcpiMiscInfo misc;
@@ -2645,7 +2624,8 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
 
     /* DSDT is pointed to by FADT */
     dsdt = tables_blob->len;
-    build_dsdt(tables_blob, tables->linker, &pm, &misc);
+    build_dsdt(tables_blob, tables->linker, &cpu, &pm, &misc, &pci,
+               guest_info);
 
     /* Count the size of the DSDT and SSDT, we will need it for legacy
      * sizing of ACPI tables.
@@ -2653,14 +2633,10 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
     aml_len += tables_blob->len - dsdt;
 
     /* ACPI tables pointed to by RSDT */
+    fadt = tables_blob->len;
     acpi_add_table(table_offsets, tables_blob);
     build_fadt(tables_blob, tables->linker, &pm, facs, dsdt);
-
-    ssdt = tables_blob->len;
-    acpi_add_table(table_offsets, tables_blob);
-    build_ssdt(tables_blob, tables->linker, &cpu, &pm, &misc, &pci,
-               guest_info);
-    aml_len += tables_blob->len - ssdt;
+    aml_len += tables_blob->len - fadt;
 
     acpi_add_table(table_offsets, tables_blob);
     build_madt(tables_blob, tables->linker, &cpu, guest_info);
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 2/3 tests: pc: acpi: drop not needed 'expected SSDT' blobs

In reply to Igor Mammedov
---
 tests/acpi-test-data/pc/SSDT         | Bin 2486 -> 0 bytes
 tests/acpi-test-data/pc/SSDT.bridge  | Bin 4345 -> 0 bytes
 tests/acpi-test-data/q35/SSDT        | Bin 691 -> 0 bytes
 tests/acpi-test-data/q35/SSDT.bridge | Bin 708 -> 0 bytes
 4 files changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 tests/acpi-test-data/pc/SSDT
 delete mode 100644 tests/acpi-test-data/pc/SSDT.bridge
 delete mode 100644 tests/acpi-test-data/q35/SSDT
 delete mode 100644 tests/acpi-test-data/q35/SSDT.bridge
tests/acpi-test-data/pc/SSDT deleted binary +0 -0
deleted file mode 100644
index 210d6a71e58aa34ce8e94121d25bcf58c3bd503c..0000000000000000000000000000000000000000
GIT binary patch
tests/acpi-test-data/pc/SSDT.bridge deleted binary +0 -0
deleted file mode 100644
index 6e6660b1fbe0bdb7fe0b257cb53c31fa9bb21a14..0000000000000000000000000000000000000000
GIT binary patch
tests/acpi-test-data/q35/SSDT deleted binary +0 -0
deleted file mode 100644
index 0970c67ddb1456707c0111f7e5e659ef385af408..0000000000000000000000000000000000000000
GIT binary patch
tests/acpi-test-data/q35/SSDT.bridge deleted binary +0 -0
deleted file mode 100644
index a77868861754ce0b3333b2b7bc8091c03a53754d..0000000000000000000000000000000000000000
GIT binary patch
Signature · 1 line
1.8.3.1
#3 lore raw

PATCH 3/3 tests: pc: acpi: add expected DSDT.bridge blobs and update DSDT blobs

In reply to Igor Mammedov
---
 tests/acpi-test-data/pc/DSDT         | Bin 3028 -> 5478 bytes
 tests/acpi-test-data/pc/DSDT.bridge  | Bin 0 -> 7337 bytes
 tests/acpi-test-data/q35/DSDT        | Bin 7666 -> 8321 bytes
 tests/acpi-test-data/q35/DSDT.bridge | Bin 0 -> 8338 bytes
 4 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 tests/acpi-test-data/pc/DSDT.bridge
 create mode 100644 tests/acpi-test-data/q35/DSDT.bridge
tests/acpi-test-data/pc/DSDT binary +0 -0
index c658203db94a7e7db7c36fde99a7075a8d75498d..ec0e642b06967d3ec4d7a7d252b82b916f37a5e0 100644
GIT binary patch
tests/acpi-test-data/pc/DSDT.bridge new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..7b1c14b529f9f63fc3731c02225ce37c5cfbc0db
GIT binary patch
tests/acpi-test-data/q35/DSDT binary +0 -0
index 4723e5954dccb00995ccaf521b7daf6bf15cf1d4..b492f04b8866ae82eaded81aa0ea2d3a4969dc5c 100644
GIT binary patch
tests/acpi-test-data/q35/DSDT.bridge new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..3b72e250fa866ec34c315450643025e03c8c8cab
GIT binary patch
Signature · 1 line
1.8.3.1
#4 lore raw
In reply to Igor Mammedov
Quoted 5 lines · Igor Mammedov

Merging both tables will allow for futher ASL simplification and cleanups per device/subsystem And it also allows to reduce number of expected binary blobs for ACPI tests which reduces tests maintenance.

What this does break, however, is adding XSDT which we might need to do in the future.
I'd rather do the reverse and have as much as possible in the SSDT.

Quoted 29 lines

Boot tested with RHEL72, WS2003, WS2012R2 guests.

git tree for testing:
https://github.com/imammedo/qemu.git merge_ssdt_into_dsdt_v1

Igor Mammedov (3):
pc: acpi: merge SSDT into DSDT
tests: pc: acpi: drop not needed 'expected SSDT' blobs
tests: pc: acpi: add expected DSDT.bridge blobs and update DSDT blobs

 hw/i386/acpi-build.c                 | 246 ++++++++++++++++-------------------
 tests/acpi-test-data/pc/DSDT         | Bin 3028 -> 5478 bytes
 tests/acpi-test-data/pc/DSDT.bridge  | Bin 0 -> 7337 bytes
 tests/acpi-test-data/pc/SSDT         | Bin 2486 -> 0 bytes
 tests/acpi-test-data/pc/SSDT.bridge  | Bin 4345 -> 0 bytes
 tests/acpi-test-data/q35/DSDT        | Bin 7666 -> 8321 bytes
 tests/acpi-test-data/q35/DSDT.bridge | Bin 0 -> 8338 bytes
 tests/acpi-test-data/q35/SSDT        | Bin 691 -> 0 bytes
 tests/acpi-test-data/q35/SSDT.bridge | Bin 708 -> 0 bytes
 9 files changed, 111 insertions(+), 135 deletions(-)
 create mode 100644 tests/acpi-test-data/pc/DSDT.bridge
 delete mode 100644 tests/acpi-test-data/pc/SSDT
 delete mode 100644 tests/acpi-test-data/pc/SSDT.bridge
 create mode 100644 tests/acpi-test-data/q35/DSDT.bridge
 delete mode 100644 tests/acpi-test-data/q35/SSDT
 delete mode 100644 tests/acpi-test-data/q35/SSDT.bridge
Signature · 1 line
1.8.3.1
#5 lore raw
Quoted 11 lines · On Sun, 24 Jan 2016 08:32:23 +0200 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 5 lines · Igor Mammedov

Merging both tables will allow for futher ASL
simplification and cleanups per device/subsystem
And it also allows to reduce number of expected
binary blobs for ACPI tests which reduces tests
maintenance.

What this does break, however, is adding XSDT which we might need to do in the future.
I'd rather do the reverse and have as much as possible in the SSDT.

It doesn't forbid us adding XSDT later,
DSDT should be kept XP compatible as it's more or less now and incompatible features we could put in their own SSDTs if we decide to go for XSDT approach to hide them form XP. For example I plan to move cpu/memory hotplug ASL into separate SSDTs and continue to simplify DSDT on top of this series.

Quoted 33 lines
Quoted 32 lines

Boot tested with RHEL72, WS2003, WS2012R2 guests.

git tree for testing:
https://github.com/imammedo/qemu.git merge_ssdt_into_dsdt_v1

Igor Mammedov (3):
pc: acpi: merge SSDT into DSDT
tests: pc: acpi: drop not needed 'expected SSDT' blobs
tests: pc: acpi: add expected DSDT.bridge blobs and update DSDT
blobs

 hw/i386/acpi-build.c                 | 246
++++++++++++++++-------------------
tests/acpi-test-data/pc/DSDT         | Bin 3028 -> 5478 bytes
tests/acpi-test-data/pc/DSDT.bridge  | Bin 0 -> 7337 bytes
tests/acpi-test-data/pc/SSDT         | Bin 2486 -> 0 bytes
tests/acpi-test-data/pc/SSDT.bridge  | Bin 4345 -> 0 bytes
tests/acpi-test-data/q35/DSDT        | Bin 7666 -> 8321 bytes
tests/acpi-test-data/q35/DSDT.bridge | Bin 0 -> 8338 bytes
tests/acpi-test-data/q35/SSDT        | Bin 691 -> 0 bytes
tests/acpi-test-data/q35/SSDT.bridge | Bin 708 -> 0 bytes 9 files

changed, 111 insertions(+), 135 deletions(-) create mode 100644 tests/acpi-test-data/pc/DSDT.bridge delete mode 100644 tests/acpi-test-data/pc/SSDT delete mode 100644 tests/acpi-test-data/pc/SSDT.bridge create mode 100644 tests/acpi-test-data/q35/DSDT.bridge delete mode 100644 tests/acpi-test-data/q35/SSDT delete mode 100644 tests/acpi-test-data/q35/SSDT.bridge

Signature · 1 line
1.8.3.1
#6 lore raw
Quoted 10 lines · Igor Mammedov
Quoted 7 lines · On Sun, 24 Jan 2016 08:32:23 +0200 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 5 lines · Igor Mammedov

Merging both tables will allow for futher ASL
simplification and cleanups per device/subsystem
And it also allows to reduce number of expected
binary blobs for ACPI tests which reduces tests
maintenance.

Quoted 5 lines
Quoted 4 lines

What this does break, however, is adding XSDT which we might need to do in the future.
I'd rather do the reverse and have as much as possible in the SSDT.

It doesn't forbid us adding XSDT later,

Right but we'll have to duplicate dsdt in xsdt, right?

Quoted 5 lines

DSDT should be kept XP compatible as it's more or less now and incompatible features we could put in their own SSDTs if we decide to go for XSDT approach to hide them form XP. For example I plan to move cpu/memory hotplug ASL into separate SSDTs and continue to simplify DSDT on top of this series.

So I'm kind of confused. Why move hotplug to dsdt then move them back out to an SSDT? Let's just put everything in an SSDT ...

Quoted 33 lines
Quoted 33 lines
Quoted 32 lines

Boot tested with RHEL72, WS2003, WS2012R2 guests.

git tree for testing:
https://github.com/imammedo/qemu.git merge_ssdt_into_dsdt_v1

Igor Mammedov (3):
pc: acpi: merge SSDT into DSDT
tests: pc: acpi: drop not needed 'expected SSDT' blobs
tests: pc: acpi: add expected DSDT.bridge blobs and update DSDT
blobs

 hw/i386/acpi-build.c                 | 246
++++++++++++++++-------------------
tests/acpi-test-data/pc/DSDT         | Bin 3028 -> 5478 bytes
tests/acpi-test-data/pc/DSDT.bridge  | Bin 0 -> 7337 bytes
tests/acpi-test-data/pc/SSDT         | Bin 2486 -> 0 bytes
tests/acpi-test-data/pc/SSDT.bridge  | Bin 4345 -> 0 bytes
tests/acpi-test-data/q35/DSDT        | Bin 7666 -> 8321 bytes
tests/acpi-test-data/q35/DSDT.bridge | Bin 0 -> 8338 bytes
tests/acpi-test-data/q35/SSDT        | Bin 691 -> 0 bytes
tests/acpi-test-data/q35/SSDT.bridge | Bin 708 -> 0 bytes 9 files

changed, 111 insertions(+), 135 deletions(-) create mode 100644 tests/acpi-test-data/pc/DSDT.bridge delete mode 100644 tests/acpi-test-data/pc/SSDT delete mode 100644 tests/acpi-test-data/pc/SSDT.bridge create mode 100644 tests/acpi-test-data/q35/DSDT.bridge delete mode 100644 tests/acpi-test-data/q35/SSDT delete mode 100644 tests/acpi-test-data/q35/SSDT.bridge

Signature · 1 line
1.8.3.1
#7 lore raw
Quoted 11 lines · On Mon, 25 Jan 2016 15:01:36 +0200 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 10 lines · Igor Mammedov
Quoted 7 lines · On Sun, 24 Jan 2016 08:32:23 +0200 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 5 lines · Igor Mammedov

Merging both tables will allow for futher ASL
simplification and cleanups per device/subsystem
And it also allows to reduce number of expected
binary blobs for ACPI tests which reduces tests
maintenance.

Quoted 7 lines
Quoted 5 lines
Quoted 4 lines

What this does break, however, is adding XSDT which we might need to do in the future.
I'd rather do the reverse and have as much as possible in the SSDT.

It doesn't forbid us adding XSDT later,

Right but we'll have to duplicate dsdt in xsdt, right?

nope, DSDT is pointed by FADT while SSDTs by RSDT/XSDT.

The only reason why we have DSDT/SSDT split now is that DSDT used to be static while SSDT generated dynamically. Now when both tables are dynamically generated there is no point to keep them separate.

I don't see any benefit in keeping empty DSDT as you suggest with all the content in SSDT, it the same as having only DSDT table but we have to maintain 2 tables in code and tests.
If at some point we use XSDT to hide non XP compatible ASL (if that works at all) then SSDT is the place where that non compat ASL should be put and pointed only by XSDT, while the the rest of compatible code should stay in the main mandatory table (i.e. DSDT).

Quoted 10 lines
Quoted 6 lines

DSDT should be kept XP compatible as it's more or less now and incompatible features we could put in their own SSDTs if we decide to go for XSDT approach to hide them form XP. For example I plan to move cpu/memory hotplug ASL into separate SSDTs and continue to simplify DSDT on top of this series.

So I'm kind of confused. Why move hotplug to dsdt then move them back out to an SSDT? Let's just put everything in an SSDT ...

because right now cpu/mem hotplug ASL is split between both tables so the first step to isolating and consolidating scattered parts is to put everything into one table. After that it will be more easy to verify changes that refactoring will introduce using bios-tables-test and should simplify refactoring patches and review.

As for moving hotplug into dedicated SSDTs, it's for purpose of sharing that code with ARM target and later we possible could use it also to hide XP incompatible ASL in them by referencing them from only XSDT.

Why do you insist on putting everything into SSDT instead of DSDT?

Quoted 35 lines
Quoted 34 lines
Quoted 34 lines
Quoted 33 lines

Boot tested with RHEL72, WS2003, WS2012R2 guests.

git tree for testing:
https://github.com/imammedo/qemu.git merge_ssdt_into_dsdt_v1

Igor Mammedov (3):
pc: acpi: merge SSDT into DSDT
tests: pc: acpi: drop not needed 'expected SSDT' blobs
tests: pc: acpi: add expected DSDT.bridge blobs and update DSDT
blobs

 hw/i386/acpi-build.c                 | 246
++++++++++++++++-------------------
tests/acpi-test-data/pc/DSDT         | Bin 3028 -> 5478 bytes
tests/acpi-test-data/pc/DSDT.bridge  | Bin 0 -> 7337 bytes
tests/acpi-test-data/pc/SSDT         | Bin 2486 -> 0 bytes
tests/acpi-test-data/pc/SSDT.bridge  | Bin 4345 -> 0 bytes
tests/acpi-test-data/q35/DSDT        | Bin 7666 -> 8321 bytes
tests/acpi-test-data/q35/DSDT.bridge | Bin 0 -> 8338 bytes
tests/acpi-test-data/q35/SSDT        | Bin 691 -> 0 bytes
tests/acpi-test-data/q35/SSDT.bridge | Bin 708 -> 0 bytes 9 files

changed, 111 insertions(+), 135 deletions(-) create mode 100644 tests/acpi-test-data/pc/DSDT.bridge delete mode 100644 tests/acpi-test-data/pc/SSDT delete mode 100644 tests/acpi-test-data/pc/SSDT.bridge create mode 100644 tests/acpi-test-data/q35/DSDT.bridge delete mode 100644 tests/acpi-test-data/q35/SSDT delete mode 100644 tests/acpi-test-data/q35/SSDT.bridge

Signature · 1 line
1.8.3.1  
#8 lore raw
Quoted 14 lines · Igor Mammedov
Quoted 11 lines · On Mon, 25 Jan 2016 15:01:36 +0200 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 10 lines · Igor Mammedov
Quoted 7 lines · On Sun, 24 Jan 2016 08:32:23 +0200 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 5 lines · Igor Mammedov

Merging both tables will allow for futher ASL
simplification and cleanups per device/subsystem
And it also allows to reduce number of expected
binary blobs for ACPI tests which reduces tests
maintenance.

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
Quoted 4 lines

What this does break, however, is adding XSDT which we might need to do in the future.
I'd rather do the reverse and have as much as possible in the SSDT.

It doesn't forbid us adding XSDT later,

Right but we'll have to duplicate dsdt in xsdt, right?

nope, DSDT is pointed by FADT while SSDTs by RSDT/XSDT.

Oops, I was confused when I wrote this.
You are right, I'll go back and review
everything in light of this.

Quoted 72 lines

The only reason why we have DSDT/SSDT split now is that DSDT used to be static while SSDT generated dynamically. Now when both tables are dynamically generated there is no point to keep them separate.

I don't see any benefit in keeping empty DSDT as you suggest with all the content in SSDT, it the same as having only DSDT table but we have to maintain 2 tables in code and tests.
If at some point we use XSDT to hide non XP compatible ASL (if that works at all) then SSDT is the place where that non compat ASL should be put and pointed only by XSDT, while the the rest of compatible code should stay in the main mandatory table (i.e. DSDT).

Quoted 10 lines
Quoted 6 lines

DSDT should be kept XP compatible as it's more or less now and incompatible features we could put in their own SSDTs if we decide to go for XSDT approach to hide them form XP. For example I plan to move cpu/memory hotplug ASL into separate SSDTs and continue to simplify DSDT on top of this series.

So I'm kind of confused. Why move hotplug to dsdt then move them back out to an SSDT? Let's just put everything in an SSDT ...

because right now cpu/mem hotplug ASL is split between both tables so the first step to isolating and consolidating scattered parts is to put everything into one table. After that it will be more easy to verify changes that refactoring will introduce using bios-tables-test and should simplify refactoring patches and review.

As for moving hotplug into dedicated SSDTs, it's for purpose of sharing that code with ARM target and later we possible could use it also to hide XP incompatible ASL in them by referencing them from only XSDT.

Why do you insist on putting everything into SSDT instead of DSDT?

Quoted 35 lines
Quoted 34 lines
Quoted 34 lines
Quoted 33 lines

Boot tested with RHEL72, WS2003, WS2012R2 guests.

git tree for testing:
https://github.com/imammedo/qemu.git merge_ssdt_into_dsdt_v1

Igor Mammedov (3):
pc: acpi: merge SSDT into DSDT
tests: pc: acpi: drop not needed 'expected SSDT' blobs
tests: pc: acpi: add expected DSDT.bridge blobs and update DSDT
blobs

 hw/i386/acpi-build.c                 | 246
++++++++++++++++-------------------
tests/acpi-test-data/pc/DSDT         | Bin 3028 -> 5478 bytes
tests/acpi-test-data/pc/DSDT.bridge  | Bin 0 -> 7337 bytes
tests/acpi-test-data/pc/SSDT         | Bin 2486 -> 0 bytes
tests/acpi-test-data/pc/SSDT.bridge  | Bin 4345 -> 0 bytes
tests/acpi-test-data/q35/DSDT        | Bin 7666 -> 8321 bytes
tests/acpi-test-data/q35/DSDT.bridge | Bin 0 -> 8338 bytes
tests/acpi-test-data/q35/SSDT        | Bin 691 -> 0 bytes
tests/acpi-test-data/q35/SSDT.bridge | Bin 708 -> 0 bytes 9 files

changed, 111 insertions(+), 135 deletions(-) create mode 100644 tests/acpi-test-data/pc/DSDT.bridge delete mode 100644 tests/acpi-test-data/pc/SSDT delete mode 100644 tests/acpi-test-data/pc/SSDT.bridge create mode 100644 tests/acpi-test-data/q35/DSDT.bridge delete mode 100644 tests/acpi-test-data/q35/SSDT delete mode 100644 tests/acpi-test-data/q35/SSDT.bridge

Signature · 1 line
1.8.3.1  
#9 lore raw
In reply to Igor Mammedov
Quoted 5 lines · On Fri, 22 Jan 2016 15:36:05 +0100 Igor Mammedov <[email protected]> wrote:

Merging both tables will allow for futher ASL simplification and cleanups per device/subsystem And it also allows to reduce number of expected binary blobs for ACPI tests which reduces tests maintenance.

ping

Quoted 28 lines

Boot tested with RHEL72, WS2003, WS2012R2 guests.

git tree for testing:
https://github.com/imammedo/qemu.git merge_ssdt_into_dsdt_v1

Igor Mammedov (3):
pc: acpi: merge SSDT into DSDT
tests: pc: acpi: drop not needed 'expected SSDT' blobs
tests: pc: acpi: add expected DSDT.bridge blobs and update DSDT blobs

 hw/i386/acpi-build.c                 | 246 ++++++++++++++++-------------------
 tests/acpi-test-data/pc/DSDT         | Bin 3028 -> 5478 bytes
 tests/acpi-test-data/pc/DSDT.bridge  | Bin 0 -> 7337 bytes
 tests/acpi-test-data/pc/SSDT         | Bin 2486 -> 0 bytes
 tests/acpi-test-data/pc/SSDT.bridge  | Bin 4345 -> 0 bytes
 tests/acpi-test-data/q35/DSDT        | Bin 7666 -> 8321 bytes
 tests/acpi-test-data/q35/DSDT.bridge | Bin 0 -> 8338 bytes
 tests/acpi-test-data/q35/SSDT        | Bin 691 -> 0 bytes
 tests/acpi-test-data/q35/SSDT.bridge | Bin 708 -> 0 bytes
 9 files changed, 111 insertions(+), 135 deletions(-)
 create mode 100644 tests/acpi-test-data/pc/DSDT.bridge
 delete mode 100644 tests/acpi-test-data/pc/SSDT
 delete mode 100644 tests/acpi-test-data/pc/SSDT.bridge
 create mode 100644 tests/acpi-test-data/q35/DSDT.bridge
 delete mode 100644 tests/acpi-test-data/q35/SSDT
 delete mode 100644 tests/acpi-test-data/q35/SSDT.bridge