Skip to contentSkip to conversation

acpi:pc/q35: minor PCI refactoring/cleanups

PATCH In review Igor Mammedov 2 participants 25 messages Jul 1, 2022 – Sep 27, 2022

lore
Share & tools
lore
#0 lore raw

cover acpi:pc/q35: minor PCI refactoring/cleanups

Flushing out ACPI PCI cleanups that preceed conversion of DSDT PCI slots ennumeration to AcpiDevAmlIf interface. It's is mostly collection of patches thraet removes code duplication, we've accumulated around PCI relaterd AML in DSDT.

git:
https://gitlab.com/imammedo/qemu.git x86_pci_cleanups

Igor Mammedov (17):
tests: acpi: whitelist pc/q35 DSDT due to HPET AML move
acpi: x86: deduplicate HPET AML building
tests: acpi: update expected blobs after HPET move
tests: acpi: whitelist pc/q35 DSDT due to HPET AML move
acpi: x86: refactor PDSM method to reduce nesting
x86: acpi: _DSM: use Package to pass parameters
tests: acpi: update expected blobs
tests: acpi: whitelist pc/q35 DSDT before switching _DSM to use ASUN
x86: acpi: cleanup PCI device _DSM duplication
tests: acpi: update expected blobs
tests: acpi: whitelist pc/q35 DSDT before moving _ADR field
x86: pci: acpi: reorder Device's _ADR and _SUN fields
tests: acpi: update expected blobs
tests: acpi: whitelist pc/q35 DSDT before moving _ADR field
x86: pci: acpi: reorder Device's _DSM method
tests: acpi: update expected blobs
x86: pci: acpi: deduplate PCI slots creation

 hw/i386/acpi-build.c                  | 302 ++++++++++++++------------
 tests/data/acpi/pc/DSDT               | Bin 5987 -> 6422 bytes
 tests/data/acpi/pc/DSDT.acpierst      | Bin 5954 -> 6382 bytes
 tests/data/acpi/pc/DSDT.acpihmat      | Bin 7312 -> 7747 bytes
 tests/data/acpi/pc/DSDT.bridge        | Bin 8653 -> 9496 bytes
 tests/data/acpi/pc/DSDT.cphp          | Bin 6451 -> 6886 bytes
 tests/data/acpi/pc/DSDT.dimmpxm       | Bin 7641 -> 8076 bytes
 tests/data/acpi/pc/DSDT.hpbridge      | Bin 5954 -> 6382 bytes
 tests/data/acpi/pc/DSDT.hpbrroot      | Bin 3069 -> 3069 bytes
 tests/data/acpi/pc/DSDT.ipmikcs       | Bin 6059 -> 6494 bytes
 tests/data/acpi/pc/DSDT.memhp         | Bin 7346 -> 7781 bytes
 tests/data/acpi/pc/DSDT.nohpet        | Bin 5845 -> 6280 bytes
 tests/data/acpi/pc/DSDT.numamem       | Bin 5993 -> 6428 bytes
 tests/data/acpi/pc/DSDT.roothp        | Bin 6195 -> 6656 bytes
 tests/data/acpi/q35/DSDT              | Bin 8274 -> 8320 bytes
 tests/data/acpi/q35/DSDT.acpierst     | Bin 8291 -> 8337 bytes
 tests/data/acpi/q35/DSDT.acpihmat     | Bin 9599 -> 9645 bytes
 tests/data/acpi/q35/DSDT.applesmc     | Bin 8320 -> 8366 bytes
 tests/data/acpi/q35/DSDT.bridge       | Bin 10988 -> 11449 bytes
 tests/data/acpi/q35/DSDT.cphp         | Bin 8738 -> 8784 bytes
 tests/data/acpi/q35/DSDT.cxl          | Bin 9600 -> 9646 bytes
 tests/data/acpi/q35/DSDT.dimmpxm      | Bin 9928 -> 9974 bytes
 tests/data/acpi/q35/DSDT.ipmibt       | Bin 8349 -> 8395 bytes
 tests/data/acpi/q35/DSDT.ipmismbus    | Bin 8363 -> 8409 bytes
 tests/data/acpi/q35/DSDT.ivrs         | Bin 8291 -> 8337 bytes
 tests/data/acpi/q35/DSDT.memhp        | Bin 9633 -> 9679 bytes
 tests/data/acpi/q35/DSDT.mmio64       | Bin 9404 -> 9450 bytes
 tests/data/acpi/q35/DSDT.multi-bridge | Bin 8568 -> 8640 bytes
 tests/data/acpi/q35/DSDT.nohpet       | Bin 8132 -> 8178 bytes
 tests/data/acpi/q35/DSDT.numamem      | Bin 8280 -> 8326 bytes
 tests/data/acpi/q35/DSDT.pvpanic-isa  | Bin 8375 -> 8421 bytes
 tests/data/acpi/q35/DSDT.tis.tpm12    | Bin 8880 -> 8926 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2     | Bin 8906 -> 8952 bytes
 tests/data/acpi/q35/DSDT.viot         | Bin 9383 -> 9429 bytes
 tests/data/acpi/q35/DSDT.xapic        | Bin 35637 -> 35683 bytes
 35 files changed, 161 insertions(+), 141 deletions(-)
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/17 tests: acpi: whitelist pc/q35 DSDT due to HPET AML move

---
 tests/qtest/bios-tables-test-allowed-diff.h | 32 +++++++++++++++++++++
 1 file changed, 32 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +32 -0
index dfb8523c8b..a7aa428fab 100644
@@ -1 +1,33 @@
 /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/pc/DSDT",
+"tests/data/acpi/pc/DSDT.acpierst",
+"tests/data/acpi/pc/DSDT.acpihmat",
+"tests/data/acpi/pc/DSDT.bridge",
+"tests/data/acpi/pc/DSDT.cphp",
+"tests/data/acpi/pc/DSDT.dimmpxm",
+"tests/data/acpi/pc/DSDT.hpbridge",
+"tests/data/acpi/pc/DSDT.hpbrroot",
+"tests/data/acpi/pc/DSDT.ipmikcs",
+"tests/data/acpi/pc/DSDT.memhp",
+"tests/data/acpi/pc/DSDT.numamem",
+"tests/data/acpi/pc/DSDT.roothp",
+"tests/data/acpi/q35/DSDT",
+"tests/data/acpi/q35/DSDT.acpierst",
+"tests/data/acpi/q35/DSDT.acpihmat",
+"tests/data/acpi/q35/DSDT.applesmc",
+"tests/data/acpi/q35/DSDT.bridge",
+"tests/data/acpi/q35/DSDT.cphp",
+"tests/data/acpi/q35/DSDT.cxl",
+"tests/data/acpi/q35/DSDT.dimmpxm",
+"tests/data/acpi/q35/DSDT.ipmibt",
+"tests/data/acpi/q35/DSDT.ipmismbus",
+"tests/data/acpi/q35/DSDT.ivrs",
+"tests/data/acpi/q35/DSDT.memhp",
+"tests/data/acpi/q35/DSDT.mmio64",
+"tests/data/acpi/q35/DSDT.multi-bridge",
+"tests/data/acpi/q35/DSDT.numamem",
+"tests/data/acpi/q35/DSDT.pvpanic-isa",
+"tests/data/acpi/q35/DSDT.tis.tpm12",
+"tests/data/acpi/q35/DSDT.tis.tpm2",
+"tests/data/acpi/q35/DSDT.viot",
+"tests/data/acpi/q35/DSDT.xapic",
Signature · 1 line
2.31.1
#2 lore raw

PATCH 2/17 acpi: x86: deduplicate HPET AML building

In reply to Igor Mammedov

HPET AML doesn't depend on piix4 nor q35, move code buiding it to common scope to avoid duplication.

---
 hw/i386/acpi-build.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
hw/i386/acpi-build.c +4 -6
index cad6f5ac41..69ead4b34a 100644
@@ -1467,9 +1467,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
         aml_append(sb_scope, dev);
         aml_append(dsdt, sb_scope);
 
-        if (misc->has_hpet) {
-            build_hpet_aml(dsdt);
-        }
         build_piix4_isa_bridge(dsdt);
         if (pm->pcihp_bridge_en || pm->pcihp_root_en) {
             build_x86_acpi_pci_hotplug(dsdt, pm->pcihp_io_base);
@@ -1515,9 +1512,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
 
         aml_append(dsdt, sb_scope);
 
-        if (misc->has_hpet) {
-            build_hpet_aml(dsdt);
-        }
         build_q35_isa_bridge(dsdt);
         if (pm->pcihp_bridge_en) {
             build_x86_acpi_pci_hotplug(dsdt, pm->pcihp_io_base);
@@ -1528,6 +1522,10 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
         }
     }
 
+    if (misc->has_hpet) {
+        build_hpet_aml(dsdt);
+    }
+
     if (vmbus_bridge) {
         sb_scope = aml_scope("_SB");
         aml_append(sb_scope, build_vmbus_device_aml(vmbus_bridge));
Signature · 1 line
2.31.1
#3 lore raw

Re: [PATCH 02/17] acpi: x86: deduplicate HPET AML building

Quoted 4 lines · Igor Mammedov

HPET AML doesn't depend on piix4 nor q35, move code buiding it to common scope to avoid duplication.

Apropos, tests/data/acpi/rebuild-expected-aml.sh ignores the fact that some tables might be identical. Also, there's no way to reuse expected files between machines. And so we have:

[qemu]$ find tests/data/acpi -type f -exec sha256sum '{}' ';'|sort

01fefc161dcd26564d86826df5c000b080a3442912165a1432dddd3fe9d1b78a  tests/data/acpi/virt/APIC
01fefc161dcd26564d86826df5c000b080a3442912165a1432dddd3fe9d1b78a  tests/data/acpi/virt/APIC.memhp
01fefc161dcd26564d86826df5c000b080a3442912165a1432dddd3fe9d1b78a  tests/data/acpi/virt/APIC.numamem
034be54fda2de6c07e7568b0c2ed6e0a0936c235f1a4ae42dbad0771b8b451db  tests/data/acpi/pc/NFIT.dimmpxm
034be54fda2de6c07e7568b0c2ed6e0a0936c235f1a4ae42dbad0771b8b451db  tests/data/acpi/q35/NFIT.dimmpxm
0ecccad48c22fc54f86756ef5e9dbf5360544bcd50970e277a13422c5831b67c  tests/data/acpi/q35/DSDT.memhp
10341f3d4e6822e578f0759e9c2cdf3ed24267e5a427cb2a31b63a028e208147  tests/data/acpi/virt/FACP
10341f3d4e6822e578f0759e9c2cdf3ed24267e5a427cb2a31b63a028e208147  tests/data/acpi/virt/FACP.memhp
10341f3d4e6822e578f0759e9c2cdf3ed24267e5a427cb2a31b63a028e208147  tests/data/acpi/virt/FACP.numamem
1a93fe13736fb8d51277ab086f7d7a3bbc6bcf946c68229c785ba8257ec8d865  tests/data/acpi/pc/SRAT.memhp
1a93fe13736fb8d51277ab086f7d7a3bbc6bcf946c68229c785ba8257ec8d865  tests/data/acpi/q35/SRAT.memhp
3f0fe229cae8032140af80d8e84105e1b3cc2307b5daa60548d0a00c3b5c0649  tests/data/acpi/pc/SLIT.cphp
3f0fe229cae8032140af80d8e84105e1b3cc2307b5daa60548d0a00c3b5c0649  tests/data/acpi/pc/SLIT.memhp
3f0fe229cae8032140af80d8e84105e1b3cc2307b5daa60548d0a00c3b5c0649  tests/data/acpi/q35/SLIT.cphp
3f0fe229cae8032140af80d8e84105e1b3cc2307b5daa60548d0a00c3b5c0649  tests/data/acpi/q35/SLIT.memhp
3f0fe229cae8032140af80d8e84105e1b3cc2307b5daa60548d0a00c3b5c0649  tests/data/acpi/virt/SLIT.memhp
3fb3115e2c3c626603dbb20ab49825295d952f171ed7901a7f464cead2f40800  tests/data/acpi/pc/FACS
3fb3115e2c3c626603dbb20ab49825295d952f171ed7901a7f464cead2f40800  tests/data/acpi/q35/FACS
43b225e2dc8f37c4a7d5af6452187097a4417b0aaa102a5a7000c4ba683946cb  tests/data/acpi/virt/SPCR
43b225e2dc8f37c4a7d5af6452187097a4417b0aaa102a5a7000c4ba683946cb  tests/data/acpi/virt/SPCR.memhp
43b225e2dc8f37c4a7d5af6452187097a4417b0aaa102a5a7000c4ba683946cb  tests/data/acpi/virt/SPCR.numamem
48831ff36e0e0c1916a0a637854a44f861aee551fff75d486da31605caebd16f  tests/data/acpi/rebuild-expected-aml.sh
498a52d92d615ba2c5c69d62296f4f21792543c8d52ccb9fade1c69cfd83fae8  tests/data/acpi/pc/APIC.cphp
498a52d92d615ba2c5c69d62296f4f21792543c8d52ccb9fade1c69cfd83fae8  tests/data/acpi/q35/APIC.cphp
49906fead65caf8e2b093dc193ec082772c7559a9a8fe2d20914bc44dc811716  tests/data/acpi/q35/DSDT.dimmpxm
5307211b50c65c8c05e4efb81b1d320e9208b5d3aac5a3d6bd37b9f47ef3bc4c  tests/data/acpi/pc/DSDT.ipmikcs
532089625245db3aeb4bf3a88c13d054be1fb21a24599b9d1bc17832a416937a  tests/data/acpi/pc/DSDT
5d3803c3e90296d0a4ea3b9501b0af926196f7288b1ff9160c5294141113e396  tests/data/acpi/q35/DSDT.numamem
5e4c0a107998d58be1ff10ffa08bff225f7f6efe3027095135d2e55bc15512fe  tests/data/acpi/pc/DSDT.cphp
61402328e4de16de4b7409564225268ae522ad913d9ef92276611ef22d9013a0  tests/data/acpi/virt/SRAT.numamem
645efebd748df15bd2cf7f0186cc7aeaaf8b40ac4adea29d871ac323360fc82c  tests/data/acpi/q35/FACP
6608617b0a5df135a12a3866e4e4239fbe77e3004ff4d6ea42f16879e69cf10f  tests/data/acpi/pc/DSDT.dimmpxm
6bc5f8fb421eff6f00de89743a56a88c951f47180b5ad83ceaad69aaf9fad984  tests/data/acpi/q35/DSDT.ipmibt
73d031ef66864988d9be337684317128c2e45c75a2af4fc35f20d216d83a2efd  tests/data/acpi/virt/DSDT
73d031ef66864988d9be337684317128c2e45c75a2af4fc35f20d216d83a2efd  tests/data/acpi/virt/DSDT.numamem
79fd95d6904b66b0a99982c64a0d54ea75bfa0568e8f02e1dcd9cdca404a758f  tests/data/acpi/pc/APIC
79fd95d6904b66b0a99982c64a0d54ea75bfa0568e8f02e1dcd9cdca404a758f  tests/data/acpi/q35/APIC
836514ed3adca20b1085838a37688dc1427811b648a7cc4e2a0a0f2d0cc6c99f  tests/data/acpi/pc/DSDT.numamem
84d4fd8e55b1785e8c22d1ea17a542266ca14af0c747115316cc7201df338e03  tests/data/acpi/q35/MCFG
879dd52ff293ddbc4d1f589482f882619b99816c4e362f19dab099d1a0e42da9  tests/data/acpi/pc/SRAT.numamem
879dd52ff293ddbc4d1f589482f882619b99816c4e362f19dab099d1a0e42da9  tests/data/acpi/q35/SRAT.numamem
87ec0a685c6bcb1e33af3e558431f038ecd33e4243dd68a4b14d4e97c3d5fb6d  tests/data/acpi/q35/SSDT.dimmpxm
8b28d0ce160bf42a812871210141f5d509932682a959b579c0d4f8f43b03fb42  tests/data/acpi/virt/SRAT.memhp
90a603d2f099cc3e3c9bd9de2f8f1cdad5307a6d2f6d2e7951f5418c7f422908  tests/data/acpi/q35/DSDT.cphp
95d9002674201957e58be516daf29729c2ac8e926bfb7256c1bc56fb8dc6eb01  tests/data/acpi/virt/MCFG
95d9002674201957e58be516daf29729c2ac8e926bfb7256c1bc56fb8dc6eb01  tests/data/acpi/virt/MCFG.memhp
95d9002674201957e58be516daf29729c2ac8e926bfb7256c1bc56fb8dc6eb01  tests/data/acpi/virt/MCFG.numamem
9aa0f3568a9f1c25d4c12257831974af88236bcc4b21b90df78ebe95bbb97475  tests/data/acpi/pc/HPET
9aa0f3568a9f1c25d4c12257831974af88236bcc4b21b90df78ebe95bbb97475  tests/data/acpi/q35/HPET
ac64d624eb666028565f4d508a80ae04ed7b48232c60c320de1beba4999ecb69  tests/data/acpi/virt/DSDT.memhp
b65c1b10bc565814f0c0950abd40712fd098b88c88f37f9bb20355356dd2b04f  tests/data/acpi/pc/DSDT.bridge
bb1c9e9e87bf9c1f8c96eb1deb201abb8a177296f1daa4dd53a9450c94307b7f  tests/data/acpi/pc/SRAT.cphp
bb1c9e9e87bf9c1f8c96eb1deb201abb8a177296f1daa4dd53a9450c94307b7f  tests/data/acpi/q35/SRAT.cphp
c9864027de5fed8169f5a283f64f15b799f34d26f66e3f4131da5c5ce1ec6d5d  tests/data/acpi/q35/DSDT
ca48a8cf471fcdde73f0997700cb99a39e738257eb26b5509dfb81005a694b83  tests/data/acpi/pc/SSDT.dimmpxm
ddfb6d6b50dd4645efac8358d86c7d2f310cbf0300823b68ef0d996e31f01c44  tests/data/acpi/virt/GTDT
ddfb6d6b50dd4645efac8358d86c7d2f310cbf0300823b68ef0d996e31f01c44  tests/data/acpi/virt/GTDT.memhp
ddfb6d6b50dd4645efac8358d86c7d2f310cbf0300823b68ef0d996e31f01c44  tests/data/acpi/virt/GTDT.numamem
e641d8505ab15bfd7ec399431eb3cb709cf0e06e15c528cc7d5da389392c89da  tests/data/acpi/q35/SRAT.mmio64
e7274a622cf4be3d991a8cedf4437c1976334a1332fac78aaeaa47a94d6e2697  tests/data/acpi/pc/DSDT.memhp
e93a393836970c4f32fff86a1931b8e45ee4634e5c99168491f2c55823647fda  tests/data/acpi/pc/APIC.dimmpxm
e93a393836970c4f32fff86a1931b8e45ee4634e5c99168491f2c55823647fda  tests/data/acpi/q35/APIC.dimmpxm
ee7b4e121c41519501119b4b7bd52edcf1124fcf271b7dd3086f0038b182b947  tests/data/acpi/q35/DSDT.bridge
f089eb8441987367f223fa5e5e9fec8c12d9557cf0c6d68d0e8372be4c39fa7c  tests/data/acpi/pc/FACP
fabfa7d0ed2367bf1499b1a1d0b7253cd08a298e2aa0be3ca8f0dae5150e71a9  tests/data/acpi/q35/DSDT.mmio64
fb7675409f2264b14e5859e9187e7d05811bcc0570444b18cded8ff49a3514c5  tests/data/acpi/pc/SRAT.dimmpxm
fb7675409f2264b14e5859e9187e7d05811bcc0570444b18cded8ff49a3514c5  tests/data/acpi/q35/SRAT.dimmpxm

It's easy to fix up duplications within virt. But I am not 100% sure how fix up duplication between q35 and pc. I think we should really fix qemu to allow pc-i440fx and pc-q35 as machine types. Right now:

microvm              microvm (i386)
xenfv-4.2            Xen Fully-virtualized PC
xenfv                Xen Fully-virtualized PC (alias of xenfv-3.1)
xenfv-3.1            Xen Fully-virtualized PC
pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-7.1)
pc-i440fx-7.1        Standard PC (i440FX + PIIX, 1996) (default)
pc-i440fx-7.0        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-6.2        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-6.1        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-6.0        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-5.2        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-5.1        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-5.0        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-4.2        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-4.1        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-4.0        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-3.1        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-3.0        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.9        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.8        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.7        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.6        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.5        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.4        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.12       Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.11       Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.10       Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.1        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.0        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-1.7        Standard PC (i440FX + PIIX, 1996) (deprecated)
pc-i440fx-1.6        Standard PC (i440FX + PIIX, 1996) (deprecated)
pc-i440fx-1.5        Standard PC (i440FX + PIIX, 1996) (deprecated)
pc-i440fx-1.4        Standard PC (i440FX + PIIX, 1996) (deprecated)
q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-7.1)
pc-q35-7.1           Standard PC (Q35 + ICH9, 2009)
pc-q35-7.0           Standard PC (Q35 + ICH9, 2009)
pc-q35-6.2           Standard PC (Q35 + ICH9, 2009)
pc-q35-6.1           Standard PC (Q35 + ICH9, 2009)
pc-q35-6.0           Standard PC (Q35 + ICH9, 2009)
pc-q35-5.2           Standard PC (Q35 + ICH9, 2009)
pc-q35-5.1           Standard PC (Q35 + ICH9, 2009)
pc-q35-5.0           Standard PC (Q35 + ICH9, 2009)
pc-q35-4.2           Standard PC (Q35 + ICH9, 2009)
pc-q35-4.1           Standard PC (Q35 + ICH9, 2009)
pc-q35-4.0.1         Standard PC (Q35 + ICH9, 2009)
pc-q35-4.0           Standard PC (Q35 + ICH9, 2009)
pc-q35-3.1           Standard PC (Q35 + ICH9, 2009)
pc-q35-3.0           Standard PC (Q35 + ICH9, 2009)
pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)
pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)
pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)
pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)
pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)
pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)
pc-q35-2.12          Standard PC (Q35 + ICH9, 2009)
pc-q35-2.11          Standard PC (Q35 + ICH9, 2009)
pc-q35-2.10          Standard PC (Q35 + ICH9, 2009)
isapc                ISA-only PC
none                 empty machine
x-remote             Experimental remote machine
xenpv                Xen Para-virtualized PC

