Skip to contentSkip to conversation

move ssdt-misc.dsl to the DSDT

PATCH In review Paolo Bonzini 3 participants 7 messages Jan 19, 2015 – Jan 20, 2015

lore
Share & tools
lore
#0 lore raw

v3 cover move ssdt-misc.dsl to the DSDT

See v2 for motivation.

v2->v3: dropped pointer passing and patch 4.

Paolo Bonzini (3):
pc: append ssdt-misc.dsl to the DSDT
pc: rename ssdt-misc to dsdt-common
pc: move common parts of the DSDT to dsdt-common

 hw/i386/Makefile.objs                           |    2 +-
 hw/i386/acpi-build.c                            |   85 +-
 hw/i386/{ssdt-misc.dsl => acpi-dsdt-common.dsl} |   22 +-
 hw/i386/acpi-dsdt-common.hex.generated          | 1897 ++++++++++++++
 hw/i386/acpi-dsdt-isa.dsl                       |    6 +-
 hw/i386/acpi-dsdt.dsl                           |   12 +-
 hw/i386/acpi-dsdt.hex.generated                 | 3119 ++++++-----------------
 hw/i386/q35-acpi-dsdt.dsl                       |    9 +-
 hw/i386/q35-acpi-dsdt.hex.generated             | 2787 +++++---------------
 hw/i386/ssdt-misc.hex.generated                 |  399 ---
 tests/acpi-test-data/pc/DSDT                    |  Bin 3592 -> 3923 bytes
 tests/acpi-test-data/pc/SSDT                    |  Bin 2279 -> 1951 bytes
 tests/acpi-test-data/q35/DSDT                   |  Bin 8182 -> 8513 bytes
 tests/acpi-test-data/q35/SSDT                   |  Bin 560 -> 232 bytes
 14 files changed, 3430 insertions(+), 4908 deletions(-)
 rename hw/i386/{ssdt-misc.dsl => acpi-dsdt-common.dsl} (89%)
 create mode 100644 hw/i386/acpi-dsdt-common.hex.generated
 delete mode 100644 hw/i386/ssdt-misc.hex.generated
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH v3 1/3 pc: append ssdt-misc.dsl to the DSDT

This part of the ACPI tables can vary in size across machine types, but does not depend on the command-line. It is an SSDT just because it is the same for i440fx and Q35, and making it an SSDT made the code a bit simpler. However, it also complicates backwards compatibility, so merge it with the DSDT.

---
 hw/i386/acpi-build.c          |  54 +++++++++++++++++++++++++++---------------
 tests/acpi-test-data/pc/DSDT  | Bin 3592 -> 3920 bytes
 tests/acpi-test-data/pc/SSDT  | Bin 2279 -> 1951 bytes
 tests/acpi-test-data/q35/DSDT | Bin 8182 -> 8510 bytes
 tests/acpi-test-data/q35/SSDT | Bin 560 -> 232 bytes
 5 files changed, 35 insertions(+), 19 deletions(-)
hw/i386/acpi-build.c +35 -19
index 6a2e9c5..c8eac00 100644
@@ -1064,26 +1064,18 @@ static void patch_pci_windows(PcPciInfo *pci, uint8_t *start, unsigned size)
     }
 }
 
+#define SSDT_MISC_SIZE (sizeof(ssdt_misc_aml) - sizeof(AcpiTableHeader))
+
 static void
-build_ssdt(GArray *table_data, GArray *linker,
-           AcpiCpuInfo *cpu, AcpiPmInfo *pm, AcpiMiscInfo *misc,
-           PcPciInfo *pci, PcGuestInfo *guest_info)
+push_ssdt_misc(GArray *table_data, AcpiPmInfo *pm, AcpiMiscInfo *misc,
+               PcPciInfo *pci)
 {
     MachineState *machine = MACHINE(qdev_get_machine());
     uint32_t nr_mem = machine->ram_slots;
-    unsigned acpi_cpus = guest_info->apic_id_limit;
-    int ssdt_start = table_data->len;
     uint8_t *ssdt_ptr;
-    int i;
-
-    /* The current AML generator can cover the APIC ID range [0..255],
-     * inclusive, for VCPU hotplug. */
-    QEMU_BUILD_BUG_ON(ACPI_CPU_HOTPLUG_ID_LIMIT > 256);
-    g_assert(acpi_cpus <= ACPI_CPU_HOTPLUG_ID_LIMIT);
 
     /* Copy header and patch values in the S3_ / S4_ / S5_ packages */
-    ssdt_ptr = acpi_data_push(table_data, sizeof(ssdp_misc_aml));
-    memcpy(ssdt_ptr, ssdp_misc_aml, sizeof(ssdp_misc_aml));
+    ssdt_ptr = g_memdup(ssdp_misc_aml, sizeof(ssdp_misc_aml));
     if (pm->s3_disabled) {
         ssdt_ptr[acpi_s3_name[0]] = 'X';
     }
@@ -1102,6 +1094,27 @@ build_ssdt(GArray *table_data, GArray *linker,
     ACPI_BUILD_SET_LE(ssdt_ptr, sizeof(ssdp_misc_aml),
                       ssdt_mctrl_nr_slots[0], 32, nr_mem);
 
+    g_array_append_vals(table_data, ssdt_ptr + sizeof(AcpiTableHeader), SSDT_MISC_SIZE);
+    g_free(ssdt_ptr);
+}
+
+static void
+build_ssdt(GArray *table_data, GArray *linker,
+           AcpiCpuInfo *cpu, AcpiPmInfo *pm, PcGuestInfo *guest_info)
+{
+    MachineState *machine = MACHINE(qdev_get_machine());
+    uint32_t nr_mem = machine->ram_slots;
+    unsigned acpi_cpus = guest_info->apic_id_limit;
+    int ssdt_start = table_data->len;
+    int i;
+
+    acpi_data_push(table_data, sizeof(AcpiTableHeader));
+
+    /* The current AML generator can cover the APIC ID range [0..255],
+     * inclusive, for VCPU hotplug. */
+    QEMU_BUILD_BUG_ON(ACPI_CPU_HOTPLUG_ID_LIMIT > 256);
+    g_assert(acpi_cpus <= ACPI_CPU_HOTPLUG_ID_LIMIT);
+
     {
         GArray *sb_scope = build_alloc_array();
         uint8_t op = 0x10; /* ScopeOp */
@@ -1426,18 +1439,22 @@ build_dmar_q35(GArray *table_data, GArray *linker)
 }
 
 static void
-build_dsdt(GArray *table_data, GArray *linker, AcpiMiscInfo *misc)
+build_dsdt(GArray *table_data, GArray *linker, AcpiPmInfo *pm,
+           AcpiMiscInfo *misc, PcPciInfo *pci)
 {
     AcpiTableHeader *dsdt;
+    size_t dsdt_start = table_data->len;
 
     assert(misc->dsdt_code && misc->dsdt_size);
 
     dsdt = acpi_data_push(table_data, misc->dsdt_size);
     memcpy(dsdt, misc->dsdt_code, misc->dsdt_size);
 
+    push_ssdt_misc(table_data, pm, misc, pci);
+
     memset(dsdt, 0, sizeof *dsdt);
-    build_header(linker, table_data, dsdt, "DSDT",
-                 misc->dsdt_size, 1);
+    build_header(linker, table_data, (void *)(table_data->data + dsdt_start),
+                 "DSDT", table_data->len - dsdt_start, 1);
 }
 
 /* Build final rsdt table */
@@ -1594,7 +1611,7 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
 
     /* DSDT is pointed to by FADT */
     dsdt = tables->table_data->len;
-    build_dsdt(tables->table_data, tables->linker, &misc);
+    build_dsdt(tables->table_data, tables->linker, &pm, &misc, &pci);
 
     /* Count the size of the DSDT and SSDT, we will need it for legacy
      * sizing of ACPI tables.
@@ -1607,8 +1624,7 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
 
     ssdt = tables->table_data->len;
     acpi_add_table(table_offsets, tables->table_data);
-    build_ssdt(tables->table_data, tables->linker, &cpu, &pm, &misc, &pci,
-               guest_info);
+    build_ssdt(tables->table_data, tables->linker, &cpu, &pm, guest_info);
     aml_len += tables->table_data->len - ssdt;
 
     acpi_add_table(table_offsets, tables->table_data);
tests/acpi-test-data/pc/DSDT binary +0 -0
index ee9cc6781cea3a9515b9a176eea3459f8e4d8655..9bcc9ba9540f768afeba95231229e093b538d020 100644
GIT binary patch
tests/acpi-test-data/pc/SSDT binary +0 -0
index 558e4c85b031ec081045aec6cc382a680e9c6009..0dd46c68d186f6cb1fb7ee5ad935945fed4f31e8 100644
GIT binary patch
tests/acpi-test-data/q35/DSDT binary +0 -0
index ef0c75f4236de3e6f727e21991533f2bf8279dee..c30ec0462acee10c55e1035ba0e6798a0739dc35 100644
GIT binary patch
tests/acpi-test-data/q35/SSDT binary +0 -0
index 4e45510181c4038505ae1815b76799a2cd0e8808..3700bcc31e1469d4b9aafbf34963d937200a6f15 100644
GIT binary patch
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH v3 2/3 pc: rename ssdt-misc to dsdt-common

In reply to Paolo Bonzini

All the changes to generated files are in the header, so there is no need to rebuild test data.

---
 hw/i386/Makefile.objs                              |  2 +-
 hw/i386/acpi-build.c                               | 33 +++++++++++-----------
 hw/i386/{ssdt-misc.dsl => acpi-dsdt-common.dsl}    |  8 +++---
 ...ex.generated => acpi-dsdt-common.hex.generated} | 30 ++++++++++----------
 hw/i386/acpi-dsdt.dsl                              |  2 +-
 5 files changed, 38 insertions(+), 37 deletions(-)
 rename hw/i386/{ssdt-misc.dsl => acpi-dsdt-common.dsl} (94%)
 rename hw/i386/{ssdt-misc.hex.generated => acpi-dsdt-common.hex.generated} (93%)
hw/i386/Makefile.objs +1 -1
index 9d419ad..fe6b846 100644
@@ -9,7 +9,7 @@ obj-y += kvmvapic.o
 obj-y += acpi-build.o
 obj-y += bios-linker-loader.o
 hw/i386/acpi-build.o: hw/i386/acpi-build.c hw/i386/acpi-dsdt.hex \
-	hw/i386/ssdt-proc.hex hw/i386/ssdt-pcihp.hex hw/i386/ssdt-misc.hex \
+	hw/i386/ssdt-proc.hex hw/i386/ssdt-pcihp.hex hw/i386/acpi-dsdt-common.hex \
 	hw/i386/acpi-dsdt.hex hw/i386/q35-acpi-dsdt.hex \
 	hw/i386/q35-acpi-dsdt.hex hw/i386/ssdt-mem.hex \
 	hw/i386/ssdt-tpm.hex
hw/i386/acpi-build.c +17 -16
index c8eac00..4ed30d8 100644
@@ -718,7 +718,7 @@ static inline char acpi_get_hex(uint32_t val)
 #define ACPI_SSDT_SIGNATURE 0x54445353 /* SSDT */
 #define ACPI_SSDT_HEADER_LENGTH 36
 
-#include "hw/i386/ssdt-misc.hex"
+#include "hw/i386/acpi-dsdt-common.hex"
 #include "hw/i386/ssdt-pcihp.hex"
 #include "hw/i386/ssdt-tpm.hex"
 
@@ -1064,38 +1064,39 @@ static void patch_pci_windows(PcPciInfo *pci, uint8_t *start, unsigned size)
     }
 }
 
