sparc64: Don't set %pil in rtrap_nmi too early
PATCH 1/1 sparc64: Don't set %pil in rtrap_nmi too early
Commit 28a1f53 delays setting %pil to avoid potential hardirq stack overflow in the common rtrap_irq path. Setting %pil also needs to be delayed in the rtrap_nmi path for the same reason.
Signed-off-by Rob Gardner <[email protected]>
Signed-off-by Dave Aldridge <[email protected]>
--- arch/sparc/kernel/rtrap_64.S | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
arch/sparc/kernel/rtrap_64.S +7 -1
@@ -73,7 +73,13 @@ rtrap_nmi: ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1 andn %l1, %l4, %l1 srl %l4, 20, %l4 ba,pt %xcc, rtrap_no_irq_enable - wrpr %l4, %pil + nop + /* Do not actually set the %pil here. We will do that + * below after we clear PSTATE_IE in the %pstate register. + * If we re-enable interrupts here, we can recurse down + * the hardirq stack potentially endlessly, causing a + * stack overflow. + */ .align 64 .globl rtrap_irq, rtrap, irqsz_patchme, rtrap_xcall
Signature · 1 line
1.7.9.5
From: Rob Gardner <[email protected]>
Date: Mon, 21 Dec 2015 21:48:03 -0700
Quoted 7 lines
Commit 28a1f53 delays setting %pil to avoid potential hardirq stack overflow in the common
rtrap_irqpath. Setting %pil also needs to be delayed in thertrap_nmipath for the same reason.Signed-off-by Rob Gardner <[email protected]>Signed-off-by Dave Aldridge <[email protected]>
Applied.