which IMHO is a bit of a mess.

Then we could maybe use the directory "pc" for files common to i440fx and q35. Maybe just teach the test to look under tests/data/acpi/x86 too? And I think we should teach tests/data/acpi/rebuild-expected-aml.sh to check for duplicates and at least warn the user.

Signature · 1 line
MST
#4 lore raw

Re: [PATCH 02/17] acpi: x86: deduplicate HPET AML building

Quoted 12 lines · On Fri, 1 Jul 2022 12:26:16 -0400 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 4 lines · Igor Mammedov

HPET AML doesn't depend on piix4 nor q35, move code buiding it to common scope to avoid duplication.

Apropos, tests/data/acpi/rebuild-expected-aml.sh ignores the fact that some tables might be identical. Also, there's no way to reuse expected files between machines. And so we have:

[qemu]$ find tests/data/acpi -type f -exec sha256sum '{}' ';'|sort

[...]

Quoted 4 lines

It's easy to fix up duplications within virt. But I am not 100% sure how fix up duplication between q35 and pc.

[...]

Quoted 4 lines

Then we could maybe use the directory "pc" for files common to i440fx and q35. Maybe just teach the test to look under tests/data/acpi/x86 too? And I think we should teach tests/data/acpi/rebuild-expected-aml.sh to check for duplicates and at least warn the user.

Probably duplicates in 'virt' mostly due to combination of not knowing that there is a fallback lookup (which is hidden in the code) and simplistic way tests/data/acpi/rebuild-expected-aml.sh rebuilds tables.

As you suggest, rebuild-expected-aml.sh can be improved to warn or even better drop duplicates if found.

As for reusing tables between different machine types, alternatively we can add explicit remapping rules (possibly auto-generated) versus currently used implicit fallback approach.

#5 lore raw

Re: [PATCH 02/17] acpi: x86: deduplicate HPET AML building

Quoted 28 lines · Igor Mammedov
Quoted 12 lines · On Fri, 1 Jul 2022 12:26:16 -0400 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 4 lines · Igor Mammedov

HPET AML doesn't depend on piix4 nor q35, move code buiding it to common scope to avoid duplication.

Apropos, tests/data/acpi/rebuild-expected-aml.sh ignores the fact that some tables might be identical. Also, there's no way to reuse expected files between machines. And so we have:

[qemu]$ find tests/data/acpi -type f -exec sha256sum '{}' ';'|sort

[...]

Quoted 4 lines

It's easy to fix up duplications within virt. But I am not 100% sure how fix up duplication between q35 and pc.

[...]

Quoted 4 lines

Then we could maybe use the directory "pc" for files common to i440fx and q35. Maybe just teach the test to look under tests/data/acpi/x86 too? And I think we should teach tests/data/acpi/rebuild-expected-aml.sh to check for duplicates and at least warn the user.

Quoted 6 lines

Probably duplicates in 'virt' mostly due to combination of not knowing that there is a fallback lookup (which is hidden in the code) and simplistic way tests/data/acpi/rebuild-expected-aml.sh rebuilds tables.

As you suggest, rebuild-expected-aml.sh can be improved to warn or even better drop duplicates if found.

Want to try?

Quoted 3 lines

As for reusing tables between different machine types, alternatively we can add explicit remapping rules (possibly auto-generated) versus currently used implicit fallback approach.

My worry with this is that if a specific table needs to be split from the generic variant then user would have to hack the test code as opposed to just updating the tables, so the update can not be done automatically. Thoughts?

Signature · 1 line
MST
#6 lore raw

Re: [PATCH 02/17] acpi: x86: deduplicate HPET AML building

Quoted 29 lines · On Thu, 7 Jul 2022 06:08:35 -0400 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 28 lines · Igor Mammedov
Quoted 12 lines · On Fri, 1 Jul 2022 12:26:16 -0400 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 4 lines · Igor Mammedov

HPET AML doesn't depend on piix4 nor q35, move code buiding it to common scope to avoid duplication.

Apropos, tests/data/acpi/rebuild-expected-aml.sh ignores the fact that some tables might be identical. Also, there's no way to reuse expected files between machines. And so we have:

[qemu]$ find tests/data/acpi -type f -exec sha256sum '{}' ';'|sort

[...]

Quoted 4 lines

It's easy to fix up duplications within virt. But I am not 100% sure how fix up duplication between q35 and pc.

[...]

Quoted 4 lines

Then we could maybe use the directory "pc" for files common to i440fx and q35. Maybe just teach the test to look under tests/data/acpi/x86 too? And I think we should teach tests/data/acpi/rebuild-expected-aml.sh to check for duplicates and at least warn the user.

Quoted 8 lines
Quoted 6 lines

Probably duplicates in 'virt' mostly due to combination of not knowing that there is a fallback lookup (which is hidden in the code) and simplistic way tests/data/acpi/rebuild-expected-aml.sh rebuilds tables.

As you suggest, rebuild-expected-aml.sh can be improved to warn or even better drop duplicates if found.

Want to try?

I'll put it on my queue, after PCI refactorings

Quoted 9 lines
Quoted 4 lines

As for reusing tables between different machine types, alternatively we can add explicit remapping rules (possibly auto-generated) versus currently used implicit fallback approach.

My worry with this is that if a specific table needs to be split from the generic variant then user would have to hack the test code as opposed to just updating the tables, so the update can not be done automatically. Thoughts?

I'll try to implement it and see if it's possible.

#7 lore raw

PATCH 3/17 tests: acpi: update expected blobs after HPET move

In reply to Igor Mammedov

HPET AML moved after PCI host bridge description (no functional change)

diff example for PC machine:

@@ -54,47 +54,6 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001)

         }
     }

- Scope (_SB)
- {
- Device (HPET)
- {

-            Name (_HID, EisaId ("PNP0103") /* HPET System Timer */)  // _HID: Hardware ID
-            Name (_UID, Zero)  // _UID: Unique ID
-            OperationRegion (HPTM, SystemMemory, 0xFED00000, 0x0400)
-            Field (HPTM, DWordAcc, Lock, Preserve)
-            {
-                VEND,   32,
-                PRD,    32

- }
-
- Method (_STA, 0, NotSerialized) // _STA: Status
- {

-                Local0 = VEND /* \_SB_.HPET.VEND */
-                Local1 = PRD /* \_SB_.HPET.PRD_ */
-                Local0 >>= 0x10
-                If (((Local0 == Zero) || (Local0 == 0xFFFF)))
-                {

- Return (Zero)
- }
-
- If (((Local1 == Zero) || (Local1 > 0x05F5E100)))
- {
- Return (Zero)
- }
-
- Return (0x0F)
- }
-
- Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
- {
- Memory32Fixed (ReadOnly,

-                    0xFED00000,         // Address Base
-                    0x00000400,         // Address Length
-                    )

- })
- }
- }
-

     Scope (_SB.PCI0)
     {
         Device (ISA)
@@ -529,6 +488,47 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC    ", 0x00000001)
         }
     }

