aboutsummaryrefslogtreecommitdiff
path: root/hw/xive.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2017-09-10 17:36:04 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-09-12 22:52:08 -0500
commit726753e781e811cec474af32bc467b4c887c156b (patch)
treed6009759d2b81e6301392fb29c1799a002b3dd19 /hw/xive.c
parente3c2498551fb8ef7db317d501f935a8a2e5d37cc (diff)
downloadskiboot-726753e781e811cec474af32bc467b4c887c156b.zip
skiboot-726753e781e811cec474af32bc467b4c887c156b.tar.gz
skiboot-726753e781e811cec474af32bc467b4c887c156b.tar.bz2
xive: Increase the interrupt "gap" on debug builds
We normally allocate IPIs from 0x10. Make that 0x1000 on debug builds to limit the chances of overlapping with Linux interrupt numbers which makes debugging code that confuses them easier. Also add a warning in emulation if we get an interrupt in the queue whose number is below the gap. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/xive.c')
-rw-r--r--hw/xive.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/xive.c b/hw/xive.c
index c236055..0d3b24f 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -46,12 +46,14 @@
#define XIVE_DEBUG_INIT_CACHE_UPDATES
#define XIVE_EXTRA_CHECK_INIT_CACHE
#define XIVE_CHECK_LOCKS
+#define XIVE_INT_SAFETY_GAP 0x1000
#else
#undef XIVE_DEBUG_DUPLICATES
#undef XIVE_PERCPU_LOG
#undef XIVE_DEBUG_INIT_CACHE_UPDATES
#undef XIVE_EXTRA_CHECK_INIT_CACHE
#undef XIVE_CHECK_LOCKS
+#define XIVE_INT_SAFETY_GAP 0x10
#endif
/*
@@ -2756,8 +2758,8 @@ static struct xive *init_one_xive(struct dt_node *np)
/* Make sure we never hand out "2" as it's reserved for XICS emulation
* IPI returns. Generally start handing out at 0x10
*/
- if (x->int_ipi_top < 0x10)
- x->int_ipi_top = 0x10;
+ if (x->int_ipi_top < XIVE_INT_SAFETY_GAP)
+ x->int_ipi_top = XIVE_INT_SAFETY_GAP;
/* Allocate a few bitmaps */
x->eq_map = zalloc(BITMAP_BYTES(MAX_EQ_COUNT >> 3));
@@ -3540,6 +3542,9 @@ static int64_t opal_xive_get_xirr(uint32_t *out_xirr, bool just_poll)
/* XXX Use "p" to select queue */
val = xive_read_eq(xs, just_poll);
+ if (val && val < XIVE_INT_SAFETY_GAP)
+ xive_cpu_err(c, "Bogus interrupt 0x%x received !\n", val);
+
/* Convert to magic IPI if needed */
if (val == xs->ipi_irq)
val = 2;