[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 29/30] sPAPR: Reenable EEH functionality on reboot
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PULL 29/30] sPAPR: Reenable EEH functionality on reboot |
Date: |
Tue, 7 Jul 2015 17:49:41 +0200 |
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>
Signed-off-by: Alexander Graf <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,
--
1.8.1.4
- [Qemu-ppc] [PULL 10/30] spapr_pci: encode missing 64-bit memory address space, (continued)
- [Qemu-ppc] [PULL 10/30] spapr_pci: encode missing 64-bit memory address space, Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 01/30] linux-user, ppc: mftbl can be used by user application, Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 03/30] target-ppc: fix hugepage support when using memory-backend-file, Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 14/30] spapr_iommu: translate sPAPRTCEAccess to IOMMUAccessFlags, Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 16/30] spapr: Consider max_cpus during xics initialization, Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 18/30] cpus: Add a macro to walk CPUs in reverse, Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 12/30] spapr_pci: set device node unit address as hex, Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 04/30] spapr: ensure we have at least one XICS server, Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 20/30] spapr: Consolidate cpu init code into a routine, Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 28/30] sPAPR: Don't enable EEH on emulated PCI devices, Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 29/30] sPAPR: Reenable EEH functionality on reboot,
Alexander Graf <=
- [Qemu-ppc] [PULL 13/30] spapr_iommu: drop erroneous check in h_put_tce_indirect(), Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 11/30] spapr_pci: encode class code including Prog IF register, Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 22/30] xics_kvm: Don't enable KVM_CAP_IRQ_XICS if already enabled, Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 30/30] sPAPR: Clear stale MSIx table during EEH reset, Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 08/30] spapr: Remove obsolete entry_point field from sPAPRMachineState, Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 26/30] spapr_vty: lookup should only return valid VTY objects, Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 07/30] spapr: Remove obsolete ram_limit field from sPAPRMachineState, Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 17/30] spapr: Support ibm, lrdr-capacity device tree property, Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 21/30] ppc: Update cpu_model in MachineState, Alexander Graf, 2015/07/07
- [Qemu-ppc] [PULL 23/30] spapr_pci: enumerate and add PCI device tree, Alexander Graf, 2015/07/07