Received: from eggs.gnu.org ([2001:4830:134:3::10]:43310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zcq9C-00029u-Bb for qemu-devel@nongnu.org; Fri, 18 Sep 2015 03:31:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zcq99-0003eh-2u for qemu-devel@nongnu.org; Fri, 18 Sep 2015 03:31:54 -0400 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:44974) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zcq98-0003dd-EB for qemu-devel@nongnu.org; Fri, 18 Sep 2015 03:31:51 -0400 Received: from /spool/local by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 18 Sep 2015 17:31:47 +1000 From: Gavin Shan Date: Fri, 18 Sep 2015 17:30:44 +1000 Message-Id: <1442561444-31787-2-git-send-email-gwshan@linux.vnet.ibm.com> In-Reply-To: <1442561444-31787-1-git-send-email-gwshan@linux.vnet.ibm.com> References: <1442561444-31787-1-git-send-email-gwshan@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 2/2] sPAPR: Enable EEH on VFIO PCI device only List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Gavin Shan , david@gibson.dropbear.id.au 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 --- hw/ppc/spapr_pci_vfio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c index a99c7b3..b20e6e9 100644 --- a/hw/ppc/spapr_pci_vfio.c +++ b/hw/ppc/spapr_pci_vfio.c @@ -131,7 +131,7 @@ 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; } -- 2.1.0