From: Gavin Shan Date: Fri, 18 Sep 2015 07:30:44 +0000 (+1000) Subject: sPAPR: Enable EEH on VFIO PCI device only X-Git-Tag: TizenStudio_2.0_p2.3.2~120^2~1^2~170^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d76548a98f4e18d3c65a3d921bbb70caf9be6138;p=sdk%2Femulator%2Fqemu.git 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 Signed-off-by: David Gibson --- diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c index cca45ed..a61b418 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; }