From: "Cédric Le Goater" <clg@kaod.org>
To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
David Gibson <david@gibson.dropbear.id.au>,
Greg Kurz <groug@kaod.org>
Cc: "Cédric Le Goater" <clg@kaod.org>
Subject: [Qemu-devel] [PATCH 2/5] ppc/xics: assign of the CPU 'intc' pointer under the core
Date: Fri, 1 Dec 2017 17:06:01 +0100 [thread overview]
Message-ID: <20171201160604.15265-3-clg@kaod.org> (raw)
In-Reply-To: <20171201160604.15265-1-clg@kaod.org>
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>
---
hw/intc/xics.c | 1 -
hw/ppc/pnv_core.c | 2 +-
hw/ppc/spapr_cpu_core.c | 3 ++-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index bfc6b5bb2367..700f6baa1395 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -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;
diff --git a/hw/ppc/pnv_core.c b/hw/ppc/pnv_core.c
index 8d966e080288..03317db853d5 100644
--- a/hw/ppc/pnv_core.c
+++ b/hw/ppc/pnv_core.c
@@ -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;
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 70e757f808c7..032438b9ce70 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -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;
}
--
2.13.6
next prev parent reply other threads:[~2017-12-01 16:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-01 16:05 [Qemu-devel] [PATCH 0/5] spapr: preliminary cleanups before introducing XIVE Cédric Le Goater
2017-12-01 16:06 ` [Qemu-devel] [PATCH 1/5] ppc/xics: introduce an icp_create() helper Cédric Le Goater
2017-12-01 16:06 ` Cédric Le Goater [this message]
2017-12-01 16:06 ` [Qemu-devel] [PATCH 3/5] spapr: move the IRQ allocation routines under the machine Cédric Le Goater
2017-12-01 16:06 ` [Qemu-devel] [PATCH 4/5] spapr: introduce a spapr_irq_set_lsi() helper Cédric Le Goater
2017-12-01 16:06 ` [Qemu-devel] [PATCH 5/5] spapr: introduce a spapr_qirq() helper Cédric Le Goater
2017-12-02 1:33 ` [Qemu-devel] [PATCH 0/5] spapr: preliminary cleanups before introducing XIVE David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171201160604.15265-3-clg@kaod.org \
--to=clg@kaod.org \
--cc=david@gibson.dropbear.id.au \
--cc=groug@kaod.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).