[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 3/3] sPAPR: Reenable EEH functionality on reboot
From: |
Gavin Shan |
Subject: |
[Qemu-ppc] [PATCH 3/3] sPAPR: Reenable EEH functionality on reboot |
Date: |
Wed, 11 Mar 2015 17:11:54 +1100 |
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 <address@hidden>
---
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
- [Qemu-ppc] [PATCH 1/3] VFIO: Clear stale MSIx table during EEH reset, Gavin Shan, 2015/03/11
- [Qemu-ppc] [PATCH 3/3] sPAPR: Reenable EEH functionality on reboot,
Gavin Shan <=
- [Qemu-ppc] [PATCH 2/3] VFIO: Clear INTx pending state on EEH reset, Gavin Shan, 2015/03/11
- Re: [Qemu-ppc] [PATCH 2/3] VFIO: Clear INTx pending state on EEH reset, David Gibson, 2015/03/11
- Re: [Qemu-ppc] [PATCH 2/3] VFIO: Clear INTx pending state on EEH reset, Alex Williamson, 2015/03/13
- Re: [Qemu-ppc] [PATCH 2/3] VFIO: Clear INTx pending state on EEH reset, Gavin Shan, 2015/03/15
- Re: [Qemu-ppc] [PATCH 2/3] VFIO: Clear INTx pending state on EEH reset, Benjamin Herrenschmidt, 2015/03/16
- Re: [Qemu-ppc] [PATCH 2/3] VFIO: Clear INTx pending state on EEH reset, Gavin Shan, 2015/03/16
- Re: [Qemu-ppc] [PATCH 2/3] VFIO: Clear INTx pending state on EEH reset, Alex Williamson, 2015/03/16
- Re: [Qemu-ppc] [PATCH 2/3] VFIO: Clear INTx pending state on EEH reset, Gavin Shan, 2015/03/16
Re: [Qemu-ppc] [PATCH 1/3] VFIO: Clear stale MSIx table during EEH reset, David Gibson, 2015/03/11