summaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel
diff options
context:
space:
mode:
authorRob Gardner <rob.gardner@oracle.com>2015-12-21 21:48:03 -0700
committerDavid S. Miller <davem@davemloft.net>2015-12-24 12:07:16 -0500
commit1ca04a4ce0d5131471c5a1fac76899dc2d9d3f36 (patch)
tree7e2f8aad1841ce369234d6de9c522b545bedf6aa /arch/sparc/kernel
parent82924e542f20e645bc7de86e2889fe3fb0858566 (diff)
downloadblackbird-op-linux-1ca04a4ce0d5131471c5a1fac76899dc2d9d3f36.tar.gz
blackbird-op-linux-1ca04a4ce0d5131471c5a1fac76899dc2d9d3f36.zip
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 <rob.gardner@oracle.com> Signed-off-by: Dave Aldridge <david.j.aldridge@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r--arch/sparc/kernel/rtrap_64.S8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/sparc/kernel/rtrap_64.S b/arch/sparc/kernel/rtrap_64.S
index 39f0c662f4c8..d08bdaffdbfc 100644
--- a/arch/sparc/kernel/rtrap_64.S
+++ b/arch/sparc/kernel/rtrap_64.S
@@ -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
OpenPOWER on IntegriCloud