Skip to content

x86: fixing and cleaning up ACPI PCI code part 3

Igor Mammedov qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest40 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/40tests: qtest: print device_add error before failing testtests/qtest/libqtest.c+4 -00 replies
2/40tests: acpi: cleanup arguments to make them more readabletests/qtest/bios-tables-test.c+7 -100 replies
3/40tests: acpi: whitelist DSDT blobs for tests that use pci-bridgestests/qtest/bios-tables-test-allowed-diff.h+4 -00 replies
4/40tests: acpi: extend pcihp with nested bridgestests/qtest/bios-tables-test.c+13 -40 replies
5/40tests: acpi: update expected blobstests/data/acpi/pc/DSDT.bridge tests/data/acpi/pc/DSDT.roothp tests/data/acpi/q35/DSDT.multi-bridge +1 more+0 -40 replies
6/40tests: acpi: cleanup use_uefi argument usagetests/qtest/bios-tables-test.c+15 -200 replies
7/40pci_bridge: remove whitespacehw/pci-bridge/pci_bridge_dev.c+0 -10 replies
8/40x86: acpi: pcihp: clean up duplicate bridge_in_acpi assignmenthw/i386/acpi-build.c+0 -10 replies
9/40pci: acpi hotplug: rename x-native-hotplug to x-do-not-expose-native-hotplug-caphw/i386/pc_q35.c hw/pci-bridge/gen_pcie_root_port.c hw/pci/pcie.c +2 more+16 -80 replies
10/40pcihp: piix4: do not call acpi_pcihp_reset() when ACPI PCI hotplug is disabledhw/acpi/piix4.c+3 -10 replies
11/40pci: acpihp: assign BSEL only to coldplugged bridgeshw/acpi/pcihp.c+22 -130 replies
12/40x86: pcihp: fix invalid AML PCNT calls to hotplugged bridgeshw/i386/acpi-build.c+2 -10 replies
13/40tests: boot_sector_test: avoid crashing if status is not available yettests/qtest/boot-sector.c+3 -10 replies
14/40tests: acpi: extend bridge tests with hotplugged bridgestests/qtest/bios-tables-test.c+40 -80 replies
15/40tests: boot_sector_test(): make it multi-shottests/qtest/boot-sector.c+2 -00 replies
16/40tests: acpi: add reboot cycle to bridge testtests/qtest/bios-tables-test.c+15 -10 replies
17/40tests: acpi: whitelist DSDT before refactoring acpi based PCI hotplug machinerytests/qtest/bios-tables-test-allowed-diff.h+1 -00 replies
18/40pcihp: drop pcihp_bridge_en dependency when composing PCNT methodhw/i386/acpi-build.c+21 -260 replies
19/40tests: acpi: update expected blobstests/data/acpi/pc/DSDT.hpbrroot tests/qtest/bios-tables-test-allowed-diff.h+0 -10 replies
20/40tests: acpi: whitelist DSDT before refactoring acpi based PCI hotplug machinerytests/qtest/bios-tables-test-allowed-diff.h+36 -00 replies
21/40pcihp: compose PCNT callchain right before its user _GPE._E01hw/i386/acpi-build.c+30 -20 replies
22/40pcihp: do not put empty PCNT in DSDThw/i386/acpi-build.c+18 -80 replies
23/40tests: acpi: update expected blobstests/data/acpi/pc/DSDT tests/data/acpi/pc/DSDT.acpierst tests/data/acpi/pc/DSDT.acpihmat +34 more+0 -360 replies
24/40whitelist DSDT before adding endpoint devices to bridge testcasestests/qtest/bios-tables-test-allowed-diff.h+4 -00 replies
25/40tests: acpi: add endpoint devices to bridgestests/qtest/bios-tables-test.c+29 -80 replies
26/40tests: acpi: update expected blobstests/data/acpi/pc/DSDT.hpbrroot tests/data/acpi/pc/DSDT.roothp tests/data/acpi/q35/DSDT.bridge +2 more+0 -40 replies
27/40x86: pcihp: acpi: prepare slot ignore rule to work with self describing bridgeshw/i386/acpi-build.c+16 -80 replies
28/40pci: acpi: wire up AcpiDevAmlIf interface to generic bridgehw/pci/pci_bridge.c+5 -00 replies
29/40pcihp: make bridge describe itself using AcpiDevAmlIfClass:build_dev_amlhw/acpi/Kconfig hw/acpi/meson.build hw/acpi/pci-bridge-stub.c +5 more+70 -160 replies
30/40pci: make sure pci_bus_is_express() won't error out with "discards ‘const’ qualifier"hw/pci/pci.c include/hw/pci/pci.h+2 -20 replies
31/40pcihp: isolate rule whether slot should be described in DSDThw/i386/acpi-build.c+43 -400 replies
32/40tests: acpi: whitelist DSDT before decoupling PCI hotplug code from basic slots descriptiontests/qtest/bios-tables-test-allowed-diff.h+14 -00 replies
33/40pcihp: acpi: decouple hotplug and generic slots descriptionhw/i386/acpi-build.c+72 -490 replies
34/40tests: acpi: update expected blobstests/data/acpi/pc/DSDT tests/data/acpi/pc/DSDT.acpierst tests/data/acpi/pc/DSDT.acpihmat +12 more+0 -140 replies
35/40tests: acpi: whitelist DSDT blobs before removing dynamic _DSM on coldplugged bridgestests/qtest/bios-tables-test-allowed-diff.h+4 -00 replies
36/40pcihp: acpi: ignore coldplugged bridges when composing hotpluggable slotshw/i386/acpi-build.c+6 -100 replies
37/40tests: acpi: update expected blobstests/data/acpi/pc/DSDT.bridge tests/data/acpi/pc/DSDT.hpbridge tests/data/acpi/pc/DSDT.roothp +2 more+0 -40 replies
38/40tests: acpi: whitelist DSDT before moving non-hotpluggble slots description from hotplug pathtests/qtest/bios-tables-test-allowed-diff.h+11 -00 replies
39/40pcihp: generate populated non-hotpluggble slot descriptions on non-hotplug pathhw/i386/acpi-build.c+12 -150 replies
40/40tests: acpi: update expected blobstests/data/acpi/pc/DSDT tests/data/acpi/pc/DSDT.acpierst tests/data/acpi/pc/DSDT.acpihmat +9 more+0 -110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/40] x86: fixing and cleaning up ACPI PCI code part 3

