[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [RFC PATCH 24/26] spapr: include the XIVE interrupt source fo
From: |
Cédric Le Goater |
Subject: |
[Qemu-ppc] [RFC PATCH 24/26] spapr: include the XIVE interrupt source for IPIs |
Date: |
Wed, 5 Jul 2017 19:13:37 +0200 |
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/intc/xive_spapr.c | 10 ++++++++++
hw/ppc/spapr.c | 11 ++++++++++-
include/hw/ppc/xive.h | 1 +
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/hw/intc/xive_spapr.c b/hw/intc/xive_spapr.c
index 64282cb4bfab..eb8a5c081e51 100644
--- a/hw/intc/xive_spapr.c
+++ b/hw/intc/xive_spapr.c
@@ -26,6 +26,16 @@
#include "xive-internal.h"
+/*
+ * Used by the XICSFabric ics_get handler in sPAPR
+ */
+ICSState *xive_ics_get(XIVE *x, uint32_t lisn)
+{
+ ICSState *ics = ICS_BASE(&x->ipi_xs);
+
+ return ics_valid_irq(ics, lisn) ? ics : NULL;
+}
+
static XiveICSState *xive_ics_find(sPAPRMachineState *spapr, uint32_t lisn)
{
XICSFabricClass *xic = XICS_FABRIC_GET_CLASS(spapr);
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 45527b4c5eca..816661f4c9ad 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3361,7 +3361,16 @@ static ICSState *spapr_ics_get(XICSFabric *dev, int irq)
{
sPAPRMachineState *spapr = SPAPR_MACHINE(dev);
- return ics_valid_irq(spapr->ics, irq) ? spapr->ics : NULL;
+ if (ics_valid_irq(spapr->ics, irq)) {
+ return spapr->ics;
+ }
+
+ /* If needed, check the XIVE IPI source also */
+ if (spapr_ovec_test(spapr->ov5_cas, OV5_XIVE_EXPLOIT)) {
+ return xive_ics_get(spapr->xive, irq);
+ }
+
+ return NULL;
}
static void spapr_ics_resend(XICSFabric *dev)
diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h
index 3c1cd96ea4d0..dc5309264422 100644
--- a/include/hw/ppc/xive.h
+++ b/include/hw/ppc/xive.h
@@ -74,5 +74,6 @@ uint32_t xive_alloc_hw_irqs(XIVE *x, uint32_t count, uint32_t
align);
void xive_ics_create(XiveICSState *xs, XIVE *x, uint32_t offset,
uint32_t nr_irqs, uint32_t shift, uint32_t flags,
Error **errp);
+ICSState *xive_ics_get(XIVE *x, uint32_t lisn);
#endif /* PPC_XIVE_H */
--
2.7.5
- Re: [Qemu-ppc] [RFC PATCH 17/26] ppc/xive: add hcalls support, (continued)
- [Qemu-ppc] [RFC PATCH 20/26] ppc/xive: introduce a helper to create XIVE interrupt source objects, Cédric Le Goater, 2017/07/05
- [Qemu-ppc] [RFC PATCH 21/26] ppc/xive: introduce routines to allocate IRQ numbers, Cédric Le Goater, 2017/07/05
- [Qemu-ppc] [RFC PATCH 22/26] ppc/xive: create an XIVE interrupt source to handle IPIs, Cédric Le Goater, 2017/07/05
- [Qemu-ppc] [RFC PATCH 23/26] spapr: add a XIVE object to the sPAPR machine, Cédric Le Goater, 2017/07/05
- [Qemu-ppc] [RFC PATCH 24/26] spapr: include the XIVE interrupt source for IPIs,
Cédric Le Goater <=
- [Qemu-ppc] [RFC PATCH 25/26] spapr: print the XIVE interrupt source for IPIs in the monitor, Cédric Le Goater, 2017/07/05
- [Qemu-ppc] [RFC PATCH 26/26] spapr: force XIVE exploitation mode for POWER9 (HACK), Cédric Le Goater, 2017/07/05
- Re: [Qemu-ppc] [RFC PATCH 00/26] guest exploitation of the XIVE interrupt controller (POWER9), David Gibson, 2017/07/10
- Re: [Qemu-ppc] [RFC PATCH 00/26] guest exploitation of the XIVE interrupt controller (POWER9), David Gibson, 2017/07/18