[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 04/19] spapr/xive: Don't set irq type in spapr_xi
From: |
Greg Kurz |
Subject: |
[Qemu-devel] [PATCH v3 04/19] spapr/xive: Don't set irq type in spapr_xive_irq_claim() |
Date: |
Thu, 17 Jan 2019 18:14:52 +0100 |
User-agent: |
StGit/unknown-version |
PHB hotplug will need to set the type of all LSIs at machine init.
Prepare for that by calling xive_source_irq_set() in the callers
of spapr_xive_irq_claim().
Signed-off-by: Greg Kurz <address@hidden>
---
hw/intc/spapr_xive.c | 5 +----
hw/ppc/spapr_irq.c | 6 ++++--
include/hw/ppc/spapr_xive.h | 2 +-
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c
index d391177ab81f..aab63cfd1178 100644
--- a/hw/intc/spapr_xive.c
+++ b/hw/intc/spapr_xive.c
@@ -471,16 +471,13 @@ static void spapr_xive_register_types(void)
type_init(spapr_xive_register_types)
-bool spapr_xive_irq_claim(sPAPRXive *xive, uint32_t lisn, bool lsi)
+bool spapr_xive_irq_claim(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, lsi);
return true;
}
diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c
index 86c712d15382..bcd816c5a5fb 100644
--- a/hw/ppc/spapr_irq.c
+++ b/hw/ppc/spapr_irq.c
@@ -285,7 +285,8 @@ static void spapr_irq_init_xive(sPAPRMachineState *spapr,
Error **errp)
/* Enable the CPU IPIs */
for (i = 0; i < nr_servers; ++i) {
- spapr_xive_irq_claim(spapr->xive, SPAPR_IRQ_IPI + i, false);
+ spapr_xive_irq_claim(spapr->xive, SPAPR_IRQ_IPI + i);
+ xive_source_irq_set(&spapr->xive->source, SPAPR_IRQ_IPI + i, false);
}
spapr_xive_hcall_init(spapr);
@@ -294,10 +295,11 @@ static void spapr_irq_init_xive(sPAPRMachineState *spapr,
Error **errp)
static int spapr_irq_claim_xive(sPAPRMachineState *spapr, int irq, bool lsi,
Error **errp)
{
- if (!spapr_xive_irq_claim(spapr->xive, irq, lsi)) {
+ if (!spapr_xive_irq_claim(spapr->xive, irq)) {
error_setg(errp, "IRQ %d is invalid", irq);
return -1;
}
+ xive_source_irq_set(&spapr->xive->source, irq, lsi);
return 0;
}
diff --git a/include/hw/ppc/spapr_xive.h b/include/hw/ppc/spapr_xive.h
index 7fdc25057420..f8854a4a6a18 100644
--- a/include/hw/ppc/spapr_xive.h
+++ b/include/hw/ppc/spapr_xive.h
@@ -37,7 +37,7 @@ typedef struct sPAPRXive {
MemoryRegion tm_mmio;
} sPAPRXive;
-bool spapr_xive_irq_claim(sPAPRXive *xive, uint32_t lisn, bool lsi);
+bool spapr_xive_irq_claim(sPAPRXive *xive, uint32_t lisn);
bool spapr_xive_irq_free(sPAPRXive *xive, uint32_t lisn);
void spapr_xive_pic_print_info(sPAPRXive *xive, Monitor *mon);
- [Qemu-devel] [PATCH v3 00/19] spapr: Add support for PHB hotplug, Greg Kurz, 2019/01/17
- [Qemu-devel] [PATCH v3 01/19] ppc: Move spapr-related prototypes from xics.h into a seperate header file, Greg Kurz, 2019/01/17
- [Qemu-devel] [PATCH v3 02/19] spapr: Rename xics to intc in interrupt controller agnostic code, Greg Kurz, 2019/01/17
- [Qemu-devel] [PATCH v3 03/19] xics: Disintricate allocation and type setting of interrupts, Greg Kurz, 2019/01/17
- [Qemu-devel] [PATCH v3 04/19] spapr/xive: Don't set irq type in spapr_xive_irq_claim(),
Greg Kurz <=
- [Qemu-devel] [PATCH v3 05/19] spapr: Set irq type in a dedicated function, Greg Kurz, 2019/01/17
- [Qemu-devel] [PATCH v3 06/19] spapr: Identify LSIs of all possible PHBs at machine init, Greg Kurz, 2019/01/17
- [Qemu-devel] [PATCH v3 08/19] spapr: create DR connectors for PHBs, Greg Kurz, 2019/01/17
- [Qemu-devel] [PATCH v3 09/19] spapr: populate PHB DRC entries for root DT node, Greg Kurz, 2019/01/17
- [Qemu-devel] [PATCH v3 07/19] spapr_pci: add PHB unrealize, Greg Kurz, 2019/01/17