summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGavin Shan2015-09-18 09:30:44 +0200
committerDavid Gibson2015-09-23 02:51:11 +0200
commitd76548a98f4e18d3c65a3d921bbb70caf9be6138 (patch)
tree89e1d8b6a24c49a0c559c80d1512fff7799a8b4b
parentsPAPR: Revert don't enable EEH on emulated PCI devices (diff)
downloadqemu-d76548a98f4e18d3c65a3d921bbb70caf9be6138.tar.gz
qemu-d76548a98f4e18d3c65a3d921bbb70caf9be6138.tar.xz
qemu-d76548a98f4e18d3c65a3d921bbb70caf9be6138.zip
sPAPR: Enable EEH on VFIO PCI device only
This checks if the PCI device retrieved from the PCI device address is VFIO PCI device when enabling EEH functionality. If it's not VFIO PCI device, the EEH functonality isn't enabled. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--hw/ppc/spapr_pci_vfio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c
index cca45ed312..a61b418131 100644
--- a/hw/ppc/spapr_pci_vfio.c
+++ b/hw/ppc/spapr_pci_vfio.c
@@ -117,7 +117,7 @@ static int spapr_phb_vfio_eeh_set_option(sPAPRPHBState *sphb,
phb = PCI_HOST_BRIDGE(sphb);
pdev = pci_find_device(phb->bus,
(addr >> 16) & 0xFF, (addr >> 8) & 0xFF);
- if (!pdev) {
+ if (!pdev || !object_dynamic_cast(OBJECT(pdev), "vfio-pci")) {
return RTAS_OUT_PARAM_ERROR;
}