[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 26/27] sPAPR: Reenable EEH functionality on reboot
From: |
David Gibson |
Subject: |
[Qemu-devel] [PATCH 26/27] sPAPR: Reenable EEH functionality on reboot |
Date: |
Thu, 2 Jul 2015 16:23:27 +1000 |
From: Gavin Shan <address@hidden>
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>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr_pci_vfio.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c
index 99a1be5..8104074 100644
--- a/hw/ppc/spapr_pci_vfio.c
+++ b/hw/ppc/spapr_pci_vfio.c
@@ -71,9 +71,26 @@ static void spapr_phb_vfio_finish_realize(sPAPRPHBState
*sphb, Error **errp)
spapr_tce_get_iommu(tcet));
}
+static void spapr_phb_vfio_eeh_reenable(sPAPRPHBVFIOState *svphb)
+{
+ 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 void spapr_phb_vfio_reset(DeviceState *qdev)
{
- /* Do nothing */
+ /*
+ * The PE might be in frozen state. To reenable the EEH
+ * functionality on it will clean the frozen state, which
+ * ensures that the contained PCI devices will work properly
+ * after reboot.
+ */
+ spapr_phb_vfio_eeh_reenable(SPAPR_PCI_VFIO_HOST_BRIDGE(qdev));
}
static int spapr_phb_vfio_eeh_set_option(sPAPRPHBState *sphb,
--
2.4.3
- [Qemu-devel] [PATCH 08/27] spapr_pci: encode class code including Prog IF register, (continued)
- [Qemu-devel] [PATCH 08/27] spapr_pci: encode class code including Prog IF register, David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 13/27] spapr: Consider max_cpus during xics initialization, David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 09/27] spapr_pci: set device node unit address as hex, David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 15/27] cpus: Add a macro to walk CPUs in reverse, David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 10/27] spapr_iommu: drop erroneous check in h_put_tce_indirect(), David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 12/27] Revert "hw/ppc/spapr_pci.c: Avoid functions not in glib 2.12 (g_hash_table_iter_*)", David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 11/27] spapr_iommu: translate sPAPRTCEAccess to IOMMUAccessFlags, David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 23/27] spapr_vty: lookup should only return valid VTY objects, David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 14/27] spapr: Support ibm, lrdr-capacity device tree property, David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 17/27] spapr: Consolidate cpu init code into a routine, David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 26/27] sPAPR: Reenable EEH functionality on reboot,
David Gibson <=
- [Qemu-devel] [PATCH 25/27] sPAPR: Don't enable EEH on emulated PCI devices, David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 21/27] spapr_pci: populate ibm,loc-code, David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 22/27] spapr_pci: drop redundant args in spapr_[populate, create]_pci_child_dt, David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 18/27] ppc: Update cpu_model in MachineState, David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 27/27] sPAPR: Clear stale MSIx table during EEH reset, David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 20/27] spapr_pci: enumerate and add PCI device tree, David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 19/27] xics_kvm: Don't enable KVM_CAP_IRQ_XICS if already enabled, David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 24/27] spapr-vty: Use TYPE_ definition instead of hardcoding, David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 16/27] spapr: Reorganize CPU dt generation code, David Gibson, 2015/07/02
- [Qemu-devel] [PATCH 03/27] spapr: Merge sPAPREnvironment into sPAPRMachineState, David Gibson, 2015/07/02