
From: Paul Mackerras <paulus@samba.org>

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: Craig Chaney <cchaney@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/ppc64/kernel/entry.S |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN arch/ppc64/kernel/entry.S~ppc64-clear-msr_ri-earlier-in-syscall-exit-path arch/ppc64/kernel/entry.S
--- 25/arch/ppc64/kernel/entry.S~ppc64-clear-msr_ri-earlier-in-syscall-exit-path	2005-01-23 00:51:23.116162048 -0800
+++ 25-akpm/arch/ppc64/kernel/entry.S	2005-01-23 00:51:23.119161592 -0800
@@ -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
_