+ Scope (_SB)
+ {
+ Device (HPET)
+ {

+            Name (_HID, EisaId ("PNP0103") /* HPET System Timer */)  // _HID: Hardware ID
+            Name (_UID, Zero)  // _UID: Unique ID
+            OperationRegion (HPTM, SystemMemory, 0xFED00000, 0x0400)
+            Field (HPTM, DWordAcc, Lock, Preserve)
+            {
+                VEND,   32,
+                PRD,    32

+ }
+
+ Method (_STA, 0, NotSerialized) // _STA: Status
+ {

+                Local0 = VEND /* \_SB_.HPET.VEND */
+                Local1 = PRD /* \_SB_.HPET.PRD_ */
+                Local0 >>= 0x10
+                If (((Local0 == Zero) || (Local0 == 0xFFFF)))
+                {

+ Return (Zero)
+ }
+
+ If (((Local1 == Zero) || (Local1 > 0x05F5E100)))
+ {
+ Return (Zero)
+ }
+
+ Return (0x0F)
+ }
+
+ Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
+ {
+ Memory32Fixed (ReadOnly,

+                    0xFED00000,         // Address Base
+                    0x00000400,         // Address Length
+                    )

+ })
+ }
+ }
+

     Scope (_SB)
     {
         Device (\_SB.PCI0.PRES)
---
 tests/qtest/bios-tables-test-allowed-diff.h |  32 --------------------
 tests/data/acpi/pc/DSDT                     | Bin 5987 -> 5987 bytes
 tests/data/acpi/pc/DSDT.acpierst            | Bin 5954 -> 5954 bytes
 tests/data/acpi/pc/DSDT.acpihmat            | Bin 7312 -> 7312 bytes
 tests/data/acpi/pc/DSDT.bridge              | Bin 8653 -> 8653 bytes
 tests/data/acpi/pc/DSDT.cphp                | Bin 6451 -> 6451 bytes
 tests/data/acpi/pc/DSDT.dimmpxm             | Bin 7641 -> 7641 bytes
 tests/data/acpi/pc/DSDT.hpbridge            | Bin 5954 -> 5954 bytes
 tests/data/acpi/pc/DSDT.hpbrroot            | Bin 3069 -> 3069 bytes
 tests/data/acpi/pc/DSDT.ipmikcs             | Bin 6059 -> 6059 bytes
 tests/data/acpi/pc/DSDT.memhp               | Bin 7346 -> 7346 bytes
 tests/data/acpi/pc/DSDT.numamem             | Bin 5993 -> 5993 bytes
 tests/data/acpi/pc/DSDT.roothp              | Bin 6195 -> 6195 bytes
 tests/data/acpi/q35/DSDT                    | Bin 8274 -> 8274 bytes
 tests/data/acpi/q35/DSDT.acpierst           | Bin 8291 -> 8291 bytes
 tests/data/acpi/q35/DSDT.acpihmat           | Bin 9599 -> 9599 bytes
 tests/data/acpi/q35/DSDT.applesmc           | Bin 8320 -> 8320 bytes
 tests/data/acpi/q35/DSDT.bridge             | Bin 10988 -> 10988 bytes
 tests/data/acpi/q35/DSDT.cphp               | Bin 8738 -> 8738 bytes
 tests/data/acpi/q35/DSDT.cxl                | Bin 9600 -> 9600 bytes
 tests/data/acpi/q35/DSDT.dimmpxm            | Bin 9928 -> 9928 bytes
 tests/data/acpi/q35/DSDT.ipmibt             | Bin 8349 -> 8349 bytes
 tests/data/acpi/q35/DSDT.ipmismbus          | Bin 8363 -> 8363 bytes
 tests/data/acpi/q35/DSDT.ivrs               | Bin 8291 -> 8291 bytes
 tests/data/acpi/q35/DSDT.memhp              | Bin 9633 -> 9633 bytes
 tests/data/acpi/q35/DSDT.mmio64             | Bin 9404 -> 9404 bytes
 tests/data/acpi/q35/DSDT.multi-bridge       | Bin 8568 -> 8568 bytes
 tests/data/acpi/q35/DSDT.numamem            | Bin 8280 -> 8280 bytes
 tests/data/acpi/q35/DSDT.pvpanic-isa        | Bin 8375 -> 8375 bytes
 tests/data/acpi/q35/DSDT.tis.tpm12          | Bin 8880 -> 8880 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2           | Bin 8906 -> 8906 bytes
 tests/data/acpi/q35/DSDT.viot               | Bin 9383 -> 9383 bytes
 tests/data/acpi/q35/DSDT.xapic              | Bin 35637 -> 35637 bytes
 33 files changed, 32 deletions(-)
tests/qtest/bios-tables-test-allowed-diff.h +0 -32
index a7aa428fab..dfb8523c8b 100644
@@ -1,33 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/pc/DSDT",
-"tests/data/acpi/pc/DSDT.acpierst",
-"tests/data/acpi/pc/DSDT.acpihmat",
-"tests/data/acpi/pc/DSDT.bridge",
-"tests/data/acpi/pc/DSDT.cphp",
-"tests/data/acpi/pc/DSDT.dimmpxm",
-"tests/data/acpi/pc/DSDT.hpbridge",
-"tests/data/acpi/pc/DSDT.hpbrroot",
-"tests/data/acpi/pc/DSDT.ipmikcs",
-"tests/data/acpi/pc/DSDT.memhp",
-"tests/data/acpi/pc/DSDT.numamem",
-"tests/data/acpi/pc/DSDT.roothp",
-"tests/data/acpi/q35/DSDT",
-"tests/data/acpi/q35/DSDT.acpierst",
-"tests/data/acpi/q35/DSDT.acpihmat",
-"tests/data/acpi/q35/DSDT.applesmc",
-"tests/data/acpi/q35/DSDT.bridge",
-"tests/data/acpi/q35/DSDT.cphp",
-"tests/data/acpi/q35/DSDT.cxl",
-"tests/data/acpi/q35/DSDT.dimmpxm",
-"tests/data/acpi/q35/DSDT.ipmibt",
-"tests/data/acpi/q35/DSDT.ipmismbus",
-"tests/data/acpi/q35/DSDT.ivrs",
-"tests/data/acpi/q35/DSDT.memhp",
-"tests/data/acpi/q35/DSDT.mmio64",
-"tests/data/acpi/q35/DSDT.multi-bridge",
-"tests/data/acpi/q35/DSDT.numamem",
-"tests/data/acpi/q35/DSDT.pvpanic-isa",
-"tests/data/acpi/q35/DSDT.tis.tpm12",
-"tests/data/acpi/q35/DSDT.tis.tpm2",
-"tests/data/acpi/q35/DSDT.viot",
-"tests/data/acpi/q35/DSDT.xapic",
tests/data/acpi/pc/DSDT binary +0 -0
index e80bef30317b5ef3bf0d2fb7aaabd6def109adb6..2d543fbf94e42f03814019c146b49f94e76bf15d 100644
GIT binary patch
tests/data/acpi/pc/DSDT.acpierst binary +0 -0
index d5a2ca51652dfc3637a817bac4a02d6ff6dc8ac2..798349aa3f85e0803396471237e94604d00a1f90 100644
GIT binary patch
tests/data/acpi/pc/DSDT.acpihmat binary +0 -0
index f86c743c4d64041c7fbd9999cc700e88416770b7..2b0fd3433b586fd7665b9a0b5b2f8bb3fcc09b44 100644
GIT binary patch
tests/data/acpi/pc/DSDT.bridge binary +0 -0
index 14ed0d995a9f6540deae5a25a7853ed4493a6e06..56398fc0147c9ab9d59947e24cddb08380b6a13e 100644
GIT binary patch
tests/data/acpi/pc/DSDT.cphp binary +0 -0
index c653302a84a42d063a74a22c6adf910beeba7c60..38cb47c675edb6d4797b008d2deae656739230ef 100644
GIT binary patch
tests/data/acpi/pc/DSDT.dimmpxm binary +0 -0
index 247a1796b1cf31c24b1a981e48937609f84fe2cb..06a7aa59465238bfbf715ae83540f68b1f2f3ea5 100644
GIT binary patch
tests/data/acpi/pc/DSDT.hpbridge binary +0 -0
index d5a2ca51652dfc3637a817bac4a02d6ff6dc8ac2..798349aa3f85e0803396471237e94604d00a1f90 100644
GIT binary patch
tests/data/acpi/pc/DSDT.hpbrroot binary +0 -0
index ec99b1622934a0fd8bc316291c33231e4c57dce0..dd2c8c0c8c5bf9895eb524e094d5597515b4803e 100644
GIT binary patch
tests/data/acpi/pc/DSDT.ipmikcs binary +0 -0
index f0d9e75841ea3d69fed9384e439bc4e94c7a4c4e..be7f22f1c29f25351bcb5620dcfe8f955bd083d7 100644
GIT binary patch
tests/data/acpi/pc/DSDT.memhp binary +0 -0
index d0a7c462094fea9a457cbf537784735e74f7d7d5..b81e3dd8ecd89f4690d69a90096df095fe218425 100644
GIT binary patch
tests/data/acpi/pc/DSDT.numamem binary +0 -0
index 2f512cfbe158f1739803c0c7009fe5e907bdec54..230aaae37169ec2f78ebeae735ccc905a112d284 100644
GIT binary patch
tests/data/acpi/pc/DSDT.roothp binary +0 -0
index 46e03d39e00ea70e55d6a12333ca2b98c5e5bb53..7091ee019191d822869f9a9f35ebd635eea4a9eb 100644
GIT binary patch
tests/data/acpi/q35/DSDT binary +0 -0
index 2cd8d5fc470fc3159fbc464af97e76c8de2136e3..a85c608022b9e0878bcedc785b9bdf27e50a760b 100644
GIT binary patch
tests/data/acpi/q35/DSDT.acpierst binary +0 -0
index 0bc5de80652ae7328fdc07ccda34afff39ade56f..f768380c1c2aa8fcd6ff6bc1048e0ccd2037eb2c 100644
GIT binary patch
tests/data/acpi/q35/DSDT.acpihmat binary +0 -0
index af10345e8806c78a0074b3a8819b5cfca4d70c01..51e79b3b0754224aa6cd1e1257b404182506f1d1 100644
GIT binary patch
tests/data/acpi/q35/DSDT.applesmc binary +0 -0
index 00092aacc6ce44dd8792b00a0fa183e5b06d33c6..33ca7ee26fee6718c72dd63374bea98e858066c2 100644
GIT binary patch
tests/data/acpi/q35/DSDT.bridge binary +0 -0
index d820098355e0b79dc69d714817fe906064852f4d..40457ec74d272f4ce971b66a1b19a397ed9af770 100644
GIT binary patch
tests/data/acpi/q35/DSDT.cphp binary +0 -0
index ac8456a43d54209d77917163b282954d7429b331..fe87e060d5cf41b20cf1a37928ed31ca9b15ed66 100644
GIT binary patch
tests/data/acpi/q35/DSDT.cxl binary +0 -0
index 369ae90196113ec666a4acec7bb7a93be5b60e75..82d7563a73f6b7a4ead15ca0933d0e57ae8be48e 100644
GIT binary patch
tests/data/acpi/q35/DSDT.dimmpxm binary +0 -0
index bb0eadf869fe366fc139f8b0fd2ed811d3b16814..304c8229d81e333ed7564423cf50ad2b963b0a2e 100644
GIT binary patch
tests/data/acpi/q35/DSDT.ipmibt binary +0 -0
index bb258279506e78b50545f6f9030bd25afe433c29..b9a5ae240c62f29d952d94a280bc97d608b3c2e5 100644
GIT binary patch
tests/data/acpi/q35/DSDT.ipmismbus binary +0 -0
index 15000c357fdabf1bceef6f860bd35e9a33024927..a0eeae95c07fe3708509c3e652c3aeff9c21ac82 100644
GIT binary patch
tests/data/acpi/q35/DSDT.ivrs binary +0 -0
index 0bc5de80652ae7328fdc07ccda34afff39ade56f..f768380c1c2aa8fcd6ff6bc1048e0ccd2037eb2c 100644
GIT binary patch
tests/data/acpi/q35/DSDT.memhp binary +0 -0
index 663456fc0d3c71a51b541f5ab952e05c9dac01e6..b4a9f5a0fe5cf3b44ebe7659a2bf3687e1073482 100644
GIT binary patch
tests/data/acpi/q35/DSDT.mmio64 binary +0 -0
index 91afd01d598c7c2c733387dfb5140d0fcad54adb..3af5ef2ea473322d8697281d3a20f7282f3238ac 100644
GIT binary patch
tests/data/acpi/q35/DSDT.multi-bridge binary +0 -0
index afde339a181628ae9153251eee026b437ab685bc..238668b95f33e831d66e2e2fa5e952f00ea7260b 100644
GIT binary patch
tests/data/acpi/q35/DSDT.numamem binary +0 -0
index e537669949a07adbaa4255021ea14bb4a9dc672f..37fa4c3a45b0d7db0d3d368df5e027e7e1acf9d2 100644
GIT binary patch
tests/data/acpi/q35/DSDT.pvpanic-isa binary +0 -0
index cc545b5d2505246d33f83d2482273968aa1be032..8705309748d1d7352c6623b32c28eab7fbbce2a4 100644
GIT binary patch
tests/data/acpi/q35/DSDT.tis.tpm12 binary +0 -0
index a97d884c50485f848054c6ac95ecfa055ff59e5b..7408f03e4b571c352f9fdf2afc8718aa7b37da06 100644
GIT binary patch
tests/data/acpi/q35/DSDT.tis.tpm2 binary +0 -0
index 1f5392919b5ea69696b49ff13aab5c37d0615919..134c2fbccacd0e9383df094f9b4deb03b4e46abb 100644
GIT binary patch
tests/data/acpi/q35/DSDT.viot binary +0 -0
index e20e4ee5e92e11ccf890a18fbdd78181c43f3b5c..be4a254e93a9cb360f42a25121c5fcefbd47480f 100644
GIT binary patch
tests/data/acpi/q35/DSDT.xapic binary +0 -0
index 3cab5956eee60363251a6fab0cc981bbbda64443..2327152da1b7d777c1f3da358ae5ae1406384d11 100644
GIT binary patch
Signature · 1 line
2.31.1
#8 lore raw

PATCH 4/17 tests: acpi: whitelist pc/q35 DSDT due to HPET AML move

In reply to Igor Mammedov
---
 tests/qtest/bios-tables-test-allowed-diff.h | 34 +++++++++++++++++++++
 1 file changed, 34 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +34 -0
index dfb8523c8b..452145badd 100644
@@ -1 +1,35 @@
 /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/pc/DSDT",
+"tests/data/acpi/pc/DSDT.acpierst",
+"tests/data/acpi/pc/DSDT.acpihmat",
+"tests/data/acpi/pc/DSDT.bridge",
+"tests/data/acpi/pc/DSDT.cphp",
+"tests/data/acpi/pc/DSDT.dimmpxm",
+"tests/data/acpi/pc/DSDT.hpbridge",
+"tests/data/acpi/pc/DSDT.hpbrroot",
+"tests/data/acpi/pc/DSDT.ipmikcs",
+"tests/data/acpi/pc/DSDT.memhp",
+"tests/data/acpi/pc/DSDT.numamem",
+"tests/data/acpi/pc/DSDT.roothp",
+"tests/data/acpi/q35/DSDT",
+"tests/data/acpi/q35/DSDT.acpierst",
+"tests/data/acpi/q35/DSDT.acpihmat",
+"tests/data/acpi/q35/DSDT.applesmc",
+"tests/data/acpi/q35/DSDT.bridge",
+"tests/data/acpi/q35/DSDT.cphp",
+"tests/data/acpi/q35/DSDT.cxl",
+"tests/data/acpi/q35/DSDT.dimmpxm",
+"tests/data/acpi/q35/DSDT.ipmibt",
+"tests/data/acpi/q35/DSDT.ipmismbus",
+"tests/data/acpi/q35/DSDT.ivrs",
+"tests/data/acpi/q35/DSDT.memhp",
+"tests/data/acpi/q35/DSDT.mmio64",
+"tests/data/acpi/q35/DSDT.multi-bridge",
+"tests/data/acpi/q35/DSDT.numamem",
+"tests/data/acpi/q35/DSDT.pvpanic-isa",
+"tests/data/acpi/q35/DSDT.tis.tpm12",
+"tests/data/acpi/q35/DSDT.tis.tpm2",
+"tests/data/acpi/q35/DSDT.viot",
+"tests/data/acpi/q35/DSDT.xapic",
+"tests/data/acpi/q35/DSDT.nohpet",
+"tests/data/acpi/pc/DSDT.nohpet",
Signature · 1 line
2.31.1
#9 lore raw

PATCH 5/17 acpi: x86: refactor PDSM method to reduce nesting

In reply to Igor Mammedov

.., it will help with code readability and make easier to extend method in followup patches

---
 hw/i386/acpi-build.c | 139 ++++++++++++++++++++++++-------------------
 1 file changed, 77 insertions(+), 62 deletions(-)
hw/i386/acpi-build.c +77 -62
index 69ead4b34a..fe676b4831 100644
@@ -574,9 +574,12 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
 
 Aml *aml_pci_device_dsm(void)
 {
-    Aml *method, *UUID, *ifctx, *ifctx1, *ifctx2, *ifctx3, *elsectx;
-    Aml *acpi_index = aml_local(0);
+    Aml *method, *UUID, *ifctx, *ifctx1;
+    Aml *ret = aml_local(0);
+    Aml *caps = aml_local(1);
+    Aml *acpi_index = aml_local(2);
     Aml *zero = aml_int(0);
+    Aml *one = aml_int(1);
     Aml *bnum = aml_arg(4);
     Aml *func = aml_arg(2);
     Aml *rev = aml_arg(1);
@@ -584,73 +587,85 @@ Aml *aml_pci_device_dsm(void)
 
     method = aml_method("PDSM", 6, AML_SERIALIZED);
 
+    /* get supported functions */
+    ifctx = aml_if(aml_equal(func, zero));
+    {
+        uint8_t byte_list[1] = { 0 }; /* nothing supported yet */
+        aml_append(ifctx, aml_store(aml_buffer(1, byte_list), ret));
+        aml_append(ifctx, aml_store(zero, caps));
+
+       /*
+        * PCI Firmware Specification 3.1
+        * 4.6.  _DSM Definitions for PCI
+        */
+        UUID = aml_touuid("E5C937D0-3553-4D7A-9117-EA4D19C3434D");
+        ifctx1 = aml_if(aml_lnot(aml_equal(aml_arg(0), UUID)));
+        {
+            /* call is for unsupported UUID, bail out */
+            aml_append(ifctx1, aml_return(ret));
+        }
+        aml_append(ifctx, ifctx1);
+
+        ifctx1 = aml_if(aml_lless(rev, aml_int(2)));
+        {
+            /* call is for unsupported REV, bail out */
+            aml_append(ifctx1, aml_return(ret));
+        }
+        aml_append(ifctx, ifctx1);
+
+        aml_append(ifctx,
+            aml_store(aml_call2("AIDX", bnum, sunum), acpi_index));
+        /*
+         * advertise function 7 if device has acpi-index
+         * acpi_index values:
+         *            0: not present (default value)
+         *     FFFFFFFF: not supported (old QEMU without PIDX reg)
+         *        other: device's acpi-index
+         */
+        ifctx1 = aml_if(aml_lnot(
+                     aml_or(aml_equal(acpi_index, zero),
+                            aml_equal(acpi_index, aml_int(0xFFFFFFFF)), NULL)
+                 ));
+        {
+            /* have supported functions */
+            aml_append(ifctx1, aml_or(caps, one, caps));
+            /* support for function 7 */
+            aml_append(ifctx1,
+                aml_or(caps, aml_shiftleft(one, aml_int(7)), caps));
+        }
+        aml_append(ifctx, ifctx1);
+
+        aml_append(ifctx, aml_store(caps, aml_index(ret, zero)));
+        aml_append(ifctx, aml_return(ret));
+    }
+    aml_append(method, ifctx);
+
+    /* handle specific functions requests */
     /*
      * PCI Firmware Specification 3.1
-     * 4.6.  _DSM Definitions for PCI
+     * 4.6.7. _DSM for Naming a PCI or PCI Express Device Under
+     *        Operating Systems
      */
-    UUID = aml_touuid("E5C937D0-3553-4D7A-9117-EA4D19C3434D");
-    ifctx = aml_if(aml_equal(aml_arg(0), UUID));
+    ifctx = aml_if(aml_equal(func, aml_int(7)));
     {
-        aml_append(ifctx, aml_store(aml_call2("AIDX", bnum, sunum), acpi_index));
-        ifctx1 = aml_if(aml_equal(func, zero));
-        {
-            uint8_t byte_list[1];
+       Aml *pkg = aml_package(2);
 
-            ifctx2 = aml_if(aml_equal(rev, aml_int(2)));
-            {
-                /*
-                 * advertise function 7 if device has acpi-index
-                 * acpi_index values:
-                 *            0: not present (default value)
-                 *     FFFFFFFF: not supported (old QEMU without PIDX reg)
-                 *        other: device's acpi-index
-                 */
-                ifctx3 = aml_if(aml_lnot(
-                    aml_or(aml_equal(acpi_index, zero),
-                           aml_equal(acpi_index, aml_int(0xFFFFFFFF)), NULL)
-                ));
-                {
-                    byte_list[0] =
-                        1 /* have supported functions */ |
-                        1 << 7 /* support for function 7 */
-                    ;
-                    aml_append(ifctx3, aml_return(aml_buffer(1, byte_list)));
-                }
-                aml_append(ifctx2, ifctx3);
-             }
-             aml_append(ifctx1, ifctx2);
-
-             byte_list[0] = 0; /* nothing supported */
-             aml_append(ifctx1, aml_return(aml_buffer(1, byte_list)));
-         }
-         aml_append(ifctx, ifctx1);
-         elsectx = aml_else();
-         /*
-          * PCI Firmware Specification 3.1
-          * 4.6.7. _DSM for Naming a PCI or PCI Express Device Under
-          *        Operating Systems
-          */
-         ifctx1 = aml_if(aml_equal(func, aml_int(7)));
-         {
-             Aml *pkg = aml_package(2);
-             Aml *ret = aml_local(1);
-
-             aml_append(pkg, zero);
-             /*
-              * optional, if not impl. should return null string
-              */
-             aml_append(pkg, aml_string("%s", ""));
-             aml_append(ifctx1, aml_store(pkg, ret));
-             /*
-              * update acpi-index to actual value
-              */
-             aml_append(ifctx1, aml_store(acpi_index, aml_index(ret, zero)));
-             aml_append(ifctx1, aml_return(ret));
-         }
-         aml_append(elsectx, ifctx1);
-         aml_append(ifctx, elsectx);
+       aml_append(pkg, zero);
+       /*
+        * optional, if not impl. should return null string
+        */
+       aml_append(pkg, aml_string("%s", ""));
+       aml_append(ifctx, aml_store(pkg, ret));
+
+       aml_append(ifctx, aml_store(aml_call2("AIDX", bnum, sunum), acpi_index));
+       /*
+        * update acpi-index to actual value
+        */
+       aml_append(ifctx, aml_store(acpi_index, aml_index(ret, zero)));
     }
+
     aml_append(method, ifctx);
+    aml_append(method, aml_return(ret));
     return method;
 }
 
Signature · 1 line
2.31.1
#10 lore raw

PATCH 6/17 x86: acpi: _DSM: use Package to pass parameters

In reply to Igor Mammedov

Numer of possible arguments to pass to a method is limited in ACPI. The following patches will need to pass over more parameters to PDSM method, will hit that limit.

Prepare for this by passing structure (Package) to method, which let us workaround arguments limitation. Pass to PDSM all standard arguments of _DSM as is, and pack custom parameters into Package that is passed as the last argument to PDSM.

---
 hw/i386/acpi-build.c | 40 +++++++++++++++++++++++++++-------------
 1 file changed, 27 insertions(+), 13 deletions(-)
hw/i386/acpi-build.c +27 -13
index fe676b4831..8700446f50 100644
@@ -431,11 +431,17 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
                 );
                 aml_append(dev, method);
                 method = aml_method("_DSM", 4, AML_SERIALIZED);
