From: Li Zhong Date: Sat, 7 Jan 2012 17:54:52 +0000 (+0000) Subject: powerpc: Fix unpaired __trace_hcall_entry and __trace_hcall_exit X-Git-Tag: upstream/snapshot3+hdmi~8336^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ebb7f616abf6ee11603e6b63aa6c5f84c80a17d0;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git powerpc: Fix unpaired __trace_hcall_entry and __trace_hcall_exit Unpaired calling of __trace_hcall_entry and __trace_hcall_exit could cause incorrect preempt count. And it might happen as the global variable hcall_tracepoint_refcount is checked separately before calling them. Instead, store the value that was used on entry in the stack frame and retreive it from there after the call Reported-by: Paul E. McKenney Signed-off-by: Li Zhong Tested-by: Paul E. McKenney Signed-off-by: Benjamin Herrenschmidt --- diff --git a/arch/powerpc/platforms/pseries/hvCall.S b/arch/powerpc/platforms/pseries/hvCall.S index fd05fde..3ce73d0 100644 --- a/arch/powerpc/platforms/pseries/hvCall.S +++ b/arch/powerpc/platforms/pseries/hvCall.S @@ -36,6 +36,7 @@ BEGIN_FTR_SECTION; \ b 1f; \ END_FTR_SECTION(0, 1); \ ld r12,hcall_tracepoint_refcount@toc(r2); \ + std r12,32(r1); \ cmpdi r12,0; \ beq+ 1f; \ mflr r0; \ @@ -74,7 +75,7 @@ END_FTR_SECTION(0, 1); \ BEGIN_FTR_SECTION; \ b 1f; \ END_FTR_SECTION(0, 1); \ - ld r12,hcall_tracepoint_refcount@toc(r2); \ + ld r12,32(r1); \ cmpdi r12,0; \ beq+ 1f; \ mflr r0; \