Commit ed0c37ee authored by Cédric Le Goater's avatar Cédric Le Goater Committed by David Gibson
Browse files

ppc/xics: assign of the CPU 'intc' pointer under the core



The 'intc' pointer of the CPU references the interrupt presenter in
the XICS interrupt mode. When the XIVE interrupt mode is available and
activated, the machine will need to reassign this pointer to reflect
the change.

Moving this assignment under the realize routine of the CPU will ease
the process when the interrupt mode is toggled.

Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
Reviewed-by: default avatarGreg Kurz <groug@kaod.org>
Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent 4f7a47be
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -334,7 +334,6 @@ static void icp_realize(DeviceState *dev, Error **errp)
    }

    cpu = POWERPC_CPU(obj);
    cpu->intc = OBJECT(icp);
    icp->cs = CPU(obj);

    env = &cpu->env;
+1 −1
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ static void pnv_core_realize_child(Object *child, XICSFabric *xi, Error **errp)
        return;
    }

    icp_create(child, TYPE_PNV_ICP, xi, &local_err);
    cpu->intc = icp_create(child, TYPE_PNV_ICP, xi, &local_err);
    if (local_err) {
        error_propagate(errp, local_err);
        return;
+2 −1
Original line number Diff line number Diff line
@@ -121,7 +121,8 @@ static void spapr_cpu_core_realize_child(Object *child,
        goto error;
    }

    icp_create(child, spapr->icp_type, XICS_FABRIC(spapr), &local_err);
    cpu->intc = icp_create(child, spapr->icp_type, XICS_FABRIC(spapr),
                           &local_err);
    if (local_err) {
        goto error;
    }