-                aml_append(method,
-                    aml_return(aml_call6("PDSM", aml_arg(0), aml_arg(1),
-                                         aml_arg(2), aml_arg(3),
-                                         aml_name("BSEL"), aml_name("_SUN")))
-                );
+                {
+                    Aml *params = aml_local(0);
+                    Aml *pkg = aml_package(2);
+                    aml_append(pkg, aml_name("BSEL"));
+                    aml_append(pkg, aml_name("_SUN"));
+                    aml_append(method, aml_store(pkg, params));
+                    aml_append(method,
+                        aml_return(aml_call5("PDSM", aml_arg(0), aml_arg(1),
+                                             aml_arg(2), aml_arg(3), params))
+                    );
+                }
                 aml_append(dev, method);
                 aml_append(parent_scope, dev);
 
@@ -480,10 +486,17 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
              */
             aml_append(dev, aml_name_decl("ASUN", aml_int(slot)));
             method = aml_method("_DSM", 4, AML_SERIALIZED);
-            aml_append(method, aml_return(
-                aml_call6("PDSM", aml_arg(0), aml_arg(1), aml_arg(2),
-                          aml_arg(3), aml_name("BSEL"), aml_name("ASUN"))
-            ));
+            {
+                Aml *params = aml_local(0);
+                Aml *pkg = aml_package(2);
+                aml_append(pkg, aml_name("BSEL"));
+                aml_append(pkg, aml_name("ASUN"));
+                aml_append(method, aml_store(pkg, params));
+                aml_append(method, aml_return(
+                    aml_call5("PDSM", aml_arg(0), aml_arg(1), aml_arg(2),
+                              aml_arg(3), params)
+                ));
+            }
             aml_append(dev, method);
         }
 
@@ -580,12 +593,13 @@ Aml *aml_pci_device_dsm(void)
     Aml *acpi_index = aml_local(2);
     Aml *zero = aml_int(0);
     Aml *one = aml_int(1);
-    Aml *bnum = aml_arg(4);
     Aml *func = aml_arg(2);
     Aml *rev = aml_arg(1);
-    Aml *sunum = aml_arg(5);
+    Aml *params = aml_arg(4);
+    Aml *bnum = aml_derefof(aml_index(params, aml_int(0)));
+    Aml *sunum = aml_derefof(aml_index(params, aml_int(1)));
 
-    method = aml_method("PDSM", 6, AML_SERIALIZED);
+    method = aml_method("PDSM", 5, AML_SERIALIZED);
 
     /* get supported functions */
     ifctx = aml_if(aml_equal(func, zero));
@@ -662,10 +676,10 @@ Aml *aml_pci_device_dsm(void)
         * update acpi-index to actual value
         */
        aml_append(ifctx, aml_store(acpi_index, aml_index(ret, zero)));
+       aml_append(ifctx, aml_return(ret));
     }
 
     aml_append(method, ifctx);
-    aml_append(method, aml_return(ret));
     return method;
 }
 
Signature · 1 line
2.31.1
#11 lore raw

PATCH 7/17 tests: acpi: update expected blobs

In reply to Igor Mammedov

An intermediate blobs update to keep changes (last 2 patches) reviewable.

Includes refactored PDSM that uses Package argument for custom parameters.

===== PDSM taking package as arguments

             Return (Local0)
         }

- Method (PDSM, 6, Serialized)
+ Method (PDSM, 5, Serialized)

         {
-            If ((Arg0 == ToUUID ("e5c937d0-3553-4d7a-9117-ea4d19c3434d") /* Device Labeling Interface */))
+            If ((Arg2 == Zero))
             {
-                Local0 = AIDX (Arg4, Arg5)
-                If ((Arg2 == Zero))
-                {
-                    If ((Arg1 == 0x02))
+                Local0 = Buffer (One)
                     {

- If (!((Local0 == Zero) | (Local0 == 0xFFFFFFFF)))
- {
- Return (Buffer (One)
- {
- 0x81 // .
- })
- }
+ 0x00 // .

                     }
+                Local1 = Zero
+                If ((Arg0 != ToUUID ("e5c937d0-3553-4d7a-9117-ea4d19c3434d") /* Device Labeling Interface */))
+                {

+ Return (Local0)
+ }

- Return (Buffer (One)
- {
- 0x00 // .
- })
+ If ((Arg1 < 0x02))
+ {
+ Return (Local0)

                 }

- ElseIf ((Arg2 == 0x07))
+
+ Local2 = AIDX (DerefOf (Arg4 [Zero]), DerefOf (Arg4 [One]
+ ))
+ If (!((Local2 == Zero) | (Local2 == 0xFFFFFFFF)))

                 {

- Local1 = Package (0x02)
- {
- Zero,
- ""
- }

-                    Local1 [Zero] = Local0
-                    Return (Local1)
+                    Local1 |= One
+                    Local1 |= (One << 0x07)
                 }

+
+ Local0 [Zero] = Local1
+ Return (Local0)
+ }
+
+ If ((Arg2 == 0x07))
+ {
+ Local0 = Package (0x02)
+ {
+ Zero,
+ ""
+ }
+ Local2 = AIDX (DerefOf (Arg4 [Zero]), DerefOf (Arg4 [One]
+ ))
+ Local0 [Zero] = Local2
+ Return (Local0)

             }
         }
     }

===== PCI slot using Package to pass arguments to _DSM

Name (ASUN, Zero)
Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method {
- Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, ASUN))
+ Local0 = Package (0x02)
+ {
+ BSEL,
+ ASUN
+ }
+ Return (PDSM (Arg0, Arg1, Arg2, Arg3, Local0))

                 }
             }

===== hotpluggable PCI slot using Package to pass arguments to _DSM

Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method {
- Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, _SUN))
+ Local0 = Package (0x02)
+ {
+ BSEL,
+ _SUN
+ }
+ Return (PDSM (Arg0, Arg1, Arg2, Arg3, Local0))

                 }
             }
---
 tests/qtest/bios-tables-test-allowed-diff.h |  34 --------------------
 tests/data/acpi/pc/DSDT                     | Bin 5987 -> 6219 bytes
 tests/data/acpi/pc/DSDT.acpierst            | Bin 5954 -> 6186 bytes
 tests/data/acpi/pc/DSDT.acpihmat            | Bin 7312 -> 7544 bytes
 tests/data/acpi/pc/DSDT.bridge              | Bin 8653 -> 9078 bytes
 tests/data/acpi/pc/DSDT.cphp                | Bin 6451 -> 6683 bytes
 tests/data/acpi/pc/DSDT.dimmpxm             | Bin 7641 -> 7873 bytes
 tests/data/acpi/pc/DSDT.hpbridge            | Bin 5954 -> 6186 bytes
 tests/data/acpi/pc/DSDT.ipmikcs             | Bin 6059 -> 6291 bytes
 tests/data/acpi/pc/DSDT.memhp               | Bin 7346 -> 7578 bytes
 tests/data/acpi/pc/DSDT.nohpet              | Bin 5845 -> 6077 bytes
 tests/data/acpi/pc/DSDT.numamem             | Bin 5993 -> 6225 bytes
 tests/data/acpi/pc/DSDT.roothp              | Bin 6195 -> 6434 bytes
 tests/data/acpi/q35/DSDT                    | Bin 8274 -> 8320 bytes
 tests/data/acpi/q35/DSDT.acpierst           | Bin 8291 -> 8337 bytes
 tests/data/acpi/q35/DSDT.acpihmat           | Bin 9599 -> 9645 bytes
 tests/data/acpi/q35/DSDT.applesmc           | Bin 8320 -> 8366 bytes
 tests/data/acpi/q35/DSDT.bridge             | Bin 10988 -> 11227 bytes
 tests/data/acpi/q35/DSDT.cphp               | Bin 8738 -> 8784 bytes
 tests/data/acpi/q35/DSDT.cxl                | Bin 9600 -> 9646 bytes
 tests/data/acpi/q35/DSDT.dimmpxm            | Bin 9928 -> 9974 bytes
 tests/data/acpi/q35/DSDT.ipmibt             | Bin 8349 -> 8395 bytes
 tests/data/acpi/q35/DSDT.ipmismbus          | Bin 8363 -> 8409 bytes
 tests/data/acpi/q35/DSDT.ivrs               | Bin 8291 -> 8337 bytes
 tests/data/acpi/q35/DSDT.memhp              | Bin 9633 -> 9679 bytes
 tests/data/acpi/q35/DSDT.mmio64             | Bin 9404 -> 9450 bytes
 tests/data/acpi/q35/DSDT.multi-bridge       | Bin 8568 -> 8628 bytes
 tests/data/acpi/q35/DSDT.nohpet             | Bin 8132 -> 8178 bytes
 tests/data/acpi/q35/DSDT.numamem            | Bin 8280 -> 8326 bytes
 tests/data/acpi/q35/DSDT.pvpanic-isa        | Bin 8375 -> 8421 bytes
 tests/data/acpi/q35/DSDT.tis.tpm12          | Bin 8880 -> 8926 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2           | Bin 8906 -> 8952 bytes
 tests/data/acpi/q35/DSDT.viot               | Bin 9383 -> 9429 bytes
 tests/data/acpi/q35/DSDT.xapic              | Bin 35637 -> 35683 bytes
 34 files changed, 34 deletions(-)
