ppc/xics: assign of the CPU 'intc' pointer under the core
authorCédric Le Goater <clg@kaod.org>
Fri, 1 Dec 2017 16:06:01 +0000 (17:06 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 14 Dec 2017 22:49:24 +0000 (09:49 +1100)
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: Cédric Le Goater <clg@kaod.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/intc/xics.c
hw/ppc/pnv_core.c
hw/ppc/spapr_cpu_core.c

index bfc6b5bb23675bc2514e34e39c5c53c990012f42..700f6baa1395bda72d4bb2ff1db54717f40af281 100644 (file)
@@ -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;
index 8d966e080288609329ee7e87be6ecdc9a002c505..03317db853d51ac9fb53838e9ffb78a519707a51 100644 (file)
@@ -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;
index 70e757f808c7f6eeb2a4caa193eb305f0ad57b7c..032438b9ce704f1eaba77c5d8b05521f69e6d6f2 100644 (file)
@@ -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;
     }