aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc/spapr_pci_vfio.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2016-02-29 17:19:42 +1100
committerDavid Gibson <david@gibson.dropbear.id.au>2016-03-16 09:55:11 +1100
commitc1fa017c7e9b017ec0a75f8added7f9c4864fe8a (patch)
tree90110a0e12acc9b90b0d4961640e24cb588a9181 /hw/ppc/spapr_pci_vfio.c
parentfbb4e983415dc5a15e167dd00bc4564c57121915 (diff)
spapr_pci: Allow EEH on spapr-pci-host-bridge
Now that the EEH code is independent of the special spapr-vfio-pci-host-bridge device, we can allow it on all spapr PCI host bridges instead. We do this by changing spapr_phb_eeh_available() to be based on the vfio_eeh_as_ok() call instead of the host bridge class. Because the value of vfio_eeh_as_ok() can change with devices being hotplugged or unplugged, this can potentially lead to some strange edge cases where the guest starts using EEH, then it starts failing because of a change in status. However, it's not really any worse than the current situation. Cases that would have worked previously will still work (i.e. VFIO devices from at most one VFIO IOMMU group per vPHB), it's just that it's no longer necessary to use spapr-vfio-pci-host-bridge with the groupid pre-specified. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'hw/ppc/spapr_pci_vfio.c')
-rw-r--r--hw/ppc/spapr_pci_vfio.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c
index 10fa88a919..16a4a8f5e0 100644
--- a/hw/ppc/spapr_pci_vfio.c
+++ b/hw/ppc/spapr_pci_vfio.c
@@ -73,6 +73,11 @@ static void spapr_phb_vfio_finish_realize(sPAPRPHBState *sphb, Error **errp)
spapr_tce_get_iommu(tcet));
}
+bool spapr_phb_eeh_available(sPAPRPHBState *sphb)
+{
+ return vfio_eeh_as_ok(&sphb->iommu_as);
+}
+
static void spapr_phb_vfio_eeh_reenable(sPAPRPHBState *sphb)
{
vfio_eeh_as_op(&sphb->iommu_as, VFIO_EEH_PE_ENABLE);
@@ -240,7 +245,6 @@ static void spapr_phb_vfio_class_init(ObjectClass *klass, void *data)
dc->props = spapr_phb_vfio_properties;
spc->finish_realize = spapr_phb_vfio_finish_realize;
- spc->eeh_available = true;
}
static const TypeInfo spapr_phb_vfio_info = {