tests/qtest/bios-tables-test-allowed-diff.h +0 -34
index 452145badd..dfb8523c8b 100644
@@ -1,35 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/pc/DSDT",
-"tests/data/acpi/pc/DSDT.acpierst",
-"tests/data/acpi/pc/DSDT.acpihmat",
-"tests/data/acpi/pc/DSDT.bridge",
-"tests/data/acpi/pc/DSDT.cphp",
-"tests/data/acpi/pc/DSDT.dimmpxm",
-"tests/data/acpi/pc/DSDT.hpbridge",
-"tests/data/acpi/pc/DSDT.hpbrroot",
-"tests/data/acpi/pc/DSDT.ipmikcs",
-"tests/data/acpi/pc/DSDT.memhp",
-"tests/data/acpi/pc/DSDT.numamem",
-"tests/data/acpi/pc/DSDT.roothp",
-"tests/data/acpi/q35/DSDT",
-"tests/data/acpi/q35/DSDT.acpierst",
-"tests/data/acpi/q35/DSDT.acpihmat",
-"tests/data/acpi/q35/DSDT.applesmc",
-"tests/data/acpi/q35/DSDT.bridge",
-"tests/data/acpi/q35/DSDT.cphp",
-"tests/data/acpi/q35/DSDT.cxl",
-"tests/data/acpi/q35/DSDT.dimmpxm",
-"tests/data/acpi/q35/DSDT.ipmibt",
-"tests/data/acpi/q35/DSDT.ipmismbus",
-"tests/data/acpi/q35/DSDT.ivrs",
-"tests/data/acpi/q35/DSDT.memhp",
-"tests/data/acpi/q35/DSDT.mmio64",
-"tests/data/acpi/q35/DSDT.multi-bridge",
-"tests/data/acpi/q35/DSDT.numamem",
-"tests/data/acpi/q35/DSDT.pvpanic-isa",
-"tests/data/acpi/q35/DSDT.tis.tpm12",
-"tests/data/acpi/q35/DSDT.tis.tpm2",
-"tests/data/acpi/q35/DSDT.viot",
-"tests/data/acpi/q35/DSDT.xapic",
-"tests/data/acpi/q35/DSDT.nohpet",
-"tests/data/acpi/pc/DSDT.nohpet",
tests/data/acpi/pc/DSDT binary +0 -0
index 2d543fbf94e42f03814019c146b49f94e76bf15d..cb718f1a8a591b27ca841f70f40762562c15c837 100644
GIT binary patch
tests/data/acpi/pc/DSDT.acpierst binary +0 -0
index 798349aa3f85e0803396471237e94604d00a1f90..aebb29c2a4ae67b732bef3eb8e72c5665bb3a7b3 100644
GIT binary patch
tests/data/acpi/pc/DSDT.acpihmat binary +0 -0
index 2b0fd3433b586fd7665b9a0b5b2f8bb3fcc09b44..b7c5de46346d2777b33f7fc464d319bd762fda8d 100644
GIT binary patch
tests/data/acpi/pc/DSDT.bridge binary +0 -0
index 56398fc0147c9ab9d59947e24cddb08380b6a13e..e04b5b2035fb665b1e75075d4c47776a51fa77e2 100644
GIT binary patch
tests/data/acpi/pc/DSDT.cphp binary +0 -0
index 38cb47c675edb6d4797b008d2deae656739230ef..3e8a202b0f32d585b38d4f8c85247124de5ec73d 100644
GIT binary patch
tests/data/acpi/pc/DSDT.dimmpxm binary +0 -0
index 06a7aa59465238bfbf715ae83540f68b1f2f3ea5..f7d6ca1448cf0ae3c609fc1e1391cccc2d7221fc 100644
GIT binary patch
tests/data/acpi/pc/DSDT.hpbridge binary +0 -0
index 798349aa3f85e0803396471237e94604d00a1f90..aebb29c2a4ae67b732bef3eb8e72c5665bb3a7b3 100644
GIT binary patch
tests/data/acpi/pc/DSDT.ipmikcs binary +0 -0
index be7f22f1c29f25351bcb5620dcfe8f955bd083d7..a7b4760817e07cb36e13c835d04abd7bedcabe7a 100644
GIT binary patch
tests/data/acpi/pc/DSDT.memhp binary +0 -0
index b81e3dd8ecd89f4690d69a90096df095fe218425..63fdfe8c025f8b2f19411792817cd21b506fa984 100644
GIT binary patch
tests/data/acpi/pc/DSDT.nohpet binary +0 -0
index cb7bf7d850f340e12a7237c987f570300fd9c92b..281b0955ca223a1bd2c24f5e58fb8b73ae37a957 100644
GIT binary patch
tests/data/acpi/pc/DSDT.numamem binary +0 -0
index 230aaae37169ec2f78ebeae735ccc905a112d284..34914bf1ed362ebd07f0dbc22434dfddd26d9a82 100644
GIT binary patch
tests/data/acpi/pc/DSDT.roothp binary +0 -0
index 7091ee019191d822869f9a9f35ebd635eea4a9eb..bba1612c972948911ca5f5b301b10a380b8d83b7 100644
GIT binary patch
tests/data/acpi/q35/DSDT binary +0 -0
index a85c608022b9e0878bcedc785b9bdf27e50a760b..3870958969b1c0e29f9dd26a1256359e90897d3e 100644
GIT binary patch
tests/data/acpi/q35/DSDT.acpierst binary +0 -0
index f768380c1c2aa8fcd6ff6bc1048e0ccd2037eb2c..c9c18fa4e45288fb6c2182a793a8e6aff72b33d9 100644
GIT binary patch
tests/data/acpi/q35/DSDT.acpihmat binary +0 -0
index 51e79b3b0754224aa6cd1e1257b404182506f1d1..a32e90b5d913d07bc9ed9aca521420305559f357 100644
GIT binary patch
tests/data/acpi/q35/DSDT.applesmc binary +0 -0
index 33ca7ee26fee6718c72dd63374bea98e858066c2..5507b6b8f5e6ae4fd4275601eb85caf29bddc352 100644
GIT binary patch
tests/data/acpi/q35/DSDT.bridge binary +0 -0
index 40457ec74d272f4ce971b66a1b19a397ed9af770..d03e14b24d0841b4003e7954b70cd7601e571902 100644
GIT binary patch
tests/data/acpi/q35/DSDT.cphp binary +0 -0
index fe87e060d5cf41b20cf1a37928ed31ca9b15ed66..2d8cb603c9c937501247d32e6a5b2e79bb01eea3 100644
GIT binary patch
tests/data/acpi/q35/DSDT.cxl binary +0 -0
index 82d7563a73f6b7a4ead15ca0933d0e57ae8be48e..20d0fb64ea52b2f4979105c934aadb6f416e2b71 100644
GIT binary patch
tests/data/acpi/q35/DSDT.dimmpxm binary +0 -0
index 304c8229d81e333ed7564423cf50ad2b963b0a2e..b23339513af3be457c1974e0288fc4c6720690d8 100644
GIT binary patch
tests/data/acpi/q35/DSDT.ipmibt binary +0 -0
index b9a5ae240c62f29d952d94a280bc97d608b3c2e5..8af2695edeeadbde2a1e8f04ab567f5c00b76945 100644
GIT binary patch
tests/data/acpi/q35/DSDT.ipmismbus binary +0 -0
index a0eeae95c07fe3708509c3e652c3aeff9c21ac82..479df48cd37af888317d63eac8f565f370201490 100644
GIT binary patch
tests/data/acpi/q35/DSDT.ivrs binary +0 -0
index f768380c1c2aa8fcd6ff6bc1048e0ccd2037eb2c..c9c18fa4e45288fb6c2182a793a8e6aff72b33d9 100644
GIT binary patch
tests/data/acpi/q35/DSDT.memhp binary +0 -0
index b4a9f5a0fe5cf3b44ebe7659a2bf3687e1073482..a5730b8ab8abb2602334633cd6c760f79915e564 100644
GIT binary patch
tests/data/acpi/q35/DSDT.mmio64 binary +0 -0
index 3af5ef2ea473322d8697281d3a20f7282f3238ac..a4293c20fed04d1ccfc4f4fc1ccf46ca81453854 100644
GIT binary patch
tests/data/acpi/q35/DSDT.multi-bridge binary +0 -0
index 238668b95f33e831d66e2e2fa5e952f00ea7260b..ae47b004e39f9f78f3c98093727fb92a0c6c74cb 100644
GIT binary patch
tests/data/acpi/q35/DSDT.nohpet binary +0 -0
index 0fb09121cf8f6ad8810587c8b77df9552dd31f42..6feed2ee106087d24d51f468df1b4d44e65143f0 100644
GIT binary patch
tests/data/acpi/q35/DSDT.numamem binary +0 -0
index 37fa4c3a45b0d7db0d3d368df5e027e7e1acf9d2..414b8af67bdf79238915de0d609ce45e150eb958 100644
GIT binary patch
tests/data/acpi/q35/DSDT.pvpanic-isa binary +0 -0
index 8705309748d1d7352c6623b32c28eab7fbbce2a4..7277a0105035f984dc0a0f09747d441c21e62d1c 100644
GIT binary patch
tests/data/acpi/q35/DSDT.tis.tpm12 binary +0 -0
index 7408f03e4b571c352f9fdf2afc8718aa7b37da06..253a66e65818d1df67b13d4b70f68add78adff98 100644
GIT binary patch
tests/data/acpi/q35/DSDT.tis.tpm2 binary +0 -0
index 134c2fbccacd0e9383df094f9b4deb03b4e46abb..76bd4661e6655d2a8f246f4bf38490df14da82ad 100644
GIT binary patch
tests/data/acpi/q35/DSDT.viot binary +0 -0
index be4a254e93a9cb360f42a25121c5fcefbd47480f..3f14b57f0797ab13fc4c90dd2949cf4bd6c30896 100644
GIT binary patch
tests/data/acpi/q35/DSDT.xapic binary +0 -0
index 2327152da1b7d777c1f3da358ae5ae1406384d11..baa88f6f219a2a47fe20ee0c08b92371cc7e2aa7 100644
GIT binary patch
Signature · 1 line
2.31.1
#12 lore raw

PATCH 8/17 tests: acpi: whitelist pc/q35 DSDT before switching _DSM to use ASUN

In reply to Igor Mammedov
---
 tests/qtest/bios-tables-test-allowed-diff.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +14 -0
index dfb8523c8b..1983fa596b 100644
@@ -1 +1,15 @@
 /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/pc/DSDT",
+"tests/data/acpi/pc/DSDT.acpierst",
+"tests/data/acpi/pc/DSDT.acpihmat",
+"tests/data/acpi/pc/DSDT.bridge",
+"tests/data/acpi/pc/DSDT.cphp",
+"tests/data/acpi/pc/DSDT.dimmpxm",
+"tests/data/acpi/pc/DSDT.hpbridge",
+"tests/data/acpi/pc/DSDT.ipmikcs",
+"tests/data/acpi/pc/DSDT.memhp",
+"tests/data/acpi/pc/DSDT.nohpet",
+"tests/data/acpi/pc/DSDT.numamem",
+"tests/data/acpi/pc/DSDT.roothp",
+"tests/data/acpi/q35/DSDT.bridge",
+"tests/data/acpi/q35/DSDT.multi-bridge",
Signature · 1 line
2.31.1
#13 lore raw

PATCH 9/17 x86: acpi: cleanup PCI device _DSM duplication

In reply to Igor Mammedov

add ASUN variable to hotpluggable slots and use it instead of _SUN which has the same value to reuse _DMS code on both branches (hot- and non-hotpluggable). No functional change.

---
 hw/i386/acpi-build.c | 56 +++++++++++++++++++++-----------------------
 1 file changed, 27 insertions(+), 29 deletions(-)
hw/i386/acpi-build.c +27 -29
index 8700446f50..36fe43c52f 100644
@@ -374,6 +374,25 @@ build_facs(GArray *table_data)
     g_array_append_vals(table_data, reserved, 40); /* Reserved */
 }
 
+Aml *aml_pci_device_dsm(void)
+{
+    Aml *method;
+
+    method = aml_method("_DSM", 4, AML_SERIALIZED);
+    {
+        Aml *params = aml_local(0);
+        Aml *pkg = aml_package(2);
+        aml_append(pkg, aml_name("BSEL"));
+        aml_append(pkg, aml_name("ASUN"));
+        aml_append(method, aml_store(pkg, params));
+        aml_append(method,
+            aml_return(aml_call5("PDSM", aml_arg(0), aml_arg(1),
+                                 aml_arg(2), aml_arg(3), params))
+        );
+    }
+    return method;
+}
+
 static void build_append_pcihp_notify_entry(Aml *method, int slot)
 {
     Aml *if_ctx;
@@ -423,26 +442,17 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
                     break;
                 }
                 dev = aml_device("S%.02X", devfn);
-                aml_append(dev, aml_name_decl("_SUN", aml_int(slot)));
+                aml_append(dev, aml_name_decl("ASUN", aml_int(slot)));
                 aml_append(dev, aml_name_decl("_ADR", aml_int(adr)));
+                aml_append(dev, aml_name_decl("_SUN", aml_int(slot)));
                 method = aml_method("_EJ0", 1, AML_NOTSERIALIZED);
                 aml_append(method,
                     aml_call2("PCEJ", aml_name("BSEL"), aml_name("_SUN"))
                 );
                 aml_append(dev, method);
-                method = aml_method("_DSM", 4, AML_SERIALIZED);
-                {
-                    Aml *params = aml_local(0);
-                    Aml *pkg = aml_package(2);
-                    aml_append(pkg, aml_name("BSEL"));
-                    aml_append(pkg, aml_name("_SUN"));
-                    aml_append(method, aml_store(pkg, params));
-                    aml_append(method,
-                        aml_return(aml_call5("PDSM", aml_arg(0), aml_arg(1),
-                                             aml_arg(2), aml_arg(3), params))
-                    );
-                }
-                aml_append(dev, method);
+
+                aml_append(dev, aml_pci_device_dsm());
+
                 aml_append(parent_scope, dev);
 
                 build_append_pcihp_notify_entry(notify_method, slot);
@@ -485,19 +495,7 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
              * enumeration order in linux kernel, so use another variable for it
              */
             aml_append(dev, aml_name_decl("ASUN", aml_int(slot)));
-            method = aml_method("_DSM", 4, AML_SERIALIZED);
-            {
-                Aml *params = aml_local(0);
-                Aml *pkg = aml_package(2);
-                aml_append(pkg, aml_name("BSEL"));
-                aml_append(pkg, aml_name("ASUN"));
-                aml_append(method, aml_store(pkg, params));
-                aml_append(method, aml_return(
-                    aml_call5("PDSM", aml_arg(0), aml_arg(1), aml_arg(2),
-                              aml_arg(3), params)
-                ));
-            }
-            aml_append(dev, method);
+            aml_append(dev, aml_pci_device_dsm());
         }
 
         if (pc->class_id == PCI_CLASS_DISPLAY_VGA) {
@@ -585,7 +583,7 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
     qobject_unref(bsel);
 }
 
-Aml *aml_pci_device_dsm(void)
+static Aml *aml_pci_pdsm(void)
 {
     Aml *method, *UUID, *ifctx, *ifctx1;
     Aml *ret = aml_local(0);
@@ -1368,7 +1366,7 @@ static void build_x86_acpi_pci_hotplug(Aml *table, uint64_t pcihp_addr)
     aml_append(method, aml_return(aml_local(0)));
     aml_append(scope, method);
 
-    aml_append(scope, aml_pci_device_dsm());
+    aml_append(scope, aml_pci_pdsm());
 
     aml_append(table, scope);
 }
Signature · 1 line
2.31.1
#14 lore raw

