@@ -604,7 +604,7 @@ static void rtas_ibm_configure_pe(PowerPCCPU *cpu,
target_ulong rets)
{
sPAPRPHBState *sphb;
- sPAPRPHBClass *spc;
+ VFIOGroup *group;
uint64_t buid;
int ret;
@@ -618,13 +618,18 @@ static void rtas_ibm_configure_pe(PowerPCCPU *cpu,
goto param_error_exit;
}
- spc = SPAPR_PCI_HOST_BRIDGE_GET_CLASS(sphb);
- if (!spc->eeh_configure) {
+ ret = spapr_phb_check_vfio_group(sphb, &group);
+ if (ret != RTAS_OUT_SUCCESS) {
+ rtas_st(rets, 0, ret);
+ return;
+ }
+
+ ret = vfio_eeh_op(group, VFIO_EEH_PE_CONFIGURE);
+ if (ret < 0) {
goto param_error_exit;
}
- ret = spc->eeh_configure(sphb);
- rtas_st(rets, 0, ret);
+ rtas_st(rets, 0, RTAS_OUT_SUCCESS);
return;
param_error_exit:
@@ -264,24 +264,6 @@ static int spapr_phb_vfio_eeh_reset(sPAPRPHBState *sphb, int option)
return RTAS_OUT_SUCCESS;
}
-static int spapr_phb_vfio_eeh_configure(sPAPRPHBState *sphb)
-{
- VFIOGroup *group;
- int ret;
-
- ret = spapr_phb_check_vfio_group(sphb, &group);
- if (ret != RTAS_OUT_SUCCESS) {
- return ret;
- }
-
- ret = vfio_eeh_op(group, VFIO_EEH_PE_CONFIGURE);
- if (ret < 0) {
- return RTAS_OUT_PARAM_ERROR;
- }
-
- return RTAS_OUT_SUCCESS;
-}
-
static void spapr_phb_vfio_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -293,7 +275,6 @@ static void spapr_phb_vfio_class_init(ObjectClass *klass, void *data)
spc->eeh_set_option = spapr_phb_vfio_eeh_set_option;
spc->eeh_get_state = spapr_phb_vfio_eeh_get_state;
spc->eeh_reset = spapr_phb_vfio_eeh_reset;
- spc->eeh_configure = spapr_phb_vfio_eeh_configure;
}
static const TypeInfo spapr_phb_vfio_info = {
@@ -53,7 +53,6 @@ struct sPAPRPHBClass {
int (*eeh_set_option)(sPAPRPHBState *sphb, unsigned int addr, int option);
int (*eeh_get_state)(sPAPRPHBState *sphb, int *state);
int (*eeh_reset)(sPAPRPHBState *sphb, int option);
- int (*eeh_configure)(sPAPRPHBState *sphb);
};
typedef struct spapr_pci_msi {
Because spapr_phb_check_vfio_group() now safely returns an error on a non VFIO papr host bridge, it becomes safe to call spapr_phb_vfio_eeh_configure() on any host bridge, not just the special VFIO host bridges. So fold its code into rtas_ibm_configure_pe(), instead of only calling it via a class method. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> --- hw/ppc/spapr_pci.c | 15 ++++++++++----- hw/ppc/spapr_pci_vfio.c | 19 ------------------- include/hw/pci-host/spapr.h | 1 - 3 files changed, 10 insertions(+), 25 deletions(-)