[Skiboot] [PATCH 28/32] xive: Keep track of which interrupts were ever enabled

Benjamin Herrenschmidt benh at kernel.crashing.org
Tue Nov 22 13:13:30 AEDT 2016


In order to speed up xive reset

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

diff --git a/hw/xive.c b/hw/xive.c
index 811fcd2..bfc9c26 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -378,6 +378,11 @@ struct xive {
 	uint32_t	int_hw_bot;	/* Bottom of HW allocation */
 	uint32_t	int_ipi_top;	/* Highest IPI handed out so far + 1 */
 
+	/* We keep track of which interrupts were ever enabled to
+	 * speed up xive_reset
+	 */
+	bitmap_t	*int_enabled_map;
+
 	/* Embedded source IPIs */
 	struct xive_src	ipis;
 };
@@ -2120,6 +2125,12 @@ static int64_t xive_set_irq_targetting(uint32_t isn, uint32_t target,
 		/* Unmasking */
 		new_ive = ive->w & ~IVE_MASKED;
 		xive_vdbg(x, "ISN %x unmasked !\n", isn);
+
+		/* For normal interrupt sources, keep track of which ones
+		 * we ever enabled since the last reset
+		 */
+		if (!is_escalation)
+			bitmap_set_bit(*x->int_enabled_map, GIRQ_TO_IDX(isn));
 	}
 
 	/* Re-target the IVE. First find the EQ
@@ -2396,8 +2407,11 @@ static void init_one_xive(struct dt_node *np)
 	if (x->int_ipi_top < 0x10)
 		x->int_ipi_top = 0x10;
 
+	/* Allocate a few bitmaps */
 	x->eq_map = zalloc(BITMAP_BYTES(MAX_EQ_COUNT >> 3));
 	assert(x->eq_map);
+	x->int_enabled_map = zalloc(BITMAP_BYTES(MAX_INT_ENTRIES));
+	assert(x->int_enabled_map);
 
 	xive_dbg(x, "Handling interrupts [%08x..%08x]\n",
 		 x->int_base, x->int_max - 1);
-- 
2.7.4



More information about the Skiboot mailing list