[Skiboot] [PATCH 42/60] xive: Add support for EOIs via OPAL

Benjamin Herrenschmidt benh at kernel.crashing.org
Thu Dec 22 14:16:50 AEDT 2016


opal_xive_eoi() can perform EOIs in XIVE exploitation mode
as well as XICS emulation mode. Add a per-interrupt flag
requiring the OS to use the OPAL call instead of ESB access.

This is meant to be used as a broken HW workaround

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 hw/xive.c          | 14 +++++++++++++-
 include/opal-api.h |  1 +
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/hw/xive.c b/hw/xive.c
index 16585fc..481fc28 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -2823,8 +2823,20 @@ static int64_t opal_xive_eoi(uint32_t xirr)
 	struct xive *src_x;
 	bool special_ipi = false;
 
+	/*
+	 * In exploitation mode, this is supported as a way to perform
+	 * an EOI via a FW calls. This can be needed to workaround HW
+	 * implementation bugs for example. In this case interrupts will
+	 * have the OPAL_XIVE_IRQ_EOI_VIA_FW flag set.
+	 *
+	 * In that mode the entire "xirr" argument is interpreterd as
+	 * a global IRQ number (including the escalation bit), ther is
+	 * no split between the top 8 bits for CPPR and bottom 24 for
+	 * the interrupt number.
+	 */
 	if (xive_mode != XIVE_MODE_EMU)
-		return OPAL_WRONG_STATE;
+		return irq_source_eoi(xirr) ? OPAL_SUCCESS : OPAL_PARAMETER;
+
 	if (!xs)
 		return OPAL_INTERNAL_ERROR;
 
diff --git a/include/opal-api.h b/include/opal-api.h
index 9af8a45..8d3382b 100644
--- a/include/opal-api.h
+++ b/include/opal-api.h
@@ -1102,6 +1102,7 @@ enum {
 	OPAL_XIVE_IRQ_LSI		= 0x00000004,
 	OPAL_XIVE_IRQ_SHIFT_BUG		= 0x00000008,
 	OPAL_XIVE_IRQ_MASK_VIA_FW	= 0x00000010,
+	OPAL_XIVE_IRQ_EOI_VIA_FW	= 0x00000020,
 };
 
 /* Flags for OPAL_XIVE_GET/SET_QUEUE_INFO */
-- 
2.9.3



More information about the Skiboot mailing list