Commit 28a1f533 authored by David S. Miller's avatar David S. Miller

sparc64: Fix hardirq tracing in trap return path.

We can overflow the hardirq stack if we set the %pil here
so early, just let the normal control flow do it.

This is fine as we are allowed to do the actual IRQ enable
at any point after we call trace_hardirqs_on.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent baa06775
...@@ -130,7 +130,17 @@ rtrap_xcall: ...@@ -130,7 +130,17 @@ rtrap_xcall:
nop nop
call trace_hardirqs_on call trace_hardirqs_on
nop nop
wrpr %l4, %pil /* 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.
*
* It is tempting to put this test and trace_hardirqs_on
* call at the 'rt_continue' label, but that will not work
* as that path hits unconditionally and we do not want to
* execute this in NMI return paths, for example.
*/
#endif #endif
rtrap_no_irq_enable: rtrap_no_irq_enable:
andcc %l1, TSTATE_PRIV, %l3 andcc %l1, TSTATE_PRIV, %l3
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment