diff options
author | Li Zhong <zhong@linux.vnet.ibm.com> | 2012-01-07 12:54:52 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-01-10 20:50:26 -0500 |
commit | ebb7f616abf6ee11603e6b63aa6c5f84c80a17d0 (patch) | |
tree | 8912e1ebd7d665286e7bc28ec30688517835da87 | |
parent | a5ccfee05a439b803640e94584056204501db31c (diff) |
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 <paulmck@linux.vnet.ibm.com>
Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
Tested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/platforms/pseries/hvCall.S | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/pseries/hvCall.S b/arch/powerpc/platforms/pseries/hvCall.S index fd05fdee576a..3ce73d0052b1 100644 --- a/arch/powerpc/platforms/pseries/hvCall.S +++ b/arch/powerpc/platforms/pseries/hvCall.S | |||
@@ -36,6 +36,7 @@ BEGIN_FTR_SECTION; \ | |||
36 | b 1f; \ | 36 | b 1f; \ |
37 | END_FTR_SECTION(0, 1); \ | 37 | END_FTR_SECTION(0, 1); \ |
38 | ld r12,hcall_tracepoint_refcount@toc(r2); \ | 38 | ld r12,hcall_tracepoint_refcount@toc(r2); \ |
39 | std r12,32(r1); \ | ||
39 | cmpdi r12,0; \ | 40 | cmpdi r12,0; \ |
40 | beq+ 1f; \ | 41 | beq+ 1f; \ |
41 | mflr r0; \ | 42 | mflr r0; \ |
@@ -74,7 +75,7 @@ END_FTR_SECTION(0, 1); \ | |||
74 | BEGIN_FTR_SECTION; \ | 75 | BEGIN_FTR_SECTION; \ |
75 | b 1f; \ | 76 | b 1f; \ |
76 | END_FTR_SECTION(0, 1); \ | 77 | END_FTR_SECTION(0, 1); \ |
77 | ld r12,hcall_tracepoint_refcount@toc(r2); \ | 78 | ld r12,32(r1); \ |
78 | cmpdi r12,0; \ | 79 | cmpdi r12,0; \ |
79 | beq+ 1f; \ | 80 | beq+ 1f; \ |
80 | mflr r0; \ | 81 | mflr r0; \ |