From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: aik@ozlabs.ru, agraf@suse.de,
Gavin Shan <gwshan@linux.vnet.ibm.com>,
alex.williamson@redhat.com, qemu-ppc@nongnu.org,
david@gibson.dropbear.id.au
Subject: [Qemu-devel] [PATCH v2 3/3] sPAPR: Reenable EEH functionality on reboot
Date: Tue, 17 Mar 2015 03:31:26 +1100 [thread overview]
Message-ID: <1426523486-9794-3-git-send-email-gwshan@linux.vnet.ibm.com> (raw)
In-Reply-To: <1426523486-9794-1-git-send-email-gwshan@linux.vnet.ibm.com>
When rebooting the guest, some PEs might be in frozen state. The
contained PCI devices won't work properly if their frozen states
aren't cleared in time. One case running into this situation would
be maximal EEH error times encountered in the guest.
The patch reenables the EEH functinality on PEs on PHB's reset
callback, which will clear their frozen states if needed.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
hw/ppc/spapr_pci_vfio.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c
index 99a1be5..0cd96d3 100644
--- a/hw/ppc/spapr_pci_vfio.c
+++ b/hw/ppc/spapr_pci_vfio.c
@@ -71,9 +71,21 @@ static void spapr_phb_vfio_finish_realize(sPAPRPHBState *sphb, Error **errp)
spapr_tce_get_iommu(tcet));
}
+/*
+ * The PE might be in frozen state. To reenable the EEH
+ * functionality on it will clean the frozen state, which
+ * ensures that the comtained PCI devices will work properly.
+ */
static void spapr_phb_vfio_reset(DeviceState *qdev)
{
- /* Do nothing */
+ sPAPRPHBVFIOState *svphb = SPAPR_PCI_VFIO_HOST_BRIDGE(qdev);
+ struct vfio_eeh_pe_op op = {
+ .argsz = sizeof(op),
+ .op = VFIO_EEH_PE_ENABLE,
+ };
+
+ vfio_container_ioctl(&svphb->phb.iommu_as,
+ svphb->iommugroupid, VFIO_EEH_PE_OP, &op);
}
static int spapr_phb_vfio_eeh_set_option(sPAPRPHBState *sphb,
--
1.8.3.2
next prev parent reply other threads:[~2015-03-16 16:31 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-16 16:31 [Qemu-devel] [PATCH v2 1/3] VFIO: Clear stale MSIx table during EEH reset Gavin Shan
2015-03-16 16:31 ` [Qemu-devel] [PATCH v2 2/3] VFIO: Disable INTx interrupt on " Gavin Shan
2015-03-17 21:16 ` Alex Williamson
2015-03-18 4:54 ` [Qemu-devel] [Qemu-ppc] " Gavin Shan
2015-03-20 4:01 ` Gavin Shan
2015-03-20 5:57 ` Gavin Shan
2015-03-16 16:31 ` Gavin Shan [this message]
2015-03-17 21:09 ` [Qemu-devel] [PATCH v2 1/3] VFIO: Clear stale MSIx table during " Alex Williamson
2015-03-17 23:26 ` Gavin Shan
2015-03-23 5:05 ` Gavin Shan
2015-03-20 6:04 ` David Gibson
2015-03-20 6:27 ` [Qemu-devel] [Qemu-ppc] " Gavin Shan
2015-03-23 5:06 ` David Gibson
2015-03-23 5:25 ` Gavin Shan
2015-03-24 5:41 ` David Gibson
2015-03-24 6:24 ` Gavin Shan
2015-03-24 6:54 ` David Gibson
2015-03-24 12:53 ` Alex Williamson
2015-03-26 0:53 ` Gavin Shan
2015-03-26 1:10 ` David Gibson
2015-03-26 1:30 ` Gavin Shan
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=1426523486-9794-3-git-send-email-gwshan@linux.vnet.ibm.com \
--to=gwshan@linux.vnet.ibm.com \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--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).