PAPR has its own PCI hotplug mechanism which we implemented quite a while ago. However, we weren't able to hotplug devices under PCI bridges, because the pci-bridge code would try to handle the hotplug using SHPC which won't work with PAPR.
We now have the infrastructure in the hotplug core to have the machine take control of the hotplug before the bus tries to claim it, which lets us address this. While we're about it, make a bunch of cleanups and also allow hot plug of P2P bridges themselves (this turns out to be quite straightforward once the rest is in place). For now, we don't support hot unplug of bridges - this seems to cause problems, at least for a Linux guest. I suspect the problem is on the guest side, but for now just prohibit until we have time to investigate properly. Changes since v1: * Added proper cover letter * Addressed some minor comments David Gibson (8): spapr: Clean up device node name generation for PCI devices spapr: Clean up device tree construction for PCI devices spapr: Clean up dt creation for PCI buses spapr: Clean up spapr_drc_populate_dt() spapr: Clean up DRC index construction spapr: Don't use bus number for building DRC ids spapr: Direct all PCI hotplug to host bridge, rather than P2P bridge spapr: Allow hot plug/unplug of PCI bridges and devices under PCI bridges hw/ppc/spapr.c | 25 +- hw/ppc/spapr_drc.c | 13 +- hw/ppc/spapr_pci.c | 486 ++++++++++++++++++++++-------------- include/hw/pci-host/spapr.h | 4 +- include/hw/ppc/spapr_drc.h | 3 +- 5 files changed, 327 insertions(+), 204 deletions(-) -- 2.21.0