Skip to content

RFC spapr: add support for PHB hotplug

Michael Roth qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest15 patches 30 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15pci: allow cleanup/unregistration of PCI buseshw/pci/pci.c include/hw/pci/pci.h+36 -01 reply
2/15qdev: store DeviceState's canonical path to use when unparentinghw/core/qdev.c include/hw/qdev-core.h+13 -37 replies
3/15spapr_drc: pass object ownership to parent/ownerhw/ppc/spapr_drc.c+1 -02 replies
4/15spapr_iommu: pass object ownership to parent/ownerhw/ppc/spapr_iommu.c+1 -02 replies
5/15spapr_pci: add PHB unrealizehw/ppc/spapr_pci.c+32 -03 replies
6/15spapr_pci: also use 'index' property as DRC index for PHBshw/ppc/spapr_pci.c+16 -22 replies
7/15spapr: enable PHB hotplug for pseries-2.4hw/ppc/spapr.c include/hw/ppc/spapr.h+25 -01 reply
8/15spapr: create DR connectors for PHBs and register reset hookshw/ppc/spapr.c+28 -03 replies
9/15spapr: populate PHB DRC entries for root DT nodehw/ppc/spapr.c+9 -01 reply
10/15spapr_events: add support for phb hotplug eventshw/ppc/spapr_events.c+5 -01 reply
11/15qdev: add qbus_set_hotplug_handler_generic()hw/core/qdev.c include/hw/qdev-core.h+6 -52 replies
12/15spapr: stub implementation of machine-level HotplugHandler interfacehw/ppc/spapr.c+24 -00 replies
13/15spapr_pci: provide node start offset via spapr_populate_pci_dt()hw/ppc/spapr.c hw/ppc/spapr_pci.c include/hw/pci-host/spapr.h+8 -31 reply
14/15spapr_pci: add ibm, my-drc-index property for PHB hotplughw/ppc/spapr_pci.c+10 -01 reply
15/15spapr: add hotplug hooks for PHB hotplughw/ppc/spapr.c+96 -01 reply

Reviews trailers per patch

9 of 15 patches have a Reviewed-by or Acked-by.

PatchPaolo BonziniDavid Gibson
1/15R-b
2/15
3/15R-b R-b
4/15R-b R-b
5/15
6/15
7/15
8/15R-b
9/15R-b
10/15R-b
11/15
12/15
13/15R-b
14/15R-b
15/15R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [RFC PATCH 00/15] spapr: add support for PHB hotplug

These patches are based on latest spapr-hotplug-pci patches, and can also be obtained from:

https://github.com/mdroth/qemu/commits/spapr-hotplug-phb

These patches implement support for hotplug/unplug of PCI host-bridges. The main use cases are:

- allowing for VFIO PCI hotplug for host kernels that still require a 1:1 mapping between guest PHB/TCE table and an iommu group (a requirement that will be relaxed with Alexey Kardashevskiy's VFIO rework for DDW support)
- allocating new PHBs/TCE tables for hotplugging/distributing VFIO devices that have different NUMA affinities associated with them for performance reason
- expanding hotplug capacity for passthrough/emulated PCI devices

With these patches we support the following:

(qemu) device_add spapr-pci-host-bridge,index=2,id=phb2 (qemu) device_add virtio-net-pci,id=hp2.0,bus=phb2.0 (qemu) device_del hp2.0
(qemu) device_del phb2

Automatic add/remove of PHBs based on EPOW event mechanism require updated versions of powerpc-utils, rtas_errd, and librtas. Patches are forthcoming and will be available in future versions, but for now we can add them manually by executing the following in the guest after/before hotplug/unplug, respectively:

  # add PHB
  drmgr -c PHB -s "PHB 2" -a -n
  # remove PHB
  drmgr -c PHB -s "PHB 2" -r -n

Feedback/comments are very much appreciated.

 hw/core/qdev.c              |  24 ++++++++++++------
 hw/pci/pci.c                |  33 +++++++++++++++++++++++++
 hw/ppc/spapr.c              | 183 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 hw/ppc/spapr_drc.c          |   1 +
 hw/ppc/spapr_events.c       |   5 ++++
 hw/ppc/spapr_iommu.c        |   1 +
 hw/ppc/spapr_pci.c          |  66 ++++++++++++++++++++++++++++++++++++++++++++++---
 include/hw/pci-host/spapr.h |   3 ++-
 include/hw/pci/pci.h        |   3 +++
 include/hw/ppc/spapr.h      |   1 +
 include/hw/qdev-core.h      |   3 +++
 11 files changed, 310 insertions(+), 13 deletions(-)