qemu-ppc
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]