PATCH 10/17 tests: acpi: update expected blobs

In reply to Igor Mammedov

It's expected that hotpluggable slots will, get ASUN variable and use that instead of _SUN with its _DSM method.

For example:

@@ -979,8 +979,9 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001)

               Device (S18)
               {
  -                Name (_SUN, 0x03)  // _SUN: Slot User Number
  +                Name (ASUN, 0x03)
                   Name (_ADR, 0x00030000)  // _ADR: Address
  +                Name (_SUN, 0x03)  // _SUN: Slot User Number
                   Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
                   {
                       PCEJ (BSEL, _SUN)
  @@ -991,7 +992,7 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC    ", 0x00000001)
                       Local0 = Package (0x02)
                           {
                               BSEL,
  -                            _SUN
  +                            ASUN
                           }
                       Return (PDSM (Arg0, Arg1, Arg2, Arg3, Local0))
                   }
---
 tests/qtest/bios-tables-test-allowed-diff.h |  14 --------------
 tests/data/acpi/pc/DSDT                     | Bin 6219 -> 6422 bytes
 tests/data/acpi/pc/DSDT.acpierst            | Bin 6186 -> 6382 bytes
 tests/data/acpi/pc/DSDT.acpihmat            | Bin 7544 -> 7747 bytes
 tests/data/acpi/pc/DSDT.bridge              | Bin 9078 -> 9496 bytes
 tests/data/acpi/pc/DSDT.cphp                | Bin 6683 -> 6886 bytes
 tests/data/acpi/pc/DSDT.dimmpxm             | Bin 7873 -> 8076 bytes
 tests/data/acpi/pc/DSDT.hpbridge            | Bin 6186 -> 6382 bytes
 tests/data/acpi/pc/DSDT.ipmikcs             | Bin 6291 -> 6494 bytes
 tests/data/acpi/pc/DSDT.memhp               | Bin 7578 -> 7781 bytes
 tests/data/acpi/pc/DSDT.nohpet              | Bin 6077 -> 6280 bytes
 tests/data/acpi/pc/DSDT.numamem             | Bin 6225 -> 6428 bytes
 tests/data/acpi/pc/DSDT.roothp              | Bin 6434 -> 6656 bytes
 tests/data/acpi/q35/DSDT.bridge             | Bin 11227 -> 11449 bytes
 tests/data/acpi/q35/DSDT.multi-bridge       | Bin 8628 -> 8640 bytes
 15 files changed, 14 deletions(-)
tests/qtest/bios-tables-test-allowed-diff.h +0 -14
index 1983fa596b..dfb8523c8b 100644
@@ -1,15 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/pc/DSDT",
-"tests/data/acpi/pc/DSDT.acpierst",
-"tests/data/acpi/pc/DSDT.acpihmat",
-"tests/data/acpi/pc/DSDT.bridge",
-"tests/data/acpi/pc/DSDT.cphp",
-"tests/data/acpi/pc/DSDT.dimmpxm",
-"tests/data/acpi/pc/DSDT.hpbridge",
-"tests/data/acpi/pc/DSDT.ipmikcs",
-"tests/data/acpi/pc/DSDT.memhp",
-"tests/data/acpi/pc/DSDT.nohpet",
-"tests/data/acpi/pc/DSDT.numamem",
-"tests/data/acpi/pc/DSDT.roothp",
-"tests/data/acpi/q35/DSDT.bridge",
-"tests/data/acpi/q35/DSDT.multi-bridge",
tests/data/acpi/pc/DSDT binary +0 -0
index cb718f1a8a591b27ca841f70f40762562c15c837..8282d449ceaefd914b419f507a13f3fb7b318aaf 100644
GIT binary patch
tests/data/acpi/pc/DSDT.acpierst binary +0 -0
index aebb29c2a4ae67b732bef3eb8e72c5665bb3a7b3..9520f3b7303a43091e8c77b64d1f76407e85f1f4 100644
GIT binary patch
tests/data/acpi/pc/DSDT.acpihmat binary +0 -0
index b7c5de46346d2777b33f7fc464d319bd762fda8d..33169838bed50710495d45e0d9486ac59b4e504c 100644
GIT binary patch
tests/data/acpi/pc/DSDT.bridge binary +0 -0
index e04b5b2035fb665b1e75075d4c47776a51fa77e2..407066e1ac46922751969b823000e4fdfa542662 100644
GIT binary patch
tests/data/acpi/pc/DSDT.cphp binary +0 -0
index 3e8a202b0f32d585b38d4f8c85247124de5ec73d..013de154913063ed1ce3f154444b9e11f4608eac 100644
GIT binary patch
tests/data/acpi/pc/DSDT.dimmpxm binary +0 -0
index f7d6ca1448cf0ae3c609fc1e1391cccc2d7221fc..289ec07c07734f6fb10e1f1f3de7b3de2a4642fd 100644
GIT binary patch
tests/data/acpi/pc/DSDT.hpbridge binary +0 -0
index aebb29c2a4ae67b732bef3eb8e72c5665bb3a7b3..9520f3b7303a43091e8c77b64d1f76407e85f1f4 100644
GIT binary patch
tests/data/acpi/pc/DSDT.ipmikcs binary +0 -0
index a7b4760817e07cb36e13c835d04abd7bedcabe7a..59a6d5860887b511b7ce5f17d7044a08c14f0f60 100644
GIT binary patch
tests/data/acpi/pc/DSDT.memhp binary +0 -0
index 63fdfe8c025f8b2f19411792817cd21b506fa984..47d63dec8f997417d7512a694a4825fee874d995 100644
GIT binary patch
tests/data/acpi/pc/DSDT.nohpet binary +0 -0
index 281b0955ca223a1bd2c24f5e58fb8b73ae37a957..47e4bf62ebe742304783e76984045d7322c3a421 100644
GIT binary patch
tests/data/acpi/pc/DSDT.numamem binary +0 -0
index 34914bf1ed362ebd07f0dbc22434dfddd26d9a82..1c4e0c80216b53463fbec8fc548007f0326c1829 100644
GIT binary patch
tests/data/acpi/pc/DSDT.roothp binary +0 -0
index bba1612c972948911ca5f5b301b10a380b8d83b7..f9a5164e0cba7c209bd3e52020cb855e8688f682 100644
GIT binary patch
tests/data/acpi/q35/DSDT.bridge binary +0 -0
index d03e14b24d0841b4003e7954b70cd7601e571902..f8a0bc150f5a249bd5d09be6949c97160de1ef82 100644
GIT binary patch
tests/data/acpi/q35/DSDT.multi-bridge binary +0 -0
index ae47b004e39f9f78f3c98093727fb92a0c6c74cb..df91b798f79d4564b049e8a7dbeaa5bb99abe635 100644
GIT binary patch
Signature · 1 line
2.31.1
#15 lore raw

PATCH 11/17 tests: acpi: whitelist pc/q35 DSDT before moving _ADR field

In reply to Igor Mammedov
---
 tests/qtest/bios-tables-test-allowed-diff.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +14 -0
index dfb8523c8b..1983fa596b 100644
@@ -1 +1,15 @@
 /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/pc/DSDT",
+"tests/data/acpi/pc/DSDT.acpierst",
+"tests/data/acpi/pc/DSDT.acpihmat",
+"tests/data/acpi/pc/DSDT.bridge",
+"tests/data/acpi/pc/DSDT.cphp",
+"tests/data/acpi/pc/DSDT.dimmpxm",
+"tests/data/acpi/pc/DSDT.hpbridge",
+"tests/data/acpi/pc/DSDT.ipmikcs",
+"tests/data/acpi/pc/DSDT.memhp",
+"tests/data/acpi/pc/DSDT.nohpet",
+"tests/data/acpi/pc/DSDT.numamem",
+"tests/data/acpi/pc/DSDT.roothp",
+"tests/data/acpi/q35/DSDT.bridge",
+"tests/data/acpi/q35/DSDT.multi-bridge",
Signature · 1 line
2.31.1
#16 lore raw

PATCH 12/17 x86: pci: acpi: reorder Device's _ADR and _SUN fields

In reply to Igor Mammedov

no functional change, align order of fields in empty slot descriptor with a populated slot ordering. Expected diff:
- Name (_SUN, 0x0X) // _SUN: Slot User Number

                   Name (_ADR, 0xY)  // _ADR: Address

...
+ Name (_SUN, 0xX) // _SUN: Slot User Number

that will eliminate contextual changes (causing test failures) when follow up patches merge code generating populated and empty slots descriptors.

Put mandatory _ADR as the 1st field, then ASUN as it can be present for both pupulated and empty slots and only then _SUN which is present only when slot is hotpluggable.

---
 hw/i386/acpi-build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/acpi-build.c +1 -1
index 36fe43c52f..fd7f3253e5 100644
@@ -442,8 +442,8 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
                     break;
                 }
                 dev = aml_device("S%.02X", devfn);
-                aml_append(dev, aml_name_decl("ASUN", aml_int(slot)));
                 aml_append(dev, aml_name_decl("_ADR", aml_int(adr)));
+                aml_append(dev, aml_name_decl("ASUN", aml_int(slot)));
                 aml_append(dev, aml_name_decl("_SUN", aml_int(slot)));
                 method = aml_method("_EJ0", 1, AML_NOTSERIALIZED);
                 aml_append(method,
Signature · 1 line
2.31.1
#17 lore raw

PATCH 13/17 tests: acpi: update expected blobs

In reply to Igor Mammedov

Expected change:
- Name (_SUN, 0x0X) // _SUN: Slot User Number

                   Name (_ADR, 0xY)  // _ADR: Address

...
+ Name (_SUN, 0xX) // _SUN: Slot User Number

---
 tests/qtest/bios-tables-test-allowed-diff.h |  14 --------------
 tests/data/acpi/pc/DSDT                     | Bin 6422 -> 6422 bytes
 tests/data/acpi/pc/DSDT.acpierst            | Bin 6382 -> 6382 bytes
 tests/data/acpi/pc/DSDT.acpihmat            | Bin 7747 -> 7747 bytes
 tests/data/acpi/pc/DSDT.bridge              | Bin 9496 -> 9496 bytes
 tests/data/acpi/pc/DSDT.cphp                | Bin 6886 -> 6886 bytes
 tests/data/acpi/pc/DSDT.dimmpxm             | Bin 8076 -> 8076 bytes
 tests/data/acpi/pc/DSDT.hpbridge            | Bin 6382 -> 6382 bytes
 tests/data/acpi/pc/DSDT.ipmikcs             | Bin 6494 -> 6494 bytes
 tests/data/acpi/pc/DSDT.memhp               | Bin 7781 -> 7781 bytes
 tests/data/acpi/pc/DSDT.nohpet              | Bin 6280 -> 6280 bytes
 tests/data/acpi/pc/DSDT.numamem             | Bin 6428 -> 6428 bytes
 tests/data/acpi/pc/DSDT.roothp              | Bin 6656 -> 6656 bytes
 tests/data/acpi/q35/DSDT.bridge             | Bin 11449 -> 11449 bytes
 tests/data/acpi/q35/DSDT.multi-bridge       | Bin 8640 -> 8640 bytes
 15 files changed, 14 deletions(-)
tests/qtest/bios-tables-test-allowed-diff.h +0 -14
index 1983fa596b..dfb8523c8b 100644
@@ -1,15 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/pc/DSDT",
-"tests/data/acpi/pc/DSDT.acpierst",
-"tests/data/acpi/pc/DSDT.acpihmat",
-"tests/data/acpi/pc/DSDT.bridge",
-"tests/data/acpi/pc/DSDT.cphp",
-"tests/data/acpi/pc/DSDT.dimmpxm",
-"tests/data/acpi/pc/DSDT.hpbridge",
-"tests/data/acpi/pc/DSDT.ipmikcs",
-"tests/data/acpi/pc/DSDT.memhp",
-"tests/data/acpi/pc/DSDT.nohpet",
-"tests/data/acpi/pc/DSDT.numamem",
-"tests/data/acpi/pc/DSDT.roothp",
-"tests/data/acpi/q35/DSDT.bridge",
-"tests/data/acpi/q35/DSDT.multi-bridge",
tests/data/acpi/pc/DSDT binary +0 -0
index 8282d449ceaefd914b419f507a13f3fb7b318aaf..fd79a602a2aaac0f7d91d2ee2b1af8f2e6cdd4b3 100644
GIT binary patch
tests/data/acpi/pc/DSDT.acpierst binary +0 -0
index 9520f3b7303a43091e8c77b64d1f76407e85f1f4..bcaebed6837b0ffafe1128e1f8c2e55d4c66679c 100644
GIT binary patch
tests/data/acpi/pc/DSDT.acpihmat binary +0 -0
index 33169838bed50710495d45e0d9486ac59b4e504c..973320cb25120818a45ddb3d8e3b3211f0c00adc 100644
GIT binary patch
tests/data/acpi/pc/DSDT.bridge binary +0 -0
index 407066e1ac46922751969b823000e4fdfa542662..9583da4e4f558cb0bf6912733fbe8db7c1ad255f 100644
GIT binary patch
tests/data/acpi/pc/DSDT.cphp binary +0 -0
index 013de154913063ed1ce3f154444b9e11f4608eac..27d1fc90f5f51c48a44bace866a19a42d7170129 100644
GIT binary patch
tests/data/acpi/pc/DSDT.dimmpxm binary +0 -0
index 289ec07c07734f6fb10e1f1f3de7b3de2a4642fd..efa46bc7860f0b026f23175ccf3ef1e1eba59c15 100644
GIT binary patch
tests/data/acpi/pc/DSDT.hpbridge binary +0 -0
index 9520f3b7303a43091e8c77b64d1f76407e85f1f4..bcaebed6837b0ffafe1128e1f8c2e55d4c66679c 100644
GIT binary patch
tests/data/acpi/pc/DSDT.ipmikcs binary +0 -0
index 59a6d5860887b511b7ce5f17d7044a08c14f0f60..67b60cc44a6ebff029524abc27ef48f90868f948 100644
GIT binary patch
tests/data/acpi/pc/DSDT.memhp binary +0 -0
index 47d63dec8f997417d7512a694a4825fee874d995..084957e53fb51e313dc824e5a8733f02ff77542c 100644
GIT binary patch
tests/data/acpi/pc/DSDT.nohpet binary +0 -0
index 47e4bf62ebe742304783e76984045d7322c3a421..46827e285421d4fb38160f6c15dc9134d7da5446 100644
GIT binary patch
tests/data/acpi/pc/DSDT.numamem binary +0 -0
index 1c4e0c80216b53463fbec8fc548007f0326c1829..ebdccc880def932fcba0cef8a7cf47ff7cc67f53 100644
GIT binary patch
tests/data/acpi/pc/DSDT.roothp binary +0 -0
index f9a5164e0cba7c209bd3e52020cb855e8688f682..f9aacee095bbb62251fc8231532f0d6e9f555a58 100644
GIT binary patch
tests/data/acpi/q35/DSDT.bridge binary +0 -0
index f8a0bc150f5a249bd5d09be6949c97160de1ef82..37ef245f673bcbd5385cb332cc0ccf06d5355485 100644
GIT binary patch
tests/data/acpi/q35/DSDT.multi-bridge binary +0 -0
index df91b798f79d4564b049e8a7dbeaa5bb99abe635..e9b67e9ebe1e3b4de513b68129f719018ebeeb2f 100644
GIT binary patch
Signature · 1 line
2.31.1
#18 lore raw

PATCH 14/17 tests: acpi: whitelist pc/q35 DSDT before moving _ADR field

In reply to Igor Mammedov
---
 tests/qtest/bios-tables-test-allowed-diff.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +14 -0
index dfb8523c8b..1983fa596b 100644
@@ -1 +1,15 @@
 /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/pc/DSDT",
+"tests/data/acpi/pc/DSDT.acpierst",
+"tests/data/acpi/pc/DSDT.acpihmat",
+"tests/data/acpi/pc/DSDT.bridge",
+"tests/data/acpi/pc/DSDT.cphp",
+"tests/data/acpi/pc/DSDT.dimmpxm",
+"tests/data/acpi/pc/DSDT.hpbridge",
+"tests/data/acpi/pc/DSDT.ipmikcs",
+"tests/data/acpi/pc/DSDT.memhp",
+"tests/data/acpi/pc/DSDT.nohpet",
+"tests/data/acpi/pc/DSDT.numamem",
+"tests/data/acpi/pc/DSDT.roothp",
+"tests/data/acpi/q35/DSDT.bridge",
+"tests/data/acpi/q35/DSDT.multi-bridge",
Signature · 1 line
2.31.1
#19 lore raw

PATCH 15/17 x86: pci: acpi: reorder Device's _DSM method

In reply to Igor Mammedov

align _DSM method in empty slot descriptor with
a populated slot position.
Expected change:
+ Device (SE8)
+ {
+ Name (_ADR, 0x001D0000) // _ADR: Address
+ Name (ASUN, 0x1D)

                   Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
                   {
                       Local0 = Package (0x02)
                           {
                               BSEL,
                               ASUN
                           }
                       Return (PDSM (Arg0, Arg1, Arg2, Arg3, Local0))
                   }

- }

- Device (SE8)
- {
- Name (_ADR, 0x001D0000) // _ADR: Address
- Name (ASUN, 0x1D)

                   Name (_SUN, 0x1D)  // _SUN: Slot User Number
                   Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
                   {
                       PCEJ (BSEL, _SUN)
                   }

+ }

i.e. put _DSM right after ASUN, with _SUN/_EJ0 following it.

that will eliminate contextual changes (causing test failures) when follow up patches merge code generating populated and empty slots descriptors.

---
 hw/i386/acpi-build.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
hw/i386/acpi-build.c +1 -3
index fd7f3253e5..406bbac1c7 100644
@@ -444,15 +444,13 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
                 dev = aml_device("S%.02X", devfn);
                 aml_append(dev, aml_name_decl("_ADR", aml_int(adr)));
                 aml_append(dev, aml_name_decl("ASUN", aml_int(slot)));
+                aml_append(dev, aml_pci_device_dsm());
                 aml_append(dev, aml_name_decl("_SUN", aml_int(slot)));
                 method = aml_method("_EJ0", 1, AML_NOTSERIALIZED);
                 aml_append(method,
                     aml_call2("PCEJ", aml_name("BSEL"), aml_name("_SUN"))
                 );
                 aml_append(dev, method);
-
-                aml_append(dev, aml_pci_device_dsm());
-
                 aml_append(parent_scope, dev);
 
                 build_append_pcihp_notify_entry(notify_method, slot);
Signature · 1 line
2.31.1
#20 lore raw

PATCH 16/17 tests: acpi: update expected blobs

In reply to Igor Mammedov

Expected change:
+ Device (SE8)
+ {
+ Name (_ADR, 0x001D0000) // _ADR: Address
+ Name (ASUN, 0x1D)
Method (_DSM, 4, Serialized) // _DSM: Device-Specific Method {
Local0 = Package (0x02)
{
BSEL,
ASUN
}
Return (PDSM (Arg0, Arg1, Arg2, Arg3, Local0))
}
- }

