From: David Gibson <david@gibson.dropbear.id.au>
To: Greg Kurz <groug@kaod.org>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
qemu-s390x@nongnu.org, "Alexey Kardashevskiy" <aik@ozlabs.ru>,
"Cédric Le Goater" <clg@kaod.org>,
"Michael Roth" <mdroth@linux.vnet.ibm.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Marcel Apfelbaum" <marcel@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"David Hildenbrand" <david@redhat.com>,
"Cornelia Huck" <cohuck@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Dmitry Fleytman" <dmitry.fleytman@gmail.com>,
"Thomas Huth" <thuth@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v4 02/15] xive: Only set source type for LSIs
Date: Wed, 13 Feb 2019 14:27:40 +1100 [thread overview]
Message-ID: <20190213032739.GA1884@umbus.fritz.box> (raw)
In-Reply-To: <154999584656.690774.18352404495120358613.stgit@bahia.lan>
[-- Attachment #1: Type: text/plain, Size: 2560 bytes --]
On Tue, Feb 12, 2019 at 07:24:06PM +0100, Greg Kurz wrote:
> MSI is the default and LSI specific code is guarded by the
> xive_source_irq_is_lsi() helper. The xive_source_irq_set()
> helper is a nop for MSIs.
>
> Simplify the code by turning xive_source_irq_set() into
> xive_source_irq_set_lsi() and only call it for LSIs. The
> call to xive_source_irq_set(false) in spapr_xive_irq_free()
> is also a nop. Just drop it.
>
> Signed-off-by: Greg Kurz <groug@kaod.org>
> Reviewed-by: Cédric Le Goater <clg@kaod.org>
Looks like a reasoanble cleanup regardless of the rest of the series.
Applied to ppc-for-4.0.
> ---
> hw/intc/spapr_xive.c | 7 +++----
> include/hw/ppc/xive.h | 7 ++-----
> 2 files changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c
> index a0f5ff929447..290a290e43a5 100644
> --- a/hw/intc/spapr_xive.c
> +++ b/hw/intc/spapr_xive.c
> @@ -489,20 +489,19 @@ bool spapr_xive_irq_claim(sPAPRXive *xive, uint32_t lisn, bool lsi)
> }
>
> xive->eat[lisn].w |= cpu_to_be64(EAS_VALID);
> - xive_source_irq_set(xsrc, lisn, lsi);
> + if (lsi) {
> + xive_source_irq_set_lsi(xsrc, lisn);
> + }
> return true;
> }
>
> bool spapr_xive_irq_free(sPAPRXive *xive, uint32_t lisn)
> {
> - XiveSource *xsrc = &xive->source;
> -
> if (lisn >= xive->nr_irqs) {
> return false;
> }
>
> xive->eat[lisn].w &= cpu_to_be64(~EAS_VALID);
> - xive_source_irq_set(xsrc, lisn, false);
> return true;
> }
>
> diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h
> index ec3bb2aae45a..13a487527b11 100644
> --- a/include/hw/ppc/xive.h
> +++ b/include/hw/ppc/xive.h
> @@ -283,13 +283,10 @@ static inline bool xive_source_irq_is_lsi(XiveSource *xsrc, uint32_t srcno)
> return test_bit(srcno, xsrc->lsi_map);
> }
>
> -static inline void xive_source_irq_set(XiveSource *xsrc, uint32_t srcno,
> - bool lsi)
> +static inline void xive_source_irq_set_lsi(XiveSource *xsrc, uint32_t srcno)
> {
> assert(srcno < xsrc->nr_irqs);
> - if (lsi) {
> - bitmap_set(xsrc->lsi_map, srcno, 1);
> - }
> + bitmap_set(xsrc->lsi_map, srcno, 1);
> }
>
> void xive_source_set_irq(void *opaque, int srcno, int val);
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-02-13 4:14 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-12 18:23 [Qemu-devel] [PATCH v4 00/15] spapr: Add support for PHB hotplug Greg Kurz
2019-02-12 18:24 ` [Qemu-devel] [PATCH v4 01/15] spapr_irq: Add an @xics_offset field to sPAPRIrq Greg Kurz
2019-02-12 20:07 ` Cédric Le Goater
2019-02-13 3:26 ` David Gibson
2019-02-13 12:23 ` Greg Kurz
2019-02-12 18:24 ` [Qemu-devel] [PATCH v4 02/15] xive: Only set source type for LSIs Greg Kurz
2019-02-13 3:27 ` David Gibson [this message]
2019-02-12 18:24 ` [Qemu-devel] [PATCH v4 03/15] spapr_irq: Set LSIs at interrupt controller init Greg Kurz
2019-02-12 20:17 ` Cédric Le Goater
2019-02-13 3:48 ` David Gibson
2019-02-13 12:44 ` Greg Kurz
2019-02-12 18:24 ` [Qemu-devel] [PATCH v4 04/15] spapr: Expose the name of the interrupt controller node Greg Kurz
2019-02-13 3:50 ` David Gibson
2019-02-12 18:24 ` [Qemu-devel] [PATCH v4 05/15] spapr_irq: Expose the phandle of the interrupt controller Greg Kurz
2019-02-13 3:52 ` David Gibson
2019-02-13 13:11 ` Greg Kurz
2019-02-12 18:24 ` [Qemu-devel] [PATCH v4 06/15] spapr_pci: add PHB unrealize Greg Kurz
2019-02-13 3:56 ` David Gibson
2019-02-12 18:24 ` [Qemu-devel] [PATCH v4 07/15] spapr: create DR connectors for PHBs Greg Kurz
2019-02-12 18:24 ` [Qemu-devel] [PATCH v4 08/15] spapr: populate PHB DRC entries for root DT node Greg Kurz
2019-02-12 18:24 ` [Qemu-devel] [PATCH v4 09/15] spapr_events: add support for phb hotplug events Greg Kurz
2019-02-12 18:24 ` [Qemu-devel] [PATCH v4 10/15] qdev: pass an Object * to qbus_set_hotplug_handler() Greg Kurz
2019-02-13 3:59 ` David Gibson
2019-02-12 18:25 ` [Qemu-devel] [PATCH v4 11/15] spapr_pci: provide node start offset via spapr_populate_pci_dt() Greg Kurz
2019-02-12 18:25 ` [Qemu-devel] [PATCH v4 12/15] spapr_pci: add ibm, my-drc-index property for PHB hotplug Greg Kurz
2019-02-12 18:25 ` [Qemu-devel] [PATCH v4 13/15] spapr_drc: Allow FDT fragment to be added later Greg Kurz
2019-02-13 4:05 ` David Gibson
2019-02-13 13:15 ` Greg Kurz
2019-02-12 18:25 ` [Qemu-devel] [PATCH v4 14/15] spapr: add hotplug hooks for PHB hotplug Greg Kurz
2019-02-13 4:13 ` David Gibson
2019-02-13 13:24 ` Greg Kurz
2019-02-13 9:25 ` David Hildenbrand
2019-02-13 13:25 ` Greg Kurz
2019-02-12 18:25 ` [Qemu-devel] [PATCH v4 15/15] spapr: enable PHB hotplug for default pseries machine type Greg Kurz
2019-02-13 4:13 ` 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=20190213032739.GA1884@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=aik@ozlabs.ru \
--cc=clg@kaod.org \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=dmitry.fleytman@gmail.com \
--cc=ehabkost@redhat.com \
--cc=groug@kaod.org \
--cc=kraxel@redhat.com \
--cc=marcel@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=thuth@redhat.com \
/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).