-#define SSDT_MISC_SIZE (sizeof(ssdt_misc_aml) - sizeof(AcpiTableHeader))
+#define DSDT_COMMON_SIZE (sizeof(dsdt_common_aml) - sizeof(AcpiTableHeader))
 
 static void
-push_ssdt_misc(GArray *table_data, AcpiPmInfo *pm, AcpiMiscInfo *misc,
+push_dsdt_common(GArray *table_data, AcpiPmInfo *pm, AcpiMiscInfo *misc,
                PcPciInfo *pci)
 {
     MachineState *machine = MACHINE(qdev_get_machine());
     uint32_t nr_mem = machine->ram_slots;
-    uint8_t *ssdt_ptr;
+    uint8_t *dsdt_ptr;
 
     /* Copy header and patch values in the S3_ / S4_ / S5_ packages */
-    ssdt_ptr = g_memdup(ssdp_misc_aml, sizeof(ssdp_misc_aml));
+    dsdt_ptr = g_memdup(dsdt_common_aml, sizeof(dsdt_common_aml));
     if (pm->s3_disabled) {
-        ssdt_ptr[acpi_s3_name[0]] = 'X';
+        dsdt_ptr[acpi_s3_name[0]] = 'X';
     }
     if (pm->s4_disabled) {
-        ssdt_ptr[acpi_s4_name[0]] = 'X';
+        dsdt_ptr[acpi_s4_name[0]] = 'X';
     } else {
-        ssdt_ptr[acpi_s4_pkg[0] + 1] = ssdt_ptr[acpi_s4_pkg[0] + 3] =
+        dsdt_ptr[acpi_s4_pkg[0] + 1] = dsdt_ptr[acpi_s4_pkg[0] + 3] =
             pm->s4_val;
     }
 
-    patch_pci_windows(pci, ssdt_ptr, sizeof(ssdp_misc_aml));
+    patch_pci_windows(pci, dsdt_ptr, sizeof(dsdt_common_aml));
 
-    ACPI_BUILD_SET_LE(ssdt_ptr, sizeof(ssdp_misc_aml),
-                      ssdt_isa_pest[0], 16, misc->pvpanic_port);
+    ACPI_BUILD_SET_LE(dsdt_ptr, sizeof(dsdt_common_aml),
+                      dsdt_isa_pest[0], 16, misc->pvpanic_port);
 
-    ACPI_BUILD_SET_LE(ssdt_ptr, sizeof(ssdp_misc_aml),
-                      ssdt_mctrl_nr_slots[0], 32, nr_mem);
+    ACPI_BUILD_SET_LE(dsdt_ptr, sizeof(dsdt_common_aml),
+                      dsdt_mctrl_nr_slots[0], 32, nr_mem);
 
-    g_array_append_vals(table_data, ssdt_ptr + sizeof(AcpiTableHeader), SSDT_MISC_SIZE);
-    g_free(ssdt_ptr);
+    g_array_append_vals(table_data, dsdt_ptr + sizeof(AcpiTableHeader),
+                        DSDT_COMMON_SIZE);
+    g_free(dsdt_ptr);
 }
 
 static void
@@ -1450,7 +1451,7 @@ build_dsdt(GArray *table_data, GArray *linker, AcpiPmInfo *pm,
     dsdt = acpi_data_push(table_data, misc->dsdt_size);
     memcpy(dsdt, misc->dsdt_code, misc->dsdt_size);
 
-    push_ssdt_misc(table_data, pm, misc, pci);
+    push_dsdt_common(table_data, pm, misc, pci);
 
     memset(dsdt, 0, sizeof *dsdt);
     build_header(linker, table_data, (void *)(table_data->data + dsdt_start),
hw/i386/acpi-dsdt-common.dsl renamed from hw/i386/ssdt-misc.dsl +4 -4
similarity index 94%
rename from hw/i386/ssdt-misc.dsl
rename to hw/i386/acpi-dsdt-common.dsl
index 1e3baae..f7849c0 100644
@@ -14,9 +14,9 @@
  */
 #include "hw/acpi/pc-hotplug.h"
 
-ACPI_EXTRACT_ALL_CODE ssdp_misc_aml
+ACPI_EXTRACT_ALL_CODE dsdt_common_aml
 
-DefinitionBlock ("ssdt-misc.aml", "SSDT", 0x01, "BXPC", "BXSSDTSUSP", 0x1)
+DefinitionBlock ("acpi-dsdt-common.aml", "SSDT", 0x01, "BXPC", "BXDSDTCOMM", 0x1)
 {
 
 /****************************************************************
@@ -36,7 +36,7 @@ DefinitionBlock ("ssdt-misc.aml", "SSDT", 0x01, "BXPC", "BXSSDTSUSP", 0x1)
        Name(P1E, Buffer() { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 })
        ACPI_EXTRACT_NAME_BUFFER8 acpi_pci64_length
        Name(P1L, Buffer() { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 })
-       ACPI_EXTRACT_NAME_DWORD_CONST ssdt_mctrl_nr_slots
+       ACPI_EXTRACT_NAME_DWORD_CONST dsdt_mctrl_nr_slots
        Name(MEMORY_SLOTS_NUMBER, 0x12345678)
     }
 
@@ -81,7 +81,7 @@ DefinitionBlock ("ssdt-misc.aml", "SSDT", 0x01, "BXPC", "BXSSDTSUSP", 0x1)
         Device(PEVT) {
             Name(_HID, "QEMU0001")
             /* PEST will be patched to be Zero if no such device */
-            ACPI_EXTRACT_NAME_WORD_CONST ssdt_isa_pest
+            ACPI_EXTRACT_NAME_WORD_CONST dsdt_isa_pest
             Name(PEST, 0xFFFF)
             OperationRegion(PEOR, SystemIO, PEST, 0x01)
             Field(PEOR, ByteAcc, NoLock, Preserve) {
hw/i386/acpi-dsdt-common.hex.generated renamed from hw/i386/ssdt-misc.hex.generated +15 -15
similarity index 93%
rename from hw/i386/ssdt-misc.hex.generated
rename to hw/i386/acpi-dsdt-common.hex.generated
index cbcf61d..5127845 100644
@@ -4,8 +4,8 @@ static unsigned char acpi_pci64_length[] = {
 static unsigned char acpi_s4_pkg[] = {
 0x99
 };
-static unsigned char ssdt_mctrl_nr_slots[] = {
-0x7d
+static unsigned char acpi_s4_name[] = {
+0x92
 };
 static unsigned char acpi_s3_name[] = {
 0x86
@@ -16,7 +16,10 @@ static unsigned char acpi_pci32_start[] = {
 static unsigned char acpi_pci64_valid[] = {
 0x43
 };
-static unsigned char ssdp_misc_aml[] = {
+static unsigned char dsdt_isa_pest[] = {
+0xda
+};
+static unsigned char dsdt_common_aml[] = {
 0x53,
 0x53,
 0x44,
@@ -26,7 +29,7 @@ static unsigned char ssdp_misc_aml[] = {
 0x0,
 0x0,
 0x1,
-0x3,
+0x2f,
 0x42,
 0x58,
 0x50,
@@ -39,8 +42,8 @@ static unsigned char ssdp_misc_aml[] = {
 0x53,
 0x44,
 0x54,
-0x53,
-0x55,
+0x43,
+0x4f,
 0x1,
 0x0,
 0x0,
@@ -49,9 +52,9 @@ static unsigned char ssdp_misc_aml[] = {
 0x4e,
 0x54,
 0x4c,
-0x28,
-0x8,
-0x14,
+0x13,
+0x9,
+0x12,
 0x20,
 0x10,
 0x4c,
@@ -382,12 +385,6 @@ static unsigned char ssdp_misc_aml[] = {
 0x4d,
 0x58
 };
-static unsigned char ssdt_isa_pest[] = {
-0xda
-};
-static unsigned char acpi_s4_name[] = {
-0x92
-};
 static unsigned char acpi_pci64_start[] = {
 0x4d
 };
@@ -397,3 +394,6 @@ static unsigned char acpi_pci64_end[] = {
 static unsigned char acpi_pci32_end[] = {
 0x39
 };
+static unsigned char dsdt_mctrl_nr_slots[] = {
+0x7d
+};
hw/i386/acpi-dsdt.dsl +1 -1
index a611e07..e50efeb 100644
@@ -170,7 +170,7 @@ DefinitionBlock (
             Return (0x0)
         }
 
-        /* Hotplug notification method supplied by SSDT */
+        /* Hotplug notification method in acpi-dsdt-common.dsl */
         External(\_SB.PCI0.PCNT, MethodObj)
     }
 
Signature · 1 line
1.8.3.1
#3 lore raw

PATCH v3 3/3 pc: move common parts of the DSDT to dsdt-common

In reply to Paolo Bonzini

There is no need anymore to #include them in multiple places, and they are not too big so just place them in acpi-dsdt-common.dsl.

---
 hw/i386/acpi-build.c                   |   12 +-
 hw/i386/acpi-dsdt-common.dsl           |   14 +-
 hw/i386/acpi-dsdt-common.hex.generated | 1578 +++++++++++++++-
 hw/i386/acpi-dsdt-isa.dsl              |    6 +-
 hw/i386/acpi-dsdt.dsl                  |   10 +-
 hw/i386/acpi-dsdt.hex.generated        | 3119 +++++++++-----------------------
 hw/i386/q35-acpi-dsdt.dsl              |    9 +-
 hw/i386/q35-acpi-dsdt.hex.generated    | 2787 +++++++---------------------
 tests/acpi-test-data/pc/DSDT           |  Bin 3920 -> 3923 bytes
 tests/acpi-test-data/q35/DSDT          |  Bin 8510 -> 8513 bytes
 10 files changed, 3020 insertions(+), 4515 deletions(-)
hw/i386/acpi-build.c +4 -8
index 4ed30d8..920f597 100644
@@ -53,6 +53,7 @@
 
 #include "hw/i386/q35-acpi-dsdt.hex"
 #include "hw/i386/acpi-dsdt.hex"
+#include "hw/i386/acpi-dsdt-common.hex"
 
 #include "qapi/qmp/qint.h"
 #include "qom/qom-qobject.h"
@@ -119,7 +120,6 @@ typedef struct AcpiBuildPciBusHotplugState {
 
 static void acpi_get_dsdt(AcpiMiscInfo *info)
 {
-    uint16_t *applesmc_sta;
     Object *piix = piix4_pm_find();
     Object *lpc = ich9_lpc_find();
     assert(!!piix != !!lpc);
@@ -127,17 +127,11 @@ static void acpi_get_dsdt(AcpiMiscInfo *info)
     if (piix) {
         info->dsdt_code = AcpiDsdtAmlCode;
         info->dsdt_size = sizeof AcpiDsdtAmlCode;
-        applesmc_sta = piix_dsdt_applesmc_sta;
     }
     if (lpc) {
         info->dsdt_code = Q35AcpiDsdtAmlCode;
         info->dsdt_size = sizeof Q35AcpiDsdtAmlCode;
-        applesmc_sta = q35_dsdt_applesmc_sta;
     }
-
-    /* Patch in appropriate value for AppleSMC _STA */
-    *(uint8_t *)(info->dsdt_code + *applesmc_sta) =
-        applesmc_find() ? 0x0b : 0x00;
 }
 
 static
@@ -718,7 +712,6 @@ static inline char acpi_get_hex(uint32_t val)
 #define ACPI_SSDT_SIGNATURE 0x54445353 /* SSDT */
 #define ACPI_SSDT_HEADER_LENGTH 36
 
-#include "hw/i386/acpi-dsdt-common.hex"
 #include "hw/i386/ssdt-pcihp.hex"
 #include "hw/i386/ssdt-tpm.hex"
 
@@ -1094,6 +1087,9 @@ push_dsdt_common(GArray *table_data, AcpiPmInfo *pm, AcpiMiscInfo *misc,
     ACPI_BUILD_SET_LE(dsdt_ptr, sizeof(dsdt_common_aml),
                       dsdt_mctrl_nr_slots[0], 32, nr_mem);
 
+    /* Patch in appropriate value for AppleSMC _STA */
+    dsdt_ptr[dsdt_applesmc_sta[0]]= applesmc_find() ? 0x0b : 0x00;
+
     g_array_append_vals(table_data, dsdt_ptr + sizeof(AcpiTableHeader),
                         DSDT_COMMON_SIZE);
     g_free(dsdt_ptr);
hw/i386/acpi-dsdt-common.dsl +11 -3
index f7849c0..1929f8f 100644
@@ -19,6 +19,17 @@ ACPI_EXTRACT_ALL_CODE dsdt_common_aml
 DefinitionBlock ("acpi-dsdt-common.aml", "SSDT", 0x01, "BXPC", "BXDSDTCOMM", 0x1)
 {
 
+    External(\_SB.PCI0, DeviceObj)
+    External(\_SB.PCI0.ISA, DeviceObj)
+    External(\_SB.PCI0.PCI, DeviceObj)
+
+#include "hw/acpi/pc-hotplug.h"
+#include "acpi-dsdt-dbug.dsl"
+#include "acpi-dsdt-hpet.dsl"
+#include "acpi-dsdt-isa.dsl"
+#include "acpi-dsdt-mem-hotplug.dsl"
+
+
 /****************************************************************
  * PCI memory ranges
  ****************************************************************/
@@ -74,9 +85,6 @@ DefinitionBlock ("acpi-dsdt-common.aml", "SSDT", 0x01, "BXPC", "BXDSDTCOMM", 0x1
         })
     }
 
-    External(\_SB.PCI0, DeviceObj)
-    External(\_SB.PCI0.ISA, DeviceObj)
-
     Scope(\_SB.PCI0.ISA) {
         Device(PEVT) {
             Name(_HID, "QEMU0001")
hw/i386/acpi-dsdt-common.hex.generated +1538 -40

1,614 lines not on this page · raw message

hw/i386/acpi-dsdt-isa.dsl +5 -1
index deb37de..a8851b0 100644
@@ -19,7 +19,7 @@ Scope(\_SB.PCI0.ISA) {
     Device (SMC) {
         Name(_HID, EisaId("APP0001"))
         /* _STA will be patched to 0x0B if AppleSMC is present */
-        ACPI_EXTRACT_NAME_BYTE_CONST DSDT_APPLESMC_STA
+        ACPI_EXTRACT_NAME_BYTE_CONST dsdt_applesmc_sta
         Name(_STA, 0xF0)
         Name(_CRS, ResourceTemplate () {
             IO (Decode16, 0x0300, 0x0300, 0x01, 0x20)
@@ -58,6 +58,7 @@ Scope(\_SB.PCI0.ISA) {
         })
     }
 
+    External(FDEN)
     Device(FDC0) {
         Name(_HID, EisaId("PNP0700"))
         Method(_STA, 0, NotSerialized) {
@@ -76,6 +77,7 @@ Scope(\_SB.PCI0.ISA) {
         })
     }
 
+    External(LPEN)
     Device(LPT) {
         Name(_HID, EisaId("PNP0400"))
         Method(_STA, 0, NotSerialized) {
@@ -92,6 +94,7 @@ Scope(\_SB.PCI0.ISA) {
         })
     }
 
+    External(CAEN)
     Device(COM1) {
         Name(_HID, EisaId("PNP0501"))
         Name(_UID, 0x01)
@@ -109,6 +112,7 @@ Scope(\_SB.PCI0.ISA) {
         })
     }
 
+    External(CBEN)
     Device(COM2) {
         Name(_HID, EisaId("PNP0501"))
         Name(_UID, 0x02)
hw/i386/acpi-dsdt.dsl +2 -8
index e50efeb..71d1e3f 100644
@@ -29,9 +29,6 @@ DefinitionBlock (
     )
 {
 
-#include "acpi-dsdt-dbug.dsl"
-
-
 /****************************************************************
  * PCI Bus definition
  ****************************************************************/
@@ -86,7 +83,6 @@ DefinitionBlock (
     }
 
 #include "acpi-dsdt-pci-crs.dsl"
-#include "acpi-dsdt-hpet.dsl"
 
 
 /****************************************************************
@@ -130,9 +126,6 @@ DefinitionBlock (
         }
     }
 
-#define DSDT_APPLESMC_STA piix_dsdt_applesmc_sta
-#include "acpi-dsdt-isa.dsl"
-
 
 /****************************************************************
  * PCI hotplug
@@ -297,7 +290,6 @@ DefinitionBlock (
 #include "hw/acpi/pc-hotplug.h"
 #define CPU_STATUS_BASE PIIX4_CPU_HOTPLUG_IO_BASE
 #include "acpi-dsdt-cpu-hotplug.dsl"
-#include "acpi-dsdt-mem-hotplug.dsl"
 
 
 /****************************************************************
@@ -318,6 +310,8 @@ DefinitionBlock (
             // CPU hotplug event
             \_SB.PRSC()
         }
+        External(\_SB.PCI0.MEMORY_HOTPLUG_DEVICE, DeviceObj)
+        External(\_SB.PCI0.MEMORY_HOTPLUG_DEVICE.MEMORY_SLOT_SCAN_METHOD, MethodObj)
         Method(_E03) {
             // Memory hotplug event
             \_SB.PCI0.MEMORY_HOTPLUG_DEVICE.MEMORY_SLOT_SCAN_METHOD()
hw/i386/acpi-dsdt.hex.generated +812 -2307

1,237 lines not on this page · raw message

hw/i386/q35-acpi-dsdt.dsl +2 -7
index e1cee5d..398aec1 100644

Lines of this file are not shown. View the raw message.

hw/i386/q35-acpi-dsdt.hex.generated +646 -2141

2,787 lines not on this page · raw message

tests/acpi-test-data/pc/DSDT binary +0 -0
index 9bcc9ba9540f768afeba95231229e093b538d020..76edb15b23cf1f9a0fcdb17807492553c1115b61 100644
GIT binary patch
tests/acpi-test-data/q35/DSDT binary +0 -0
index c30ec0462acee10c55e1035ba0e6798a0739dc35..fb79eb4ed84fc0e95aa7a1eb6c64b941cec321d1 100644
GIT binary patch

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.8.3.1

Part of the diff is not shown here. View the raw message.

#4 lore raw
In reply to Paolo Bonzini
Quoted 3 lines · Paolo Bonzini

See v2 for motivation.

v2->v3: dropped pointer passing and patch 4.

Thanks!
Igor - ok with you?

Quoted 15 lines

Paolo Bonzini (3):
pc: append ssdt-misc.dsl to the DSDT
pc: rename ssdt-misc to dsdt-common
pc: move common parts of the DSDT to dsdt-common

 hw/i386/Makefile.objs                           |    2 +-
 hw/i386/acpi-build.c                            |   85 +-
 hw/i386/{ssdt-misc.dsl => acpi-dsdt-common.dsl} |   22 +-
 hw/i386/acpi-dsdt-common.hex.generated          | 1897 ++++++++++++++
 hw/i386/acpi-dsdt-isa.dsl                       |    6 +-
 hw/i386/acpi-dsdt.dsl                           |   12 +-
 hw/i386/acpi-dsdt.hex.generated                 | 3119 ++++++-----------------
 hw/i386/q35-acpi-dsdt.dsl                       |    9 +-
 hw/i386/q35-acpi-dsdt.hex.generated             | 2787 +++++---------------
 hw/i386/ssdt-misc.hex.generated                 |  399 ---
Quoted 8 lines
 tests/acpi-test-data/pc/DSDT                    |  Bin 3592 -> 3923 bytes
 tests/acpi-test-data/pc/SSDT                    |  Bin 2279 -> 1951 bytes
 tests/acpi-test-data/q35/DSDT                   |  Bin 8182 -> 8513 bytes
 tests/acpi-test-data/q35/SSDT                   |  Bin 560 -> 232 bytes
 14 files changed, 3430 insertions(+), 4908 deletions(-)
 rename hw/i386/{ssdt-misc.dsl => acpi-dsdt-common.dsl} (89%)
 create mode 100644 hw/i386/acpi-dsdt-common.hex.generated
 delete mode 100644 hw/i386/ssdt-misc.hex.generated

In future pls don't include generated files, they often conflict on rebase - just note I need to generate them in the cover letter.

Quoted 2 lines
Signature · 1 line
1.8.3.1
#5 lore raw
Quoted 6 lines · Michael S. Tsirkin
Quoted 3 lines · Paolo Bonzini
Quoted 3 lines

See v2 for motivation.

v2->v3: dropped pointer passing and patch 4.

Thanks!
Igor - ok with you?

FWIW I'm okay with moving stuff back to the SSDT as part of Igor's other ACPI series. The #included files would remain in acpi-dsdt-common.dsl.

Paolo

#6 lore raw
Quoted 4 lines · On Tue, 20 Jan 2015 08:05:04 +0100 Paolo Bonzini <[email protected]> wrote:
Quoted 1 line · Michael S. Tsirkin

On Mon, Jan 19, 2015 at 05:56:24PM +0100, Paolo Bonzini wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

See v2 for motivation.

v2->v3: dropped pointer passing and patch 4.

Thanks!
Igor - ok with you?

FWIW I'm okay with moving stuff back to the SSDT as part of Igor's other ACPI series. The #included files would remain in acpi-dsdt-common.dsl.

can we drop 1-2 patches and not move stuff uselessly back and forth? (it only complicates rebase of big series and nothing else)

I'll take care of SMC device and move it into SSDT with respin of AML API series. And taking in account that ROMs are resizable now, I can trim not present SSDT devices along with it.

Quoted 1 line

Paolo