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 4/5] spapr: introduce a spapr_irq_set_lsi() helper
Date: Fri, 1 Dec 2017 17:06:03 +0100 [thread overview]
Message-ID: <20171201160604.15265-5-clg@kaod.org> (raw)
In-Reply-To: <20171201160604.15265-1-clg@kaod.org>
It will make synchronisation easier with the XIVE interrupt mode when
available. The 'irq' parameter refers to the global IRQ number space.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
---
Changes since initial XIVE patchset:
- s/spapr_irq_set/spapr_irq_set_lsi/
hw/ppc/spapr.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index f6e72f686c34..5e4192aee8fe 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3579,6 +3579,14 @@ static int ics_find_free_block(ICSState *ics, int num, int alignnum)
return -1;
}
+/*
+ * Allocate the IRQ number and set the IRQ type, LSI or MSI
+ */
+static void spapr_irq_set_lsi(sPAPRMachineState *spapr, int irq, bool lsi)
+{
+ ics_set_irq_type(spapr->ics, irq - spapr->ics->offset, lsi);
+}
+
int spapr_irq_alloc(sPAPRMachineState *spapr, int irq_hint, bool lsi,
Error **errp)
{
@@ -3603,7 +3611,7 @@ int spapr_irq_alloc(sPAPRMachineState *spapr, int irq_hint, bool lsi,
irq += ics->offset;
}
- ics_set_irq_type(ics, irq - ics->offset, lsi);
+ spapr_irq_set_lsi(spapr, irq, lsi);
trace_spapr_irq_alloc(irq);
return irq;
@@ -3642,10 +3650,10 @@ int spapr_irq_alloc_block(sPAPRMachineState *spapr, int num, bool lsi,
return -1;
}
+ first += ics->offset;
for (i = first; i < first + num; ++i) {
- ics_set_irq_type(ics, i, lsi);
+ spapr_irq_set_lsi(spapr, i, lsi);
}
- first += ics->offset;
trace_spapr_irq_alloc_block(first, num, lsi, align);
--
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 ` [Qemu-devel] [PATCH 2/5] ppc/xics: assign of the CPU 'intc' pointer under the core Cédric Le Goater
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 ` Cédric Le Goater [this message]
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-5-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).