[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v3 58/81] acpi: pc/35: sanitize _GPE declaration order
From: |
Michael S. Tsirkin |
Subject: |
[PULL v3 58/81] acpi: pc/35: sanitize _GPE declaration order |
Date: |
Sat, 5 Nov 2022 13:18:14 -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 v3 15/81] acpi/tests/avocado/bits/doc: add a doc file to describe the acpi bits test, (continued)
- [PULL v3 15/81] acpi/tests/avocado/bits/doc: add a doc file to describe the acpi bits test, Michael S. Tsirkin, 2022/11/05
- [PULL v3 14/81] acpi/tests/avocado/bits: add acpi and smbios avocado tests that uses biosbits, Michael S. Tsirkin, 2022/11/05
- [PULL v3 17/81] hw/smbios: add core_count2 to smbios table type 4, Michael S. Tsirkin, 2022/11/05
- [PULL v3 18/81] bios-tables-test: teach test to use smbios 3.0 tables, Michael S. Tsirkin, 2022/11/05
- [PULL v3 21/81] tests/acpi: update tables for new core count test, Michael S. Tsirkin, 2022/11/05
- [PULL v3 23/81] acpi: fadt: support revision 6.0 of the ACPI specification, Michael S. Tsirkin, 2022/11/05
- [PULL v3 29/81] hw/mem/cxl-type3: Add CXL CDAT Data Object Exchange, Michael S. Tsirkin, 2022/11/05
- [PULL v3 22/81] tests/acpi: virt: allow acpi MADT and FADT changes, Michael S. Tsirkin, 2022/11/05
- [PULL v3 38/81] vhost: expose vhost_virtqueue_start(), Michael S. Tsirkin, 2022/11/05
- [PULL v3 55/81] acpi: enumerate SMB bridge automatically along with other PCI devices, Michael S. Tsirkin, 2022/11/05
- [PULL v3 58/81] acpi: pc/35: sanitize _GPE declaration order,
Michael S. Tsirkin <=
- [PULL v3 19/81] tests/acpi: allow changes for core_count2 test, Michael S. Tsirkin, 2022/11/05
- [PULL v3 24/81] acpi: arm/virt: madt: bump to revision 4 accordingly to ACPI 6.0 Errata A, Michael S. Tsirkin, 2022/11/05
- [PULL v3 27/81] hw/mem/cxl-type3: Add MSIX support, Michael S. Tsirkin, 2022/11/05
- [PULL v3 25/81] tests/acpi: virt: update ACPI MADT and FADT binaries, Michael S. Tsirkin, 2022/11/05
- [PULL v3 31/81] hw/virtio/virtio-iommu-pci: Enforce the device is plugged on the root bus, Michael S. Tsirkin, 2022/11/05
- [PULL v3 34/81] virtio: introduce virtio_queue_enable(), Michael S. Tsirkin, 2022/11/05
- [PULL v3 33/81] virtio: introduce virtio_queue_reset(), Michael S. Tsirkin, 2022/11/05
- [PULL v3 32/81] virtio: introduce __virtio_queue_reset(), Michael S. Tsirkin, 2022/11/05
- [PULL v3 49/81] acpi: pc: vga: use AcpiDevAmlIf interface to build VGA device descriptors, Michael S. Tsirkin, 2022/11/05