aboutsummaryrefslogtreecommitdiff
path: root/hw/intc
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2018-12-11 23:38:15 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2018-12-21 09:39:13 +1100
commit1a937ad7e7a1b4eef37c967cbaeeda5ec5b90855 (patch)
tree161ed49c070a281d4f38e698bcde246fe44191c9 /hw/intc
parent6e21de4a50fa1caf163e12a6c90424b750119f96 (diff)
downloadqemu-1a937ad7e7a1b4eef37c967cbaeeda5ec5b90855.zip
qemu-1a937ad7e7a1b4eef37c967cbaeeda5ec5b90855.tar.gz
qemu-1a937ad7e7a1b4eef37c967cbaeeda5ec5b90855.tar.bz2
spapr: allocate the interrupt thread context under the CPU core
Each interrupt mode has its own specific interrupt presenter object, that we store under the CPU object, one for XICS and one for XIVE. Extend the sPAPR IRQ backend with a new handler to support them both. Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/intc')
-rw-r--r--hw/intc/xive.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/hw/intc/xive.c b/hw/intc/xive.c
index 607e74a..ea33494 100644
--- a/hw/intc/xive.c
+++ b/hw/intc/xive.c
@@ -528,6 +528,28 @@ static const TypeInfo xive_tctx_info = {
.class_init = xive_tctx_class_init,
};
+Object *xive_tctx_create(Object *cpu, XiveRouter *xrtr, Error **errp)
+{
+ Error *local_err = NULL;
+ Object *obj;
+
+ obj = object_new(TYPE_XIVE_TCTX);
+ object_property_add_child(cpu, TYPE_XIVE_TCTX, obj, &error_abort);
+ object_unref(obj);
+ object_property_add_const_link(obj, "cpu", cpu, &error_abort);
+ object_property_set_bool(obj, true, "realized", &local_err);
+ if (local_err) {
+ goto error;
+ }
+
+ return obj;
+
+error:
+ object_unparent(obj);
+ error_propagate(errp, local_err);
+ return NULL;
+}
+
/*
* XIVE ESB helpers
*/