From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: qemu-ppc@nongnu.org
Cc: alex.williamson@redhat.com, qemu-devel@nongnu.org,
Gavin Shan <gwshan@linux.vnet.ibm.com>,
david@gibson.dropbear.id.au
Subject: [Qemu-devel] [PATCH v4 1/3] sPAPR: Don't enable EEH on emulated PCI devices
Date: Thu, 2 Jul 2015 10:30:10 +1000 [thread overview]
Message-ID: <1435797012-6069-2-git-send-email-gwshan@linux.vnet.ibm.com> (raw)
In-Reply-To: <1435797012-6069-1-git-send-email-gwshan@linux.vnet.ibm.com>
There might have emulated PCI devices, together with VFIO PCI
devices under one PHB. The EEH capability shouldn't enabled
on emulated PCI devices.
The patch returns error when enabling EEH capability on emulated
PCI devices by RTAS call "ibm,set-eeh-option".
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
hw/ppc/spapr_pci.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index a139aea..a8f79d8 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -429,6 +429,7 @@ static void rtas_ibm_set_eeh_option(PowerPCCPU *cpu,
{
sPAPRPHBState *sphb;
sPAPRPHBClass *spc;
+ PCIDevice *pdev;
uint32_t addr, option;
uint64_t buid;
int ret;
@@ -446,6 +447,12 @@ static void rtas_ibm_set_eeh_option(PowerPCCPU *cpu,
goto param_error_exit;
}
+ pdev = pci_find_device(PCI_HOST_BRIDGE(sphb)->bus,
+ (addr >> 16) & 0xFF, (addr >> 8) & 0xFF);
+ if (!pdev || !object_dynamic_cast(OBJECT(pdev), "vfio-pci")) {
+ goto param_error_exit;
+ }
+
spc = SPAPR_PCI_HOST_BRIDGE_GET_CLASS(sphb);
if (!spc->eeh_set_option) {
goto param_error_exit;
--
2.1.0
next prev parent reply other threads:[~2015-07-02 0:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-02 0:30 [Qemu-devel] [PATCH v4 0/3] sPAPR: EEH fixes Gavin Shan
2015-07-02 0:30 ` Gavin Shan [this message]
2015-07-02 0:30 ` [Qemu-devel] [PATCH v4 2/3] sPAPR: Reenable EEH functionality on reboot Gavin Shan
2015-07-02 0:30 ` [Qemu-devel] [PATCH v4 3/3] sPAPR: Clear stale MSIx table during EEH reset Gavin Shan
2015-07-02 5:58 ` [Qemu-devel] [PATCH v4 0/3] sPAPR: EEH fixes 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=1435797012-6069-2-git-send-email-gwshan@linux.vnet.ibm.com \
--to=gwshan@linux.vnet.ibm.com \
--cc=alex.williamson@redhat.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).