- Device (SE8)
- {
- Name (_ADR, 0x001D0000) // _ADR: Address
- Name (ASUN, 0x1D)
Name (_SUN, 0x1D) // _SUN: Slot User Number Method (_EJ0, 1, NotSerialized) // _EJx: Eject Device {
PCEJ (BSEL, _SUN)
}
+ }

---
 tests/qtest/bios-tables-test-allowed-diff.h |  14 --------------
 tests/data/acpi/pc/DSDT                     | Bin 6422 -> 6422 bytes
 tests/data/acpi/pc/DSDT.acpierst            | Bin 6382 -> 6382 bytes
 tests/data/acpi/pc/DSDT.acpihmat            | Bin 7747 -> 7747 bytes
 tests/data/acpi/pc/DSDT.bridge              | Bin 9496 -> 9496 bytes
 tests/data/acpi/pc/DSDT.cphp                | Bin 6886 -> 6886 bytes
 tests/data/acpi/pc/DSDT.dimmpxm             | Bin 8076 -> 8076 bytes
 tests/data/acpi/pc/DSDT.hpbridge            | Bin 6382 -> 6382 bytes
 tests/data/acpi/pc/DSDT.ipmikcs             | Bin 6494 -> 6494 bytes
 tests/data/acpi/pc/DSDT.memhp               | Bin 7781 -> 7781 bytes
 tests/data/acpi/pc/DSDT.nohpet              | Bin 6280 -> 6280 bytes
 tests/data/acpi/pc/DSDT.numamem             | Bin 6428 -> 6428 bytes
 tests/data/acpi/pc/DSDT.roothp              | Bin 6656 -> 6656 bytes
 tests/data/acpi/q35/DSDT.bridge             | Bin 11449 -> 11449 bytes
 tests/data/acpi/q35/DSDT.multi-bridge       | Bin 8640 -> 8640 bytes
 15 files changed, 14 deletions(-)
tests/qtest/bios-tables-test-allowed-diff.h +0 -14
index 1983fa596b..dfb8523c8b 100644
@@ -1,15 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/pc/DSDT",
-"tests/data/acpi/pc/DSDT.acpierst",
-"tests/data/acpi/pc/DSDT.acpihmat",
-"tests/data/acpi/pc/DSDT.bridge",
-"tests/data/acpi/pc/DSDT.cphp",
-"tests/data/acpi/pc/DSDT.dimmpxm",
-"tests/data/acpi/pc/DSDT.hpbridge",
-"tests/data/acpi/pc/DSDT.ipmikcs",
-"tests/data/acpi/pc/DSDT.memhp",
-"tests/data/acpi/pc/DSDT.nohpet",
-"tests/data/acpi/pc/DSDT.numamem",
-"tests/data/acpi/pc/DSDT.roothp",
-"tests/data/acpi/q35/DSDT.bridge",
-"tests/data/acpi/q35/DSDT.multi-bridge",
tests/data/acpi/pc/DSDT binary +0 -0
index fd79a602a2aaac0f7d91d2ee2b1af8f2e6cdd4b3..da2a3e5c0551ac2d1d8a0a40b92d3235d5757475 100644
GIT binary patch
tests/data/acpi/pc/DSDT.acpierst binary +0 -0
index bcaebed6837b0ffafe1128e1f8c2e55d4c66679c..abcd6d9d309a8f9a9080edc64df7a6c195b5885f 100644
GIT binary patch
tests/data/acpi/pc/DSDT.acpihmat binary +0 -0
index 973320cb25120818a45ddb3d8e3b3211f0c00adc..884d4871a2a0b87db2c0dd7e6f32486ba9b7e424 100644
GIT binary patch
tests/data/acpi/pc/DSDT.bridge binary +0 -0
index 9583da4e4f558cb0bf6912733fbe8db7c1ad255f..31a79aa47673c14f7e564475c39bd38c872f8165 100644
GIT binary patch
tests/data/acpi/pc/DSDT.cphp binary +0 -0
index 27d1fc90f5f51c48a44bace866a19a42d7170129..8b0cae4dbfbd083a43751a7c94dc5c76f89084a7 100644
GIT binary patch
tests/data/acpi/pc/DSDT.dimmpxm binary +0 -0
index efa46bc7860f0b026f23175ccf3ef1e1eba59c15..38865fb66747a6ee1cf2066b925be6eba064625a 100644
GIT binary patch
tests/data/acpi/pc/DSDT.hpbridge binary +0 -0
index bcaebed6837b0ffafe1128e1f8c2e55d4c66679c..abcd6d9d309a8f9a9080edc64df7a6c195b5885f 100644
GIT binary patch
tests/data/acpi/pc/DSDT.ipmikcs binary +0 -0
index 67b60cc44a6ebff029524abc27ef48f90868f948..e819ce69461a36b6fab5e2ffeba90dfe558724a7 100644
GIT binary patch
tests/data/acpi/pc/DSDT.memhp binary +0 -0
index 084957e53fb51e313dc824e5a8733f02ff77542c..03a9decdc1563f5e759e34dffdab4bb34645d9b3 100644
GIT binary patch
tests/data/acpi/pc/DSDT.nohpet binary +0 -0
index 46827e285421d4fb38160f6c15dc9134d7da5446..b413d9f31d483eca02f45ad09af2f556581ec381 100644
GIT binary patch
tests/data/acpi/pc/DSDT.numamem binary +0 -0
index ebdccc880def932fcba0cef8a7cf47ff7cc67f53..9e701b2983f9ec45af9c26d801545c2b5d112a10 100644
GIT binary patch
tests/data/acpi/pc/DSDT.roothp binary +0 -0
index f9aacee095bbb62251fc8231532f0d6e9f555a58..8c3956c9ecc63133cc800f1d2d07a1392a35d548 100644
GIT binary patch
tests/data/acpi/q35/DSDT.bridge binary +0 -0
index 37ef245f673bcbd5385cb332cc0ccf06d5355485..a42eb674fa3469a815b1c91ba99b2d4cf85c9380 100644
GIT binary patch
tests/data/acpi/q35/DSDT.multi-bridge binary +0 -0
index e9b67e9ebe1e3b4de513b68129f719018ebeeb2f..88bf47ab1805e4ef1dd8039933c5aa8144da37ac 100644
GIT binary patch
Signature · 1 line
2.31.1
#21 lore raw

PATCH 17/17 x86: pci: acpi: deduplate PCI slots creation

In reply to Igor Mammedov

No functional change nor AML bytcode change. Consolidate code that generates empty and populated slots descriptors. Beside of eliminating duplication, it helps to consolidate conditions for generating parts of Device{} desriptor in one place, which makes code more compact and easier to read.

---
 hw/i386/acpi-build.c | 111 +++++++++++++++++++++----------------------
 1 file changed, 54 insertions(+), 57 deletions(-)
hw/i386/acpi-build.c +54 -57
index 406bbac1c7..9d0512666d 100644
@@ -427,13 +427,41 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
         int func = PCI_FUNC(devfn);
         /* ACPI spec: 1.0b: Table 6-2 _ADR Object Bus Types, PCI type */
         int adr = slot << 16 | func;
-        bool hotplug_enabled_dev;
-        bool bridge_in_acpi;
-        bool cold_plugged_bridge;
+        bool hotpluggbale_slot = false;
+        bool bridge_in_acpi = false;
+        bool cold_plugged_bridge = false;
+        bool is_vga = false;
+
+        if (pdev) {
+            pc = PCI_DEVICE_GET_CLASS(pdev);
+            dc = DEVICE_GET_CLASS(pdev);
+
+            if (pc->class_id == PCI_CLASS_BRIDGE_ISA) {
+                continue;
+            }
+
+            is_vga = pc->class_id == PCI_CLASS_DISPLAY_VGA;
 
-        if (!pdev) {
             /*
-             * add hotplug slots for non present devices.
+             * Cold plugged bridges aren't themselves hot-pluggable.
+             * Hotplugged bridges *are* hot-pluggable.
+             */
+            cold_plugged_bridge = pc->is_bridge && !DEVICE(pdev)->hotplugged;
+            bridge_in_acpi =  cold_plugged_bridge && pcihp_bridge_en;
+
+            hotpluggbale_slot = bsel && dc->hotpluggable &&
+                                !cold_plugged_bridge;
+
+            /*
+             * allow describing coldplugged bridges in ACPI even if they are not
+             * on function 0, as they are not unpluggable, for all other devices
+             * generate description only for function 0 per slot
+             */
+            if (func && !bridge_in_acpi) {
+                continue;
+            }
+        } else {
+            /*
              * hotplug is supported only for non-multifunction device
              * so generate device description only for function 0
              */
@@ -441,46 +469,11 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
                 if (pci_bus_is_express(bus) && slot > 0) {
                     break;
                 }
-                dev = aml_device("S%.02X", devfn);
-                aml_append(dev, aml_name_decl("_ADR", aml_int(adr)));
-                aml_append(dev, aml_name_decl("ASUN", aml_int(slot)));
-                aml_append(dev, aml_pci_device_dsm());
-                aml_append(dev, aml_name_decl("_SUN", aml_int(slot)));
-                method = aml_method("_EJ0", 1, AML_NOTSERIALIZED);
-                aml_append(method,
-                    aml_call2("PCEJ", aml_name("BSEL"), aml_name("_SUN"))
-                );
-                aml_append(dev, method);
-                aml_append(parent_scope, dev);
-
-                build_append_pcihp_notify_entry(notify_method, slot);
+                /* mark it as empty hotpluggable slot */
+                hotpluggbale_slot = true;
+            } else {
+                continue;
             }
-            continue;
-        }
-
-        pc = PCI_DEVICE_GET_CLASS(pdev);
-        dc = DEVICE_GET_CLASS(pdev);
-
-        /*
-         * Cold plugged bridges aren't themselves hot-pluggable.
-         * Hotplugged bridges *are* hot-pluggable.
-         */
-        cold_plugged_bridge = pc->is_bridge && !DEVICE(pdev)->hotplugged;
-        bridge_in_acpi =  cold_plugged_bridge && pcihp_bridge_en;
-
-        hotplug_enabled_dev = bsel && dc->hotpluggable && !cold_plugged_bridge;
-
-        if (pc->class_id == PCI_CLASS_BRIDGE_ISA) {
-            continue;
-        }
-
-        /*
-         * allow describing coldplugged bridges in ACPI even if they are not
-         * on function 0, as they are not unpluggable, for all other devices
-         * generate description only for function 0 per slot
-         */
-        if (func && !bridge_in_acpi) {
-            continue;
         }
 
         /* start to compose PCI device descriptor */
@@ -496,7 +489,7 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
             aml_append(dev, aml_pci_device_dsm());
         }
 
-        if (pc->class_id == PCI_CLASS_DISPLAY_VGA) {
+        if (is_vga) {
             /* add VGA specific AML methods */
             int s3d;
 
@@ -517,19 +510,10 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
             method = aml_method("_S3D", 0, AML_NOTSERIALIZED);
             aml_append(method, aml_return(aml_int(s3d)));
             aml_append(dev, method);
-        } else if (hotplug_enabled_dev) {
-            aml_append(dev, aml_name_decl("_SUN", aml_int(slot)));
-            /* add _EJ0 to make slot hotpluggable  */
-            method = aml_method("_EJ0", 1, AML_NOTSERIALIZED);
-            aml_append(method,
-                aml_call2("PCEJ", aml_name("BSEL"), aml_name("_SUN"))
-            );
-            aml_append(dev, method);
+        }
 
-            if (bsel) {
-                build_append_pcihp_notify_entry(notify_method, slot);
-            }
-        } else if (bridge_in_acpi) {
+        bridge_in_acpi =  cold_plugged_bridge && pcihp_bridge_en;
+        if (bridge_in_acpi) {
             /*
              * device is coldplugged bridge,
              * add child device descriptions into its scope
@@ -538,6 +522,19 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
 
             build_append_pci_bus_devices(dev, sec_bus, pcihp_bridge_en);
         }
+
+        if (hotpluggbale_slot) {
+            aml_append(dev, aml_name_decl("_SUN", aml_int(slot)));
+            /* add _EJ0 to make slot hotpluggable  */
+            method = aml_method("_EJ0", 1, AML_NOTSERIALIZED);
+            aml_append(method,
+                aml_call2("PCEJ", aml_name("BSEL"), aml_name("_SUN"))
+            );
+            aml_append(dev, method);
+
+            build_append_pcihp_notify_entry(notify_method, slot);
+        }
+
         /* device descriptor has been composed, add it into parent context */
         aml_append(parent_scope, dev);
     }