Series continues refactoring on top of [1].

It focuses on isolating creation of non hotplug and hotplug slot descriptions. In state it's posted, it's not complete, but pretty close to it. The series contains stable patches from refactoring and is already too large to keep it to myself, hence I'm publishing it fro review.

It will be followed by separate series on top of this one, that will finish concrete feature[s] in following order:
1 introduce acpi-index support for non-hotpluggable PCI
devices (i.e. NICs directly attached to Q35 host-bridge) making acpi-index support complete within pc/q35 machines.
2 let guest OS to re-arrange bridge resources when ACPI PCI
hotplug is enabled. (should fix insuficient resources issue during PCI hotplug)
3 finish isolating hotplug code from non-hotplug one,
which should allow to re-use non-hotplug parts in other machines (arm/virt and microvm) and bring acpi-index support there.

PS:
Refactoring also adds testing for various corner cases and fixes (present/latent/imagined) bugs where they were spotted.

1) "[PATCH 00/11] x86: clean up ACPI PCI code part 2"
https://www.mail-archive.com/[email protected]/msg915493.html

CC "Michael S. Tsirkin" <[email protected]>
CC Ani Sinha <[email protected]>

Igor Mammedov (40):
tests: qtest: print device_add error before failing test
tests: acpi: cleanup arguments to make them more readable
tests: acpi: whitelist DSDT blobs for tests that use pci-bridges
tests: acpi: extend pcihp with nested bridges
tests: acpi: update expected blobs
tests: acpi: cleanup use_uefi argument usage
pci_bridge: remove whitespace
x86: acpi: pcihp: clean up duplicate bridge_in_acpi assignment
pci: acpi hotplug: rename x-native-hotplug to
x-do-not-expose-native-hotplug-cap
pcihp: piix4: do not call acpi_pcihp_reset() when ACPI PCI hotplug is
disabled
pci: acpihp: assign BSEL only to coldplugged bridges
x86: pcihp: fix invalid AML PCNT calls to hotplugged bridges
tests: boot_sector_test: avoid crashing if status is not available yet
tests: acpi: extend bridge tests with hotplugged bridges
tests: boot_sector_test(): make it multi-shot
tests: acpi: add reboot cycle to bridge test
tests: acpi: whitelist DSDT before refactoring acpi based PCI hotplug
machinery
pcihp: drop pcihp_bridge_en dependency when composing PCNT method
tests: acpi: update expected blobs
tests: acpi: whitelist DSDT before refactoring acpi based PCI hotplug
machinery
pcihp: compose PCNT callchain right before its user _GPE._E01
pcihp: do not put empty PCNT in DSDT
tests: acpi: update expected blobs
whitelist DSDT before adding endpoint devices to bridge testcases
tests: acpi: add endpoint devices to bridges
tests: acpi: update expected blobs
x86: pcihp: acpi: prepare slot ignore rule to work with self
describing bridges
pci: acpi: wire up AcpiDevAmlIf interface to generic bridge
pcihp: make bridge describe itself using
AcpiDevAmlIfClass:build_dev_aml
pci: make sure pci_bus_is_express() won't error out with "discards
‘const’ qualifier"
pcihp: isolate rule whether slot should be described in DSDT
tests: acpi: whitelist DSDT before decoupling PCI hotplug code from
basic slots description
pcihp: acpi: decouple hotplug and generic slots description
tests: acpi: update expected blobs
tests: acpi: whitelist DSDT blobs before removing dynamic _DSM on
coldplugged bridges
pcihp: acpi: ignore coldplugged bridges when composing hotpluggable
slots
tests: acpi: update expected blobs
tests: acpi: whitelist DSDT before moving non-hotpluggble slots
description from hotplug path
pcihp: generate populated non-hotpluggble slot descriptions on
non-hotplug path
tests: acpi: update expected blobs

 include/hw/acpi/pci.h                         |   4 +
 include/hw/pci/pci.h                          |   2 +-
 include/hw/pci/pcie_port.h                    |   3 +-
 hw/acpi/Kconfig                               |   4 +
 hw/acpi/meson.build                           |   4 +-
 hw/acpi/pci-bridge-stub.c                     |  20 ++
 hw/acpi/pci-bridge.c                          |  27 ++
 hw/acpi/pcihp.c                               |  35 ++-
 hw/acpi/piix4.c                               |   4 +-
 hw/i386/Kconfig                               |   1 +
 hw/i386/acpi-build.c                          | 279 ++++++++++--------
 hw/i386/pc_q35.c                              |   5 +-
 hw/pci-bridge/gen_pcie_root_port.c            |   7 +-
 hw/pci-bridge/pci_bridge_dev.c                |   1 -
 hw/pci/pci.c                                  |   2 +-
 hw/pci/pci_bridge.c                           |  14 +
 hw/pci/pcie.c                                 |   6 +-
 hw/pci/pcie_port.c                            |   3 +-
 tests/data/acpi/pc/DSDT                       | Bin 6458 -> 6360 bytes
 tests/data/acpi/pc/DSDT.acpierst              | Bin 6418 -> 6283 bytes
 tests/data/acpi/pc/DSDT.acpihmat              | Bin 7783 -> 7685 bytes
 tests/data/acpi/pc/DSDT.bridge                | Bin 9532 -> 12487 bytes
 tests/data/acpi/pc/DSDT.cphp                  | Bin 6922 -> 6824 bytes
 tests/data/acpi/pc/DSDT.dimmpxm               | Bin 8112 -> 8014 bytes
 tests/data/acpi/pc/DSDT.hpbridge              | Bin 6418 -> 6289 bytes
 tests/data/acpi/pc/DSDT.hpbrroot              | Bin 3064 -> 3081 bytes
 tests/data/acpi/pc/DSDT.ipmikcs               | Bin 6530 -> 6432 bytes
 tests/data/acpi/pc/DSDT.memhp                 | Bin 7817 -> 7719 bytes
 tests/data/acpi/pc/DSDT.nohpet                | Bin 6316 -> 6218 bytes
 tests/data/acpi/pc/DSDT.numamem               | Bin 6464 -> 6366 bytes
 tests/data/acpi/pc/DSDT.roothp                | Bin 6656 -> 9745 bytes
 tests/data/acpi/q35/DSDT                      | Bin 8310 -> 8252 bytes
 tests/data/acpi/q35/DSDT.acpierst             | Bin 8327 -> 8269 bytes
 tests/data/acpi/q35/DSDT.acpihmat             | Bin 9635 -> 9577 bytes
 tests/data/acpi/q35/DSDT.acpihmat-noinitiator | Bin 8589 -> 8531 bytes
 tests/data/acpi/q35/DSDT.applesmc             | Bin 8356 -> 8298 bytes
 tests/data/acpi/q35/DSDT.bridge               | Bin 11439 -> 11481 bytes
 tests/data/acpi/q35/DSDT.core-count2          | Bin 32450 -> 32392 bytes
 tests/data/acpi/q35/DSDT.cphp                 | Bin 8774 -> 8716 bytes
 tests/data/acpi/q35/DSDT.cxl                  | Bin 9636 -> 9578 bytes
 tests/data/acpi/q35/DSDT.dimmpxm              | Bin 9964 -> 9906 bytes
 tests/data/acpi/q35/DSDT.ipmibt               | Bin 8385 -> 8327 bytes
 tests/data/acpi/q35/DSDT.ipmismbus            | Bin 8398 -> 8340 bytes
 tests/data/acpi/q35/DSDT.ivrs                 | Bin 8327 -> 8269 bytes
 tests/data/acpi/q35/DSDT.memhp                | Bin 9669 -> 9611 bytes
 tests/data/acpi/q35/DSDT.mmio64               | Bin 9440 -> 9382 bytes
 tests/data/acpi/q35/DSDT.multi-bridge         | Bin 8630 -> 12337 bytes
 tests/data/acpi/q35/DSDT.nohpet               | Bin 8168 -> 8110 bytes
 tests/data/acpi/q35/DSDT.numamem              | Bin 8316 -> 8258 bytes
 tests/data/acpi/q35/DSDT.pvpanic-isa          | Bin 8411 -> 8353 bytes
 tests/data/acpi/q35/DSDT.tis.tpm12            | Bin 8916 -> 8858 bytes
 tests/data/acpi/q35/DSDT.tis.tpm2             | Bin 8942 -> 8884 bytes
 tests/data/acpi/q35/DSDT.viot                 | Bin 9419 -> 9361 bytes
 tests/data/acpi/q35/DSDT.xapic                | Bin 35673 -> 35615 bytes
 tests/qtest/bios-tables-test.c                | 144 ++++++---
 tests/qtest/boot-sector.c                     |   6 +-
 tests/qtest/libqtest.c                        |   4 +
 57 files changed, 394 insertions(+), 181 deletions(-)
 create mode 100644 hw/acpi/pci-bridge-stub.c
 create mode 100644 hw/acpi/pci-bridge.c
Signature · 1 line
2.31.1