summary refs log tree commit diff stats
path: root/hw/ppc
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2019-11-15 16:56:05 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2019-12-17 10:39:47 +1100
commit7ae54cc3a00d28cfb0bc4f377faf157b2e55b25c (patch)
tree75e61e459df413a5ebf0b99b03b2d51e963bc805 /hw/ppc
parent158e17a65e1ad0f2bd1e300c2f30f9481901a485 (diff)
downloadfocaccia-qemu-7ae54cc3a00d28cfb0bc4f377faf157b2e55b25c.tar.gz
focaccia-qemu-7ae54cc3a00d28cfb0bc4f377faf157b2e55b25c.zip
ppc/pnv: Link "chip" property to PnvXive::chip pointer
The XIVE object has both a pointer and a "chip" property pointing to the
chip object. Confusing bugs could arise if these ever go out of sync.

Change the property definition so that it explicitely sets the pointer.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <157383336564.165747.10250365296928442882.stgit@bahia.lan>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc')
-rw-r--r--hw/ppc/pnv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 2bf8a3b23b..a2a8b97330 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -1091,8 +1091,6 @@ static void pnv_chip_power9_instance_init(Object *obj)
 
     object_initialize_child(obj, "xive", &chip9->xive, sizeof(chip9->xive),
                             TYPE_PNV_XIVE, &error_abort, NULL);
-    object_property_add_const_link(OBJECT(&chip9->xive), "chip", obj,
-                                   &error_abort);
 
     object_initialize_child(obj, "psi",  &chip9->psi, sizeof(chip9->psi),
                             TYPE_PNV9_PSI, &error_abort, NULL);
@@ -1172,6 +1170,8 @@ static void pnv_chip_power9_realize(DeviceState *dev, Error **errp)
                             "pc-bar", &error_fatal);
     object_property_set_int(OBJECT(&chip9->xive), PNV9_XIVE_TM_BASE(chip),
                             "tm-bar", &error_fatal);
+    object_property_set_link(OBJECT(&chip9->xive), OBJECT(chip), "chip",
+                             &error_abort);
     object_property_set_bool(OBJECT(&chip9->xive), true, "realized",
                              &local_err);
     if (local_err) {