[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 26/27] sPAPR: Reenable EEH functionality on reboot
From: |
David Gibson |
Subject: |
[Qemu-ppc] [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-ppc] [PATCH 16/27] spapr: Reorganize CPU dt generation code, (continued)
- [Qemu-ppc] [PATCH 16/27] spapr: Reorganize CPU dt generation code, David Gibson, 2015/07/02
- [Qemu-ppc] [PATCH 26/27] sPAPR: Reenable EEH functionality on reboot, David Gibson, 2015/07/02
- [Qemu-ppc] [PATCH 03/27] spapr: Merge sPAPREnvironment into sPAPRMachineState, David Gibson, 2015/07/02
- [Qemu-ppc] [PATCH 02/27] pseries: Update SLOF firmware image to qemu-slof-20150429, David Gibson, 2015/07/02
- [Qemu-ppc] [PATCH 00/27] sPAPR updates 2015-07-02, David Gibson, 2015/07/02
- [Qemu-ppc] [PATCH 01/27] spapr: ensure we have at least one XICS server, David Gibson, 2015/07/02
- [Qemu-ppc] [PATCH 07/27] spapr_pci: encode missing 64-bit memory address space, David Gibson, 2015/07/02
- [Qemu-ppc] [PATCH 04/27] spapr: Remove obsolete ram_limit field from sPAPRMachineState, David Gibson, 2015/07/02
- [Qemu-ppc] [PATCH 06/27] spapr: Add sPAPRMachineClass, David Gibson, 2015/07/02
- [Qemu-ppc] [PATCH 09/27] spapr_pci: set device node unit address as hex, David Gibson, 2015/07/02
- [Qemu-ppc] [PATCH 26/27] sPAPR: Reenable EEH functionality on reboot,
David Gibson <=
- [Qemu-ppc] [PATCH 25/27] sPAPR: Don't enable EEH on emulated PCI devices, David Gibson, 2015/07/02
- [Qemu-ppc] [PATCH 17/27] spapr: Consolidate cpu init code into a routine, David Gibson, 2015/07/02
- [Qemu-ppc] [PATCH 13/27] spapr: Consider max_cpus during xics initialization, David Gibson, 2015/07/02
- [Qemu-ppc] [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-ppc] [PATCH 23/27] spapr_vty: lookup should only return valid VTY objects, David Gibson, 2015/07/02
- [Qemu-ppc] [PATCH 15/27] cpus: Add a macro to walk CPUs in reverse, David Gibson, 2015/07/02
- [Qemu-ppc] [PATCH 22/27] spapr_pci: drop redundant args in spapr_[populate, create]_pci_child_dt, David Gibson, 2015/07/02
- [Qemu-ppc] [PATCH 05/27] spapr: Remove obsolete entry_point field from sPAPRMachineState, David Gibson, 2015/07/02
- [Qemu-ppc] [PATCH 10/27] spapr_iommu: drop erroneous check in h_put_tce_indirect(), David Gibson, 2015/07/02
- [Qemu-ppc] [PATCH 19/27] xics_kvm: Don't enable KVM_CAP_IRQ_XICS if already enabled, David Gibson, 2015/07/02