Skip to content

pc: make ACPI pcihp more reusable

Igor Mammedov qemu-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 1 replyIn review
  2. v35 patches 1 replySuperseded
  3. v24 patches 4 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches4 repliesSuperseded

Changes in v4 from the cover letter

- keep "acpi-pci-hotplug-with-bridge-support" property
and pass its value to acpi_pcihp_init() to init internal
.legacy_piix field.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5pcihp: replace enable|disable_device() with onelinershw/acpi/pcihp.c+2 -120 replies
2/5pcihp: make PCI hotplug mmio handlers indifferent to PCI_HOTPLUG_ADDRhw/acpi/pcihp.c+12 -120 replies
3/5pcihp: make pci_read() mmio calback compatible with legacy ACPI hotplughw/acpi/pcihp.c hw/acpi/piix4.c include/hw/acpi/pcihp.h+9 -40 replies
4/5pcihp: remove unused AcpiPciHpPciStatus.device_present fieldinclude/hw/acpi/pcihp.h+0 -10 replies
5/5hw:piix4:acpi: reuse pcihp code for legacy PCI hotplughw/acpi/pcihp.c hw/acpi/piix4.c include/hw/acpi/pcihp.h+34 -2010 replies

Reviews trailers per patch

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

Read the v4 thread

Cover letter [Qemu-devel] [PATCH v4 0/5] pc: make ACPI pcihp more reusable

changes since v3:
- keep "acpi-pci-hotplug-with-bridge-support" property
and pass its value to acpi_pcihp_init() to init internal
.legacy_piix field.
changes since v2:
- rename 'use_acpi_pci_hotplug' field to 'legacy_piix'
and corresponding properties
- drop excessive checks for legacy mode
- rework legacy vmstate handling to use AcpiPciHpPciStatus[0] structure
which reduced acpi/piix4.c by another 50 LOC
- move legacy initialization to pcihp.c
changes since v1:
- add BSEL property to root bus when in compatibility mode
as result dropped "hw:acpi:pcihp: assume root PCI bus if bus has no ACPI_PCIHP_PROP_BSEL property"
- rebasing on top of "pcihp: reduce number of device check events"
added patch 3/4.

Reuses new pcihp code for handling legacy PCI hotplug in acpi/piix4_pm, which significantly reduces code duplication between piix4_pm and pcihp reducing codebase by ~200 LOC.

It also allows cleaner rebase of generic hotplug refactoring, by not increasing code duplication since it will need to be done only for pcihp.

Git tree for testing based on mst's PCI tree:
https://github.com/imammedo/qemu/commits/pcihp_cleanup_v4

Igor Mammedov (5):
pcihp: replace enable|disable_device() with oneliners
pcihp: make PCI hotplug mmio handlers indifferent to PCI_HOTPLUG_ADDR
pcihp: make pci_read() mmio calback compatible with legacy ACPI
hotplug
pcihp: remove unused AcpiPciHpPciStatus.device_present field hw:piix4:acpi: reuse pcihp code for legacy PCI hotplug

 hw/acpi/pcihp.c         |   68 ++++++++-------
 hw/acpi/piix4.c         |  210 ++++-------------------------------------------
 include/hw/acpi/pcihp.h |    5 +-
 3 files changed, 55 insertions(+), 228 deletions(-)