Signature · 1 line
2.31.1
#22 lore raw
In reply to Igor Mammedov
Quoted 5 lines · On Fri, 1 Jul 2022 09:34:58 -0400 Igor Mammedov <[email protected]> wrote:

Flushing out ACPI PCI cleanups that preceed conversion of DSDT PCI slots ennumeration to AcpiDevAmlIf interface. It's is mostly collection of patches thraet removes code duplication, we've accumulated around PCI relaterd AML in DSDT.

ping,
it still applies cleanly to master.

Michael can you pick it up?

Quoted 60 lines

git:
https://gitlab.com/imammedo/qemu.git x86_pci_cleanups

Igor Mammedov (17):
tests: acpi: whitelist pc/q35 DSDT due to HPET AML move
acpi: x86: deduplicate HPET AML building
tests: acpi: update expected blobs after HPET move
tests: acpi: whitelist pc/q35 DSDT due to HPET AML move
acpi: x86: refactor PDSM method to reduce nesting
x86: acpi: _DSM: use Package to pass parameters
tests: acpi: update expected blobs
tests: acpi: whitelist pc/q35 DSDT before switching _DSM to use ASUN
x86: acpi: cleanup PCI device _DSM duplication
tests: acpi: update expected blobs
tests: acpi: whitelist pc/q35 DSDT before moving _ADR field
x86: pci: acpi: reorder Device's _ADR and _SUN fields
tests: acpi: update expected blobs
tests: acpi: whitelist pc/q35 DSDT before moving _ADR field
x86: pci: acpi: reorder Device's _DSM method
tests: acpi: update expected blobs
x86: pci: acpi: deduplate PCI slots creation

 hw/i386/acpi-build.c                  | 302 ++++++++++++++------------
 tests/data/acpi/pc/DSDT               | Bin 5987 -> 6422 bytes
 tests/data/acpi/pc/DSDT.acpierst      | Bin 5954 -> 6382 bytes
 tests/data/acpi/pc/DSDT.acpihmat      | Bin 7312 -> 7747 bytes
 tests/data/acpi/pc/DSDT.bridge        | Bin 8653 -> 9496 bytes
 tests/data/acpi/pc/DSDT.cphp          | Bin 6451 -> 6886 bytes
 tests/data/acpi/pc/DSDT.dimmpxm       | Bin 7641 -> 8076 bytes
 tests/data/acpi/pc/DSDT.hpbridge      | Bin 5954 -> 6382 bytes
 tests/data/acpi/pc/DSDT.hpbrroot      | Bin 3069 -> 3069 bytes
 tests/data/acpi/pc/DSDT.ipmikcs       | Bin 6059 -> 6494 bytes
 tests/data/acpi/pc/DSDT.memhp         | Bin 7346 -> 7781 bytes
 tests/data/acpi/pc/DSDT.nohpet        | Bin 5845 -> 6280 bytes
 tests/data/acpi/pc/DSDT.numamem       | Bin 5993 -> 6428 bytes
 tests/data/acpi/pc/DSDT.roothp        | Bin 6195 -> 6656 bytes
 tests/data/acpi/q35/DSDT              | Bin 8274 -> 8320 bytes
 tests/data/acpi/q35/DSDT.acpierst     | Bin 8291 -> 8337 bytes
 tests/data/acpi/q35/DSDT.acpihmat     | Bin 9599 -> 9645 bytes
 tests/data/acpi/q35/DSDT.applesmc     | Bin 8320 -> 8366 bytes
 tests/data/acpi/q35/DSDT.bridge       | Bin 10988 -> 11449 bytes
 tests/data/acpi/q35/DSDT.cphp         | Bin 8738 -> 8784 bytes
 tests/data/acpi/q35/DSDT.cxl          | Bin 9600 -> 9646 bytes
 tests/data/acpi/q35/DSDT.dimmpxm      | Bin 9928 -> 9974 bytes
 tests/data/acpi/q35/DSDT.ipmibt       | Bin 8349 -> 8395 bytes
 tests/data/acpi/q35/DSDT.ipmismbus    | Bin 8363 -> 8409 bytes
 tests/data/acpi/q35/DSDT.ivrs         | Bin 8291 -> 8337 bytes
 tests/data/acpi/q35/DSDT.memhp        | Bin 9633 -> 9679 bytes
 tests/data/acpi/q35/DSDT.mmio64       | Bin 9404 -> 9450 bytes
 tests/data/acpi/q35/DSDT.multi-bridge | Bin 8568 -> 8640 bytes
 tests/data/acpi/q35/DSDT.nohpet       | Bin 8132 -> 8178 bytes
 tests/data/acpi/q35/DSDT.numamem      | Bin 8280 -> 8326 bytes
 tests/data/acpi/q35/DSDT.pvpanic-isa  | Bin 8375 -> 8421 bytes
 tests/data/acpi/q35/DSDT.tis.tpm12    | Bin 8880 -> 8926 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2     | Bin 8906 -> 8952 bytes
 tests/data/acpi/q35/DSDT.viot         | Bin 9383 -> 9429 bytes
 tests/data/acpi/q35/DSDT.xapic        | Bin 35637 -> 35683 bytes
 35 files changed, 161 insertions(+), 141 deletions(-)
#23 lore raw
Quoted 9 lines · Igor Mammedov
Quoted 5 lines · On Fri, 1 Jul 2022 09:34:58 -0400 Igor Mammedov <[email protected]> wrote:

Flushing out ACPI PCI cleanups that preceed conversion of DSDT PCI slots ennumeration to AcpiDevAmlIf interface. It's is mostly collection of patches thraet removes code duplication, we've accumulated around PCI relaterd AML in DSDT.

Quoted 4 lines

ping,
it still applies cleanly to master.

Michael can you pick it up?

yes, thanks for the ping!

Quoted 60 lines
Quoted 60 lines

git:
https://gitlab.com/imammedo/qemu.git x86_pci_cleanups

Igor Mammedov (17):
tests: acpi: whitelist pc/q35 DSDT due to HPET AML move
acpi: x86: deduplicate HPET AML building
tests: acpi: update expected blobs after HPET move
tests: acpi: whitelist pc/q35 DSDT due to HPET AML move
acpi: x86: refactor PDSM method to reduce nesting
x86: acpi: _DSM: use Package to pass parameters
tests: acpi: update expected blobs
tests: acpi: whitelist pc/q35 DSDT before switching _DSM to use ASUN
x86: acpi: cleanup PCI device _DSM duplication
tests: acpi: update expected blobs
tests: acpi: whitelist pc/q35 DSDT before moving _ADR field
x86: pci: acpi: reorder Device's _ADR and _SUN fields
tests: acpi: update expected blobs
tests: acpi: whitelist pc/q35 DSDT before moving _ADR field
x86: pci: acpi: reorder Device's _DSM method
tests: acpi: update expected blobs
x86: pci: acpi: deduplate PCI slots creation

 hw/i386/acpi-build.c                  | 302 ++++++++++++++------------
 tests/data/acpi/pc/DSDT               | Bin 5987 -> 6422 bytes
 tests/data/acpi/pc/DSDT.acpierst      | Bin 5954 -> 6382 bytes
 tests/data/acpi/pc/DSDT.acpihmat      | Bin 7312 -> 7747 bytes
 tests/data/acpi/pc/DSDT.bridge        | Bin 8653 -> 9496 bytes
 tests/data/acpi/pc/DSDT.cphp          | Bin 6451 -> 6886 bytes
 tests/data/acpi/pc/DSDT.dimmpxm       | Bin 7641 -> 8076 bytes
 tests/data/acpi/pc/DSDT.hpbridge      | Bin 5954 -> 6382 bytes
 tests/data/acpi/pc/DSDT.hpbrroot      | Bin 3069 -> 3069 bytes
 tests/data/acpi/pc/DSDT.ipmikcs       | Bin 6059 -> 6494 bytes
 tests/data/acpi/pc/DSDT.memhp         | Bin 7346 -> 7781 bytes
 tests/data/acpi/pc/DSDT.nohpet        | Bin 5845 -> 6280 bytes
 tests/data/acpi/pc/DSDT.numamem       | Bin 5993 -> 6428 bytes
 tests/data/acpi/pc/DSDT.roothp        | Bin 6195 -> 6656 bytes
 tests/data/acpi/q35/DSDT              | Bin 8274 -> 8320 bytes
 tests/data/acpi/q35/DSDT.acpierst     | Bin 8291 -> 8337 bytes
 tests/data/acpi/q35/DSDT.acpihmat     | Bin 9599 -> 9645 bytes
 tests/data/acpi/q35/DSDT.applesmc     | Bin 8320 -> 8366 bytes
 tests/data/acpi/q35/DSDT.bridge       | Bin 10988 -> 11449 bytes
 tests/data/acpi/q35/DSDT.cphp         | Bin 8738 -> 8784 bytes
 tests/data/acpi/q35/DSDT.cxl          | Bin 9600 -> 9646 bytes
 tests/data/acpi/q35/DSDT.dimmpxm      | Bin 9928 -> 9974 bytes
 tests/data/acpi/q35/DSDT.ipmibt       | Bin 8349 -> 8395 bytes
 tests/data/acpi/q35/DSDT.ipmismbus    | Bin 8363 -> 8409 bytes
 tests/data/acpi/q35/DSDT.ivrs         | Bin 8291 -> 8337 bytes
 tests/data/acpi/q35/DSDT.memhp        | Bin 9633 -> 9679 bytes
 tests/data/acpi/q35/DSDT.mmio64       | Bin 9404 -> 9450 bytes
 tests/data/acpi/q35/DSDT.multi-bridge | Bin 8568 -> 8640 bytes
 tests/data/acpi/q35/DSDT.nohpet       | Bin 8132 -> 8178 bytes
 tests/data/acpi/q35/DSDT.numamem      | Bin 8280 -> 8326 bytes
 tests/data/acpi/q35/DSDT.pvpanic-isa  | Bin 8375 -> 8421 bytes
 tests/data/acpi/q35/DSDT.tis.tpm12    | Bin 8880 -> 8926 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2     | Bin 8906 -> 8952 bytes
 tests/data/acpi/q35/DSDT.viot         | Bin 9383 -> 9429 bytes
 tests/data/acpi/q35/DSDT.xapic        | Bin 35637 -> 35683 bytes
 35 files changed, 161 insertions(+), 141 deletions(-)
#24 lore raw
Quoted 10 lines · On Tue, 6 Sep 2022 09:10:32 -0400 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 9 lines · Igor Mammedov
Quoted 5 lines · On Fri, 1 Jul 2022 09:34:58 -0400 Igor Mammedov <[email protected]> wrote:

Flushing out ACPI PCI cleanups that preceed conversion of DSDT PCI slots ennumeration to AcpiDevAmlIf interface. It's is mostly collection of patches thraet removes code duplication, we've accumulated around PCI relaterd AML in DSDT.

Quoted 6 lines
Quoted 4 lines

ping,
it still applies cleanly to master.

Michael can you pick it up?

yes, thanks for the ping!

ping?

Quoted 62 lines
Quoted 61 lines
Quoted 61 lines

git:
https://gitlab.com/imammedo/qemu.git x86_pci_cleanups

Igor Mammedov (17):
tests: acpi: whitelist pc/q35 DSDT due to HPET AML move
acpi: x86: deduplicate HPET AML building
tests: acpi: update expected blobs after HPET move
tests: acpi: whitelist pc/q35 DSDT due to HPET AML move
acpi: x86: refactor PDSM method to reduce nesting
x86: acpi: _DSM: use Package to pass parameters
tests: acpi: update expected blobs
tests: acpi: whitelist pc/q35 DSDT before switching _DSM to use ASUN
x86: acpi: cleanup PCI device _DSM duplication
tests: acpi: update expected blobs
tests: acpi: whitelist pc/q35 DSDT before moving _ADR field
x86: pci: acpi: reorder Device's _ADR and _SUN fields
tests: acpi: update expected blobs
tests: acpi: whitelist pc/q35 DSDT before moving _ADR field
x86: pci: acpi: reorder Device's _DSM method
tests: acpi: update expected blobs
x86: pci: acpi: deduplate PCI slots creation

 hw/i386/acpi-build.c                  | 302 ++++++++++++++------------
 tests/data/acpi/pc/DSDT               | Bin 5987 -> 6422 bytes
 tests/data/acpi/pc/DSDT.acpierst      | Bin 5954 -> 6382 bytes
 tests/data/acpi/pc/DSDT.acpihmat      | Bin 7312 -> 7747 bytes
 tests/data/acpi/pc/DSDT.bridge        | Bin 8653 -> 9496 bytes
 tests/data/acpi/pc/DSDT.cphp          | Bin 6451 -> 6886 bytes
 tests/data/acpi/pc/DSDT.dimmpxm       | Bin 7641 -> 8076 bytes
 tests/data/acpi/pc/DSDT.hpbridge      | Bin 5954 -> 6382 bytes
 tests/data/acpi/pc/DSDT.hpbrroot      | Bin 3069 -> 3069 bytes
 tests/data/acpi/pc/DSDT.ipmikcs       | Bin 6059 -> 6494 bytes
 tests/data/acpi/pc/DSDT.memhp         | Bin 7346 -> 7781 bytes
 tests/data/acpi/pc/DSDT.nohpet        | Bin 5845 -> 6280 bytes
 tests/data/acpi/pc/DSDT.numamem       | Bin 5993 -> 6428 bytes
 tests/data/acpi/pc/DSDT.roothp        | Bin 6195 -> 6656 bytes
 tests/data/acpi/q35/DSDT              | Bin 8274 -> 8320 bytes
 tests/data/acpi/q35/DSDT.acpierst     | Bin 8291 -> 8337 bytes
 tests/data/acpi/q35/DSDT.acpihmat     | Bin 9599 -> 9645 bytes
 tests/data/acpi/q35/DSDT.applesmc     | Bin 8320 -> 8366 bytes
 tests/data/acpi/q35/DSDT.bridge       | Bin 10988 -> 11449 bytes
 tests/data/acpi/q35/DSDT.cphp         | Bin 8738 -> 8784 bytes
 tests/data/acpi/q35/DSDT.cxl          | Bin 9600 -> 9646 bytes
 tests/data/acpi/q35/DSDT.dimmpxm      | Bin 9928 -> 9974 bytes
 tests/data/acpi/q35/DSDT.ipmibt       | Bin 8349 -> 8395 bytes
 tests/data/acpi/q35/DSDT.ipmismbus    | Bin 8363 -> 8409 bytes
 tests/data/acpi/q35/DSDT.ivrs         | Bin 8291 -> 8337 bytes
 tests/data/acpi/q35/DSDT.memhp        | Bin 9633 -> 9679 bytes
 tests/data/acpi/q35/DSDT.mmio64       | Bin 9404 -> 9450 bytes
 tests/data/acpi/q35/DSDT.multi-bridge | Bin 8568 -> 8640 bytes
 tests/data/acpi/q35/DSDT.nohpet       | Bin 8132 -> 8178 bytes
 tests/data/acpi/q35/DSDT.numamem      | Bin 8280 -> 8326 bytes
 tests/data/acpi/q35/DSDT.pvpanic-isa  | Bin 8375 -> 8421 bytes
 tests/data/acpi/q35/DSDT.tis.tpm12    | Bin 8880 -> 8926 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2     | Bin 8906 -> 8952 bytes
 tests/data/acpi/q35/DSDT.viot         | Bin 9383 -> 9429 bytes
 tests/data/acpi/q35/DSDT.xapic        | Bin 35637 -> 35683 bytes
 35 files changed, 161 insertions(+), 141 deletions(-)