sPAPR: Revert don't enable EEH on emulated PCI devices
PATCH 1/2 sPAPR: Revert don't enable EEH on emulated PCI devices
This reverts commit 7cb18007 ("sPAPR: Don't enable EEH on emulated PCI devices") as rtas_ibm_set_eeh_option() isn't the right place to check if there has the corresponding PCI device for the input address, which can be PE address, not PCI device address.
--- hw/ppc/spapr_pci.c | 7 ------- 1 file changed, 7 deletions(-)
hw/ppc/spapr_pci.c +0 -7
@@ -431,7 +431,6 @@ static void rtas_ibm_set_eeh_option(PowerPCCPU *cpu, target_ulong rets) {sPAPRPHBState *sphb; -PCIDevice *pdev;uint32_t addr, option;uint64_t buid;int ret;
@@ -449,12 +448,6 @@ static void rtas_ibm_set_eeh_option(PowerPCCPU *cpu, goto param_error_exit; } - pdev =pci_find_device (PCI_HOST_BRIDGE (sphb)->bus, - (addr >>16 ) &0xFF , (addr >>8 ) &0xFF ); -if (!pdev || !object_dynamic_cast (OBJECT (pdev),"vfio-pci" )) { - goto param_error_exit; - } - ret =spapr_phb_vfio_eeh_set_option (sphb, addr, option);rtas_st (rets,0 , ret);return ;
Signature · 1 line
2.1.0
PATCH 2/2 sPAPR: Enable EEH on VFIO PCI device only
This checks if the PCI device retrieved from the PCI device address is VFIO PCI device when enabling EEH functionality. If it's not VFIO PCI device, the EEH functonality isn't enabled.
--- hw/ppc/spapr_pci_vfio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/spapr_pci_vfio.c +1 -1
@@ -131,7 +131,7 @@ int spapr_phb_vfio_eeh_set_option(sPAPRPHBState *sphb, phb =PCI_HOST_BRIDGE (sphb); pdev =pci_find_device (phb->bus, (addr >>16 ) &0xFF , (addr >>8 ) &0xFF ); -if (!pdev) { +if (!pdev || !object_dynamic_cast (OBJECT (pdev),"vfio-pci" )) {return RTAS_OUT_PARAM_ERROR ; }
Signature · 1 line
2.1.0
David Gibson
AppliedRe: [Qemu-devel] [PATCH 2/2] sPAPR: Enable EEH on VFIO PCI device only
Quoted 5 lines · Gavin Shan
This checks if the PCI device retrieved from the PCI device address is VFIO PCI device when enabling EEH functionality. If it's not VFIO PCI device, the EEH functonality isn't enabled.
Signed-off-by Gavin Shan <[email protected]>
Applied to spapr-dev, thanks.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
David Gibson
AppliedQuoted 6 lines · Gavin Shan
This reverts commit
7cb18007("sPAPR: Don't enable EEH on emulated PCI devices") asrtas_ibm_set_eeh_option()isn't the right place to check if there has the corresponding PCI device for the input address, which can be PE address, not PCI device address.Signed-off-by Gavin Shan <[email protected]>
Applied to spapr-dev, thanks. I've altered it slightly because I haven't yet applied your other EEH rework patches.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson