[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 11/43] xive: Only set source type for LSIs
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 11/43] xive: Only set source type for LSIs |
Date: |
Tue, 19 Feb 2019 01:30:17 +1100 |
From: Greg Kurz <address@hidden>
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>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
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 a0f5ff9294..290a290e43 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 ec3bb2aae4..13a487527b 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);
--
2.20.1
- [Qemu-devel] [PULL 01/43] hw/ppc/prep: Drop useless inclusion of "hw/i386/pc.h", (continued)
- [Qemu-devel] [PULL 01/43] hw/ppc/prep: Drop useless inclusion of "hw/i386/pc.h", David Gibson, 2019/02/18
- [Qemu-devel] [PULL 03/43] target/ppc: Enable reporting of SPRs to GDB, David Gibson, 2019/02/18
- [Qemu-devel] [PULL 05/43] spapr_pci: Fix interrupt leak in rtas_ibm_change_msi() error path, David Gibson, 2019/02/18
- [Qemu-devel] [PULL 02/43] spapr: Rename xics to intc in interrupt controller agnostic code, David Gibson, 2019/02/18
- [Qemu-devel] [PULL 04/43] target/ppc: Fix msync to do what hardware does, David Gibson, 2019/02/18
- [Qemu-devel] [PULL 07/43] spapr: Disallow unsupported kernel-irqchip settings, David Gibson, 2019/02/18
- [Qemu-devel] [PULL 06/43] cuda: decrease time delay before raising VIA SR interrupt and remove fast path, David Gibson, 2019/02/18
- [Qemu-devel] [PULL 08/43] mac_newworld: change default NIC to sungem for mac99 machine, David Gibson, 2019/02/18
- [Qemu-devel] [PULL 10/43] ppc: fix crash during branch stepping, David Gibson, 2019/02/18
- [Qemu-devel] [PULL 09/43] target/ppc: Remove some #if 0'ed code, David Gibson, 2019/02/18
- [Qemu-devel] [PULL 11/43] xive: Only set source type for LSIs,
David Gibson <=
- [Qemu-devel] [PULL 16/43] spapr/irq: remove the XICS offset adjustment, David Gibson, 2019/02/18
- [Qemu-devel] [PULL 17/43] xics: Explicitely call KVM ICP methods from the common code, David Gibson, 2019/02/18
- [Qemu-devel] [PULL 13/43] target/ppc: Disable ISA 2.06 PM instructions on POWER9, David Gibson, 2019/02/18
- [Qemu-devel] [PULL 19/43] xics: Handle KVM ICP realize from the common code, David Gibson, 2019/02/18
- [Qemu-devel] [PULL 12/43] qdev: pass an Object * to qbus_set_hotplug_handler(), David Gibson, 2019/02/18
- [Qemu-devel] [PULL 15/43] spapr/irq: add an 'nr_irq' parameter to initialize the backend., David Gibson, 2019/02/18
- [Qemu-devel] [PULL 18/43] xics: Handle KVM ICP reset from the common code, David Gibson, 2019/02/18
- [Qemu-devel] [PULL 14/43] spapr: fix out of bounds write in spapr_populate_drmem_v2, David Gibson, 2019/02/18
- [Qemu-devel] [PULL 23/43] xics: Handle KVM ICS reset from the "simple" ICS code, David Gibson, 2019/02/18
- [Qemu-devel] [PULL 22/43] xics: Explicitely call KVM ICS methods from the common code, David Gibson, 2019/02/18