提交 035df35d 编写于 作者: D David S. Miller

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: NFrederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2e2dc1d7
...@@ -34,7 +34,7 @@ mcount: ...@@ -34,7 +34,7 @@ mcount:
cmp %g1, %g2 cmp %g1, %g2
be,pn %icc, 1f be,pn %icc, 1f
mov %i7, %g3 mov %i7, %g3
save %sp, -128, %sp save %sp, -176, %sp
mov %g3, %o1 mov %g3, %o1
jmpl %g1, %o7 jmpl %g1, %o7
mov %i7, %o0 mov %i7, %o0
...@@ -56,7 +56,7 @@ mcount: ...@@ -56,7 +56,7 @@ mcount:
nop nop
5: mov %i7, %g2 5: mov %i7, %g2
mov %fp, %g3 mov %fp, %g3
save %sp, -128, %sp save %sp, -176, %sp
mov %g2, %l0 mov %g2, %l0
ba,pt %xcc, ftrace_graph_caller ba,pt %xcc, ftrace_graph_caller
mov %g3, %l1 mov %g3, %l1
...@@ -85,7 +85,7 @@ ftrace_caller: ...@@ -85,7 +85,7 @@ ftrace_caller:
lduw [%g1 + %lo(function_trace_stop)], %g1 lduw [%g1 + %lo(function_trace_stop)], %g1
brnz,pn %g1, ftrace_stub brnz,pn %g1, ftrace_stub
mov %fp, %g3 mov %fp, %g3
save %sp, -128, %sp save %sp, -176, %sp
mov %g2, %o1 mov %g2, %o1
mov %g2, %l0 mov %g2, %l0
mov %g3, %l1 mov %g3, %l1
...@@ -120,7 +120,7 @@ ENTRY(ftrace_graph_caller) ...@@ -120,7 +120,7 @@ ENTRY(ftrace_graph_caller)
END(ftrace_graph_caller) END(ftrace_graph_caller)
ENTRY(return_to_handler) ENTRY(return_to_handler)
save %sp, -128, %sp save %sp, -176, %sp
call ftrace_return_to_handler call ftrace_return_to_handler
mov %fp, %o0 mov %fp, %o0
jmpl %o0 + 8, %g0 jmpl %o0 + 8, %g0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册