[Skiboot] [PATCH 57/60] xive: Add FIXME comments about mask/umask races

Benjamin Herrenschmidt benh at kernel.crashing.org
Thu Dec 22 14:17:05 AEDT 2016


Mask/unmask loses the information that the interrupt was sent to
the queue, thus fast mask/unmasks can potentially fill up the
queue with more than one copy of the same interrupt which is bad.

This will need to be fixed by remembering the need for an EOI
and restoring the interrupt accordingly on unmask

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 hw/xive.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hw/xive.c b/hw/xive.c
index 4cf971d..4f43c16 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -2285,6 +2285,9 @@ static void xive_update_irq_mask(struct xive_src *s, uint32_t idx, bool masked)
 	void *mmio_base = s->esb_mmio + (1ul << s->esb_shift) * idx;
 	uint32_t offset;
 
+	/* XXX FIXME: A quick mask/umask can make us shoot an interrupt
+	 * more than once to a queue. We need to keep track better
+	 */
 	if (s->flags & XIVE_SRC_EOI_PAGE1)
 		mmio_base += 1ull << (s->esb_shift - 1);
 	if (masked)
@@ -2358,6 +2361,11 @@ static void xive_source_eoi(struct irq_source *is, uint32_t isn)
 		return;
 	ive += GIRQ_TO_IDX(isn);
 
+	/* XXX To fix the races with mask/unmask potentially causing
+	 * multiple queue entries, we need to keep track of EOIs here,
+	 * before the masked test below
+	 */
+
 	/* If it's invalid or masked, don't do anything */
 	if ((ive->w & IVE_MASKED) || !(ive->w & IVE_VALID))
 		return;
-- 
2.9.3



More information about the Skiboot mailing list