diff options
author | David S. Miller <davem@davemloft.net> | 2010-04-13 21:59:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-13 21:59:02 -0400 |
commit | 035df35d968323f6f463c8789553e8589efcbcd4 (patch) | |
tree | 6932aa9c85e37cf7d2e910a171b46ffacdb834a8 /arch | |
parent | 2e2dc1d755cc5609d0c46d47f7d171318b3bffcd (diff) |
sparc64: Allocate sufficient stack space in ftrace stubs.
128 bytes is sufficient for the register window save area, but the
calling conventions allow the callee to save up to 6 incoming argument
registers into the stack frame after the register window save area.
This means a minimal stack frame is 176 bytes (128 + (6 * 8)).
This fixes random crashes when using the function tracer.
Reported-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sparc/lib/mcount.S | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/sparc/lib/mcount.S b/arch/sparc/lib/mcount.S index 3753e3c6e176..3ad6cbdc2163 100644 --- a/arch/sparc/lib/mcount.S +++ b/arch/sparc/lib/mcount.S | |||
@@ -34,7 +34,7 @@ mcount: | |||
34 | cmp %g1, %g2 | 34 | cmp %g1, %g2 |
35 | be,pn %icc, 1f | 35 | be,pn %icc, 1f |
36 | mov %i7, %g3 | 36 | mov %i7, %g3 |
37 | save %sp, -128, %sp | 37 | save %sp, -176, %sp |
38 | mov %g3, %o1 | 38 | mov %g3, %o1 |
39 | jmpl %g1, %o7 | 39 | jmpl %g1, %o7 |
40 | mov %i7, %o0 | 40 | mov %i7, %o0 |
@@ -56,7 +56,7 @@ mcount: | |||
56 | nop | 56 | nop |
57 | 5: mov %i7, %g2 | 57 | 5: mov %i7, %g2 |
58 | mov %fp, %g3 | 58 | mov %fp, %g3 |
59 | save %sp, -128, %sp | 59 | save %sp, -176, %sp |
60 | mov %g2, %l0 | 60 | mov %g2, %l0 |
61 | ba,pt %xcc, ftrace_graph_caller | 61 | ba,pt %xcc, ftrace_graph_caller |
62 | mov %g3, %l1 | 62 | mov %g3, %l1 |
@@ -85,7 +85,7 @@ ftrace_caller: | |||
85 | lduw [%g1 + %lo(function_trace_stop)], %g1 | 85 | lduw [%g1 + %lo(function_trace_stop)], %g1 |
86 | brnz,pn %g1, ftrace_stub | 86 | brnz,pn %g1, ftrace_stub |
87 | mov %fp, %g3 | 87 | mov %fp, %g3 |
88 | save %sp, -128, %sp | 88 | save %sp, -176, %sp |
89 | mov %g2, %o1 | 89 | mov %g2, %o1 |
90 | mov %g2, %l0 | 90 | mov %g2, %l0 |
91 | mov %g3, %l1 | 91 | mov %g3, %l1 |
@@ -120,7 +120,7 @@ ENTRY(ftrace_graph_caller) | |||
120 | END(ftrace_graph_caller) | 120 | END(ftrace_graph_caller) |
121 | 121 | ||
122 | ENTRY(return_to_handler) | 122 | ENTRY(return_to_handler) |
123 | save %sp, -128, %sp | 123 | save %sp, -176, %sp |
124 | call ftrace_return_to_handler | 124 | call ftrace_return_to_handler |
125 | mov %fp, %o0 | 125 | mov %fp, %o0 |
126 | jmpl %o0 + 8, %g0 | 126 | jmpl %o0 + 8, %g0 |