Commit 6f86913c authored by Paul Mackerras's avatar Paul Mackerras Committed by Linus Torvalds

[PATCH] ppc64: clear MSR_RI earlier in syscall exit path

This patch is from Craig Chaney <cchaney@us.ibm.com>.

This patch moves the restoring of the stack pointer in the system call exit
path to after the point where we clear the RI (recoverable interrupt) bit in
the MSR.  Normally, loading the stack pointer before clearing RI doesn't cause
any problem because there is no trap that can normally occur in between.  But
if we are tracing the code using a tool that single-steps instructions, this
can cause a problem.  In this case, clearing RI serves as an indication that
the following code can't be safely single-stepped.
Signed-off-by: default avatarCraig Chaney <cchaney@us.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4bcbc95d
......@@ -185,10 +185,10 @@ syscall_exit_trace_cont:
beq- 1f /* only restore r13 if */
ld r13,GPR13(r1) /* returning to usermode */
1: ld r2,GPR2(r1)
ld r1,GPR1(r1)
li r12,MSR_RI
andc r10,r10,r12
mtmsrd r10,1 /* clear MSR.RI */
ld r1,GPR1(r1)
mtlr r4
mtcr r5
mtspr SRR0,r7
......
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