[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [PATCH v4 02/15] xive: Only set source type for LSIs
From: |
David Gibson |
Subject: |
Re: [qemu-s390x] [PATCH v4 02/15] xive: Only set source type for LSIs |
Date: |
Wed, 13 Feb 2019 14:27:40 +1100 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
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 <address@hidden>
> Reviewed-by: Cédric Le Goater <address@hidden>
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
signature.asc
Description: PGP signature
- [qemu-s390x] [PATCH v4 00/15] spapr: Add support for PHB hotplug, Greg Kurz, 2019/02/12
- [qemu-s390x] [PATCH v4 01/15] spapr_irq: Add an @xics_offset field to sPAPRIrq, Greg Kurz, 2019/02/12
- [qemu-s390x] [PATCH v4 02/15] xive: Only set source type for LSIs, Greg Kurz, 2019/02/12
- Re: [qemu-s390x] [PATCH v4 02/15] xive: Only set source type for LSIs,
David Gibson <=
- [qemu-s390x] [PATCH v4 04/15] spapr: Expose the name of the interrupt controller node, Greg Kurz, 2019/02/12
- [qemu-s390x] [PATCH v4 03/15] spapr_irq: Set LSIs at interrupt controller init, Greg Kurz, 2019/02/12
- [qemu-s390x] [PATCH v4 05/15] spapr_irq: Expose the phandle of the interrupt controller, Greg Kurz, 2019/02/12
- [qemu-s390x] [PATCH v4 07/15] spapr: create DR connectors for PHBs, Greg Kurz, 2019/02/12