Skip to content

ACPI PCI Hotplug support on ARM

Eric Auger qemu-arm qemu-devel 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest36 patches 15 repliesIn review
  2. v636 patches 11 repliesSuperseded
  3. v536 patches 15 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v432 patches20 repliesSuperseded
v329 patches57 repliesSuperseded
v225 patches82 repliesSuperseded
v122 patches24 repliesSuperseded

Changes in v7 from the cover letter

- rebased after minor contextual conflict introduced by "hw/arm/virt: Basic CXL enablement on pci_expander_bridge instances pxb-cxl" in hw/arm/virt-acpi-build.c (hw/pci-host/gpex-acpi: Use GED acpi pcihp property)
- collected last Igor's and Prasad's R-bs

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/36hw/i386/acpi-build: Make aml_pci_device_dsm() statichw/i386/acpi-build.c include/hw/acpi/pci.h+1 -20 replies
2/36hw/acpi: Rename and move build_x86_acpi_pci_hotplug to pcihphw/acpi/pcihp.c hw/i386/acpi-build.c hw/i386/acpi-build.h +1 more+182 -1790 replies
3/36hw/pci-host/gpex-acpi: Add native_pci_hotplug arg to acpi_dsdt_add_pci_oschw/pci-host/gpex-acpi.c+8 -70 replies
4/36tests/qtest/bios-tables-test: Prepare for changes in the DSDT tabletests/qtest/bios-tables-test-allowed-diff.h+7 -00 replies
5/36hw/pci-host/gpex-acpi: Split host bridge OSC and DSM generationhw/pci-host/gpex-acpi.c+21 -110 replies
6/36hw/acpi/ged: Add a acpi-pci-hotplug-with-bridge-support propertyhw/acpi/generic_event_device.c include/hw/acpi/generic_event_device.h+4 -00 replies
7/36hw/pci-host/gpex-acpi: Use GED acpi pcihp propertyhw/arm/virt-acpi-build.c hw/pci-host/gpex-acpi.c include/hw/pci-host/gpex.h+12 -10 replies
8/36hw/i386/acpi-build: Turn build_q35_osc_method into a generic methodhw/acpi/pci.c hw/i386/acpi-build.c include/hw/acpi/pci.h+54 -520 replies
9/36hw/pci-host/gpex-acpi: Use build_pci_host_bridge_osc_methodhw/pci-host/Kconfig hw/pci-host/gpex-acpi.c+6 -5710 replies
10/36tests/qtest/bios-tables-test: Update DSDT blobs after GPEX _OSC changetests/data/acpi/aarch64/virt/DSDT tests/data/acpi/aarch64/virt/DSDT.acpihmatvirt tests/data/acpi/aarch64/virt/DSDT.memhp +5 more+0 -70 replies
11/36hw/i386/acpi-build: Introduce build_append_pcihp_resources() helperhw/acpi/pcihp.c hw/i386/acpi-build.c include/hw/acpi/pcihp.h+22 -130 replies
12/36hw/acpi/pcihp: Add an AmlRegionSpace arg to build_acpi_pci_hotplughw/acpi/pcihp.c hw/i386/acpi-build.c include/hw/acpi/pcihp.h+8 -70 replies
13/36hw/i386/acpi-build: Move build_append_notification_callback to pcihphw/acpi/pcihp.c hw/i386/acpi-build.c include/hw/acpi/pcihp.h+59 -580 replies
14/36hw/i386/acpi-build: Move build_append_pci_bus_devices/pcihp_slots to pcihphw/acpi/pcihp.c hw/i386/acpi-build.c include/hw/acpi/pci.h +1 more+175 -1730 replies
15/36hw/i386/acpi-build: Use AcpiPciHpState::root in acpi_set_pci_infohw/acpi/pcihp.c+4 -70 replies
16/36hw/i386/acpi-build: Move aml_pci_edsm to a generic placehw/acpi/pci-bridge.c hw/i386/acpi-build.c include/hw/acpi/pci.h+57 -550 replies
17/36qtest/bios-tables-test: Prepare for fixing the aarch64 viot testtests/data/acpi/aarch64/virt/DSDT.viot tests/qtest/bios-tables-test-allowed-diff.h+1 -00 replies
18/36qtest/bios-tables-test: Add a variant to the aarch64 viot testtests/qtest/bios-tables-test.c+1 -00 replies
19/36qtest/bios-tables-test: Generate DSDT.viottests/data/acpi/aarch64/virt/DSDT.viot tests/qtest/bios-tables-test-allowed-diff.h+0 -10 replies
20/36tests/qtest/bios-tables-test: Prepare for changes in the arm virt DSDT tabletests/qtest/bios-tables-test-allowed-diff.h+6 -00 replies
21/36hw/arm/virt-acpi-build: Let non hotplug ports support static acpi-indexhw/arm/Kconfig hw/arm/virt-acpi-build.c+14 -00 replies
22/36tests/qtest/bios-tables-test: Update ARM DSDT reference blobstests/data/acpi/aarch64/virt/DSDT tests/data/acpi/aarch64/virt/DSDT.acpihmatvirt tests/data/acpi/aarch64/virt/DSDT.memhp +4 more+0 -60 replies
23/36hw/arm/virt-acpi-build: Modify the DSDT ACPI table to enable ACPI PCI hotplughw/acpi/pcihp.c hw/arm/virt-acpi-build.c hw/arm/virt.c +2 more+22 -10 replies
24/36hw/acpi/ged: Add a bus link propertyhw/acpi/generic_event_device.c+3 -00 replies
25/36hw/arm/virt: Pass the bus on the ged creationhw/arm/virt.c+1 -00 replies
26/36hw/acpi/ged: Call pcihp plug callbacks in hotplug handler implementationhw/acpi/generic_event_device.c+17 -00 replies
27/36hw/acpi/pcihp: Remove root arg in acpi_pcihp_inithw/acpi/acpi-pci-hotplug-stub.c hw/acpi/ich9.c hw/acpi/pcihp.c +2 more+14 -60 replies
28/36hw/acpi/ged: Prepare the device to react to PCI hotplug eventshw/acpi/generic_event_device.c include/hw/acpi/generic_event_device.h+48 -10 replies
29/36hw/acpi/ged: Support migration of AcpiPciHpStatehw/acpi/generic_event_device.c+20 -00 replies
30/36hw/core/sysbus: Introduce sysbus_mmio_map_name() helperhw/core/sysbus.c include/hw/sysbus.h+12 -00 replies
31/36hw/arm/virt: Minor code reshuffling in create_acpi_gedhw/arm/virt.c include/hw/acpi/generic_event_device.h+8 -40 replies
32/36hw/arm/virt: Let virt support pci hotplug/unplug GED eventhw/arm/virt.c+13 -00 replies
33/36tests/qtest/bios-tables-test: Prepare for addition of acpi pci hp teststests/data/acpi/aarch64/virt/DSDT.acpipcihp tests/data/acpi/aarch64/virt/DSDT.hpoffacpiindex tests/qtest/bios-tables-test-allowed-diff.h+2 -00 replies
34/36tests/qtest/bios-tables-test: Add aarch64 ACPI PCI hotplug testtests/qtest/bios-tables-test.c+52 -00 replies
35/36qtest/bios-tables-test: Generate reference blob for DSDT.hpoffacpiindextests/data/acpi/aarch64/virt/DSDT.hpoffacpiindex tests/qtest/bios-tables-test-allowed-diff.h+0 -10 replies
36/36qtest/bios-tables-test: Generate reference blob for DSDT.acpipcihptests/data/acpi/aarch64/virt/DSDT.acpipcihp tests/qtest/bios-tables-test-allowed-diff.h+0 -10 replies

Reviews trailers per patch

All 36 patches have a Reviewed-by or Acked-by.

PatchJonathan CameronIgor MammedovGustavo RomeroPhilippe Mathieu-DaudéPrasad Pandit
1/36R-b R-b R-b R-b
2/36R-b R-b R-b
3/36R-b R-b R-b
4/36R-b A-b
5/36R-b R-b
6/36R-b R-b
7/36R-b
8/36R-b R-b
9/36R-b R-b
10/36R-b R-b
11/36R-b R-b R-b
12/36R-b R-b R-b
13/36R-b R-b R-b
14/36R-b R-b R-b
15/36R-b R-b
16/36R-b R-b
17/36R-b R-b
18/36R-b R-b
19/36R-b R-b
20/36R-b R-b
21/36R-b R-b
22/36R-b R-b
23/36R-b R-b
24/36R-b R-b
25/36R-b R-b
26/36R-b R-b
27/36R-b R-b
28/36R-b R-b
29/36R-b R-b R-b
30/36R-b R-b
31/36R-b R-b
32/36R-b R-b
33/36R-b R-b
34/36R-b R-b
35/36R-b R-b
36/36R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v7 thread

Cover letter [PATCH v7 00/36] ACPI PCI Hotplug support on ARM

This series enables ACPI PCI hotplug/hotunplug on ARM. It is not enabled by default and ACPI PCI hotplug can be selected by setting:

-global acpi-ged.acpi-pci-hotplug-with-bridge-support=on

Expected benefits should be similar to those listed in [1], ie. removal of some racy behaviors, improved latencies.

The infrastructure used in x86 is heavily reused and a huge part of the series consists in moving code from hw/i386/acpi-build.c to a generic place and slightly adapting it to make it usable on ARM. The DSDT table is augmented to support ACPI PCI hotplug elements.

On ARM we use use a GED event to notify the OS about hotplug events.

Best Regards

Eric

This series can be found at:
https://github.com/eauger/qemu/tree/arm-acpi-pcihp-v7

previous series:
https://github.com/eauger/qemu/tree/arm-acpi-pcihp-v6

History:
v6 -> v7:
- rebased after minor contextual conflict introduced by "hw/arm/virt: Basic CXL enablement on pci_expander_bridge instances pxb-cxl" in hw/arm/virt-acpi-build.c (hw/pci-host/gpex-acpi: Use GED acpi pcihp property)
- collected last Igor's and Prasad's R-bs

v5 -> v6:
- collected Jonathan's R-bs
- cropped last 2 patch commit messages (Jonathan)

v4 -> v5:
- Collected Jonathan's R-bs (many thanks!)
- fixed the tests/qtest/bios-tables-test issue by creating a variant for the viot test
- use the 3 phase reset API
- fixed qom-test failures that were due to unconditionnal fetches of the GED property

v3 -> v4:
- toook into account all comments on v3
- static acpi-index is now supported unconditionally from acpi pcihp option. See indiviual patches.
- I hit a problem with ref block generation at
[19/32] tests/qtest/bios-tables-test: Update ARM DSDT reference
blobs: despite I regenerate the blobs, I get some errors.

v2 -> v3:
- lot of changes taking into account various feedbacks (many thanks to all reviewers). Please refer to individual patches for details. Main changes:
- no more machine option, acpi pci hp is not set by default.
- removal of 2 unused variables in the osc method
- introduction of GED property to set the bus
- rework of the init/reset sequence
- fix virtio-mem-pci hotplug regression

v1 -> v2:
- collected a bunch of R-bs from Gustavo (many thanks!)
- Fixed the breakage of bios-tables-test in TCG mode by incorporating Gustavo's patches (part of
[PATCH 0/5] ACPI tests for PCI Hotplug on ARM
https://lore.kernel.org/all/[email protected]/)
- Tweeked the dsdt aml changes to avoid any dsdt blob difference when acpi-pcihp is off.

RFC -> v1:
- First 3 trivial patches were pulled separately
- Fix of the register region size (0x18), ie. ACPI_PCIHP_SIZE
- addition of aml_pci_edsm which was not called in RFC
- acpi-index feature is now fixed. vms->bus was not set on acpi_pcihp_init. The init sequence is still hacky though. Suggestions are welcome.

[1] [PATCH v6 0/6] Use ACPI PCI hot-plug for Q35
https://lore.kernel.org/all/[email protected]/

