aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2019-02-15 16:50:40 +1100
committerDavid Gibson <david@gibson.dropbear.id.au>2019-06-12 10:41:49 +1000
commitcb600087060897ca73d231f3edbe7f70ae3ce67f (patch)
tree6a2f3d0d8914eb20387dd82977029ca23724eba7
parent05929a6c5dfe1028ef66250b7bbf11939f8e77cd (diff)
downloadqemu-cb600087060897ca73d231f3edbe7f70ae3ce67f.zip
qemu-cb600087060897ca73d231f3edbe7f70ae3ce67f.tar.gz
qemu-cb600087060897ca73d231f3edbe7f70ae3ce67f.tar.bz2
spapr: Direct all PCI hotplug to host bridge, rather than P2P bridge
A P2P bridge will attempt to handle the hotplug with SHPC, which doesn't work in the PAPR environment. Instead we want to direct all PCI hotplug actions to the PAPR specific host bridge which will use the PAPR hotplug mechanism. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Acked-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--hw/ppc/spapr.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 507fd50..6dd8aaa 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4094,6 +4094,17 @@ static HotplugHandler *spapr_get_hotplug_handler(MachineState *machine,
object_dynamic_cast(OBJECT(dev), TYPE_SPAPR_PCI_HOST_BRIDGE)) {
return HOTPLUG_HANDLER(machine);
}
+ if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) {
+ PCIDevice *pcidev = PCI_DEVICE(dev);
+ PCIBus *root = pci_device_root_bus(pcidev);
+ SpaprPhbState *phb =
+ (SpaprPhbState *)object_dynamic_cast(OBJECT(BUS(root)->parent),
+ TYPE_SPAPR_PCI_HOST_BRIDGE);
+
+ if (phb) {
+ return HOTPLUG_HANDLER(phb);
+ }
+ }
return NULL;
}