From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, Gavin Shan <gwshan@linux.vnet.ibm.com>,
david@gibson.dropbear.id.au
Subject: [Qemu-devel] [PATCH 2/2] sPAPR: Enable EEH on VFIO PCI device only
Date: Fri, 18 Sep 2015 17:30:44 +1000 [thread overview]
Message-ID: <1442561444-31787-2-git-send-email-gwshan@linux.vnet.ibm.com> (raw)
In-Reply-To: <1442561444-31787-1-git-send-email-gwshan@linux.vnet.ibm.com>
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>
---
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
next prev parent reply other threads:[~2015-09-18 7:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-18 7:30 [Qemu-devel] [PATCH 1/2] sPAPR: Revert don't enable EEH on emulated PCI devices Gavin Shan
2015-09-18 7:30 ` Gavin Shan [this message]
2015-09-18 7:43 ` [Qemu-devel] [PATCH 2/2] sPAPR: Enable EEH on VFIO PCI device only David Gibson
2015-09-18 7:42 ` [Qemu-devel] [PATCH 1/2] sPAPR: Revert don't enable EEH on emulated PCI devices David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1442561444-31787-2-git-send-email-gwshan@linux.vnet.ibm.com \
--to=gwshan@linux.vnet.ibm.com \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).