Eric Auger (32):
hw/i386/acpi-build: Make aml_pci_device_dsm() static hw/acpi: Rename and move build_x86_acpi_pci_hotplug to pcihp hw/pci-host/gpex-acpi: Add native_pci_hotplug arg to
acpi_dsdt_add_pci_osc
hw/pci-host/gpex-acpi: Split host bridge OSC and DSM generation hw/acpi/ged: Add a acpi-pci-hotplug-with-bridge-support property hw/pci-host/gpex-acpi: Use GED acpi pcihp property hw/i386/acpi-build: Turn build_q35_osc_method into a generic method hw/pci-host/gpex-acpi: Use build_pci_host_bridge_osc_method tests/qtest/bios-tables-test: Update DSDT blobs after GPEX _OSC change hw/i386/acpi-build: Introduce build_append_pcihp_resources() helper hw/acpi/pcihp: Add an AmlRegionSpace arg to build_acpi_pci_hotplug hw/i386/acpi-build: Move build_append_notification_callback to pcihp hw/i386/acpi-build: Move build_append_pci_bus_devices/pcihp_slots to
pcihp
hw/i386/acpi-build: Use AcpiPciHpState::root in acpi_set_pci_info hw/i386/acpi-build: Move aml_pci_edsm to a generic place qtest/bios-tables-test: Prepare for fixing the aarch64 viot test qtest/bios-tables-test: Add a variant to the aarch64 viot test qtest/bios-tables-test: Generate DSDT.viot hw/arm/virt-acpi-build: Let non hotplug ports support static
acpi-index
tests/qtest/bios-tables-test: Update ARM DSDT reference blobs hw/arm/virt-acpi-build: Modify the DSDT ACPI table to enable ACPI PCI
hotplug
hw/acpi/ged: Add a bus link property
hw/arm/virt: Pass the bus on the ged creation
hw/acpi/ged: Call pcihp plug callbacks in hotplug handler
implementation
hw/acpi/pcihp: Remove root arg in acpi_pcihp_init hw/acpi/ged: Prepare the device to react to PCI hotplug events hw/acpi/ged: Support migration of AcpiPciHpState hw/core/sysbus: Introduce sysbus_mmio_map_name() helper hw/arm/virt: Minor code reshuffling in create_acpi_ged hw/arm/virt: Let virt support pci hotplug/unplug GED event qtest/bios-tables-test: Generate reference blob for
DSDT.hpoffacpiindex
qtest/bios-tables-test: Generate reference blob for DSDT.acpipcihp

Gustavo Romero (4):
tests/qtest/bios-tables-test: Prepare for changes in the DSDT table tests/qtest/bios-tables-test: Prepare for changes in the arm virt DSDT
table
tests/qtest/bios-tables-test: Prepare for addition of acpi pci hp
tests
tests/qtest/bios-tables-test: Add aarch64 ACPI PCI hotplug test

 hw/i386/acpi-build.h                          |   4 -
 include/hw/acpi/generic_event_device.h        |  17 +-
 include/hw/acpi/pci.h                         |   5 +-
 include/hw/acpi/pcihp.h                       |  17 +-
 include/hw/arm/virt.h                         |   1 +
 include/hw/pci-host/gpex.h                    |   1 +
 include/hw/sysbus.h                           |   1 +
 hw/acpi/acpi-pci-hotplug-stub.c               |   2 +-
 hw/acpi/generic_event_device.c                |  77 +++
 hw/acpi/ich9.c                                |   7 +-
 hw/acpi/pci-bridge.c                          |  54 ++
 hw/acpi/pci.c                                 |  50 ++
 hw/acpi/pcihp.c                               | 439 ++++++++++++++-
 hw/acpi/piix4.c                               |   5 +-
 hw/arm/virt-acpi-build.c                      |  38 ++
 hw/arm/virt.c                                 |  27 +-
 hw/core/sysbus.c                              |  11 +
 hw/i386/acpi-build.c                          | 532 +-----------------
 hw/pci-host/gpex-acpi.c                       |  74 +--
 tests/qtest/bios-tables-test.c                |  53 ++
 hw/arm/Kconfig                                |   2 +
 hw/pci-host/Kconfig                           |   1 +
 tests/data/acpi/aarch64/virt/DSDT             | Bin 5196 -> 5293 bytes
 .../data/acpi/aarch64/virt/DSDT.acpihmatvirt  | Bin 5282 -> 5379 bytes
 tests/data/acpi/aarch64/virt/DSDT.acpipcihp   | Bin 0 -> 6202 bytes
 .../acpi/aarch64/virt/DSDT.hpoffacpiindex     | Bin 0 -> 5347 bytes
 tests/data/acpi/aarch64/virt/DSDT.memhp       | Bin 6557 -> 6654 bytes
 tests/data/acpi/aarch64/virt/DSDT.pxb         | Bin 7679 -> 7768 bytes
 tests/data/acpi/aarch64/virt/DSDT.topology    | Bin 5398 -> 5495 bytes
 tests/data/acpi/aarch64/virt/DSDT.viot        | Bin 0 -> 5310 bytes
 tests/data/acpi/riscv64/virt/DSDT             | Bin 3576 -> 3538 bytes
 tests/data/acpi/x86/microvm/DSDT.pcie         | Bin 3023 -> 2985 bytes
 32 files changed, 811 insertions(+), 607 deletions(-)
 create mode 100644 tests/data/acpi/aarch64/virt/DSDT.acpipcihp
 create mode 100644 tests/data/acpi/aarch64/virt/DSDT.hpoffacpiindex
 create mode 100644 tests/data/acpi/aarch64/virt/DSDT.viot
Signature · 1 line
2.49.0