[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 63/86] acpi: pc/35: sanitize _GPE declaration order
From: |
Michael S. Tsirkin |
Subject: |
[PULL 63/86] acpi: pc/35: sanitize _GPE declaration order |
Date: |
Mon, 31 Oct 2022 08:53:40 -0400 |
From: Igor Mammedov <imammedo@redhat.com>
Move _GPE block declaration before it gets referenced by other
hotplug handlers. While at it move PCI hotplug (_E01) handler
after PCI tree description to avoid forward reference to
to not yet declared methods/devices.
PS:
Forward 'usage' usualy is fine as long as it's hidden within
method, however 'iasl' may print warnings. So be nice
to iasl/guest OS and do things in proper order.
PS2: Also follow up patches will move some of hotplug code
from PCI tree to _E01 and that also requires PCI Device
nodes build first, before Scope can reuse that from
global context.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20221017102146.2254096-11-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/i386/acpi-build.c | 47 +++++++++++++++++++++++---------------------
1 file changed, 25 insertions(+), 22 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 916343d8d6..960305462c 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1434,6 +1434,18 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
aml_append(dsdt, sb_scope);
}
+ scope = aml_scope("_GPE");
+ {
+ aml_append(scope, aml_name_decl("_HID", aml_string("ACPI0006")));
+ if (machine->nvdimms_state->is_enabled) {
+ method = aml_method("_E04", 0, AML_NOTSERIALIZED);
+ aml_append(method, aml_notify(aml_name("\\_SB.NVDR"),
+ aml_int(0x80)));
+ aml_append(scope, method);
+ }
+ }
+ aml_append(dsdt, scope);
+
if (pcmc->legacy_cpu_hotplug) {
build_legacy_cpu_hotplug_aml(dsdt, machine, pm->cpu_hp_io_base);
} else {
@@ -1452,28 +1464,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
pcms->memhp_io_base);
}
- scope = aml_scope("_GPE");
- {
- aml_append(scope, aml_name_decl("_HID", aml_string("ACPI0006")));
-
- if (pm->pcihp_bridge_en || pm->pcihp_root_en) {
- 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);
- }
-
- if (machine->nvdimms_state->is_enabled) {
- method = aml_method("_E04", 0, AML_NOTSERIALIZED);
- aml_append(method, aml_notify(aml_name("\\_SB.NVDR"),
- aml_int(0x80)));
- aml_append(scope, method);
- }
- }
- aml_append(dsdt, scope);
-
crs_range_set_init(&crs_range_set);
bus = PC_MACHINE(machine)->bus;
if (bus) {
@@ -1752,6 +1742,19 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
}
aml_append(dsdt, sb_scope);
+ if (pm->pcihp_bridge_en || pm->pcihp_root_en) {
+ scope = aml_scope("_GPE");
+ {
+ 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);
+ }
+ 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);
acpi_table_end(linker, &table);
--
MST
- [PULL 53/86] vhost-user: Fix out of order vring host notification handling, (continued)
- [PULL 53/86] vhost-user: Fix out of order vring host notification handling, Michael S. Tsirkin, 2022/10/31
- [PULL 54/86] acpi: pc: vga: use AcpiDevAmlIf interface to build VGA device descriptors, Michael S. Tsirkin, 2022/10/31
- [PULL 55/86] tests: acpi: whitelist DSDT before generating PCI-ISA bridge AML automatically, Michael S. Tsirkin, 2022/10/31
- [PULL 56/86] acpi: pc/q35: drop ad-hoc PCI-ISA bridge AML routines and let bus ennumeration generate AML, Michael S. Tsirkin, 2022/10/31
- [PULL 57/86] tests: acpi: update expected DSDT after ISA bridge is moved directly under PCI host bridge, Michael S. Tsirkin, 2022/10/31
- [PULL 58/86] tests: acpi: whitelist DSDT before generating ICH9_SMB AML automatically, Michael S. Tsirkin, 2022/10/31
- [PULL 59/86] acpi: add get_dev_aml_func() helper, Michael S. Tsirkin, 2022/10/31
- [PULL 60/86] acpi: enumerate SMB bridge automatically along with other PCI devices, Michael S. Tsirkin, 2022/10/31
- [PULL 61/86] tests: acpi: update expected blobs, Michael S. Tsirkin, 2022/10/31
- [PULL 62/86] tests: acpi: pc/q35 whitelist DSDT before \_GPE cleanup, Michael S. Tsirkin, 2022/10/31
- [PULL 63/86] acpi: pc/35: sanitize _GPE declaration order,
Michael S. Tsirkin <=
- [PULL 65/86] hw/acpi/erst.c: Fix memory handling issues, Michael S. Tsirkin, 2022/10/31
- [PULL 64/86] tests: acpi: update expected blobs, Michael S. Tsirkin, 2022/10/31
- [PULL 66/86] MAINTAINERS: Add qapi/virtio.json to section "virtio", Michael S. Tsirkin, 2022/10/31
- [PULL 67/86] qpci_device_enable: Allow for command bits hardwired to 0, Michael S. Tsirkin, 2022/10/31
- [PULL 68/86] hw/ide/piix: Ignore writes of hardwired PCI command register bits, Michael S. Tsirkin, 2022/10/31
- [PULL 70/86] hw/i386/pc.c: CXL Fixed Memory Window should not reserve e820 in bios, Michael S. Tsirkin, 2022/10/31
- [PULL 69/86] msix: Assert that specified vector is in range, Michael S. Tsirkin, 2022/10/31
- [PULL 72/86] hw/i386/acpi-build: Resolve redundant attribute, Michael S. Tsirkin, 2022/10/31
- [PULL 71/86] hw/i386/acpi-build: Remove unused struct, Michael S. Tsirkin, 2022/10/31
- [PULL 75/86] tests: acpi: add and whitelist *.hmat-noinitiator expected blobs, Michael S. Tsirkin, 2022/10/31