Commit 1739f09e authored by Steven Rostedt's avatar Steven Rostedt Committed by H. Peter Anvin

ftrace/x86: Load ftrace_ops in parameter not the variable holding it

Function tracing callbacks expect to have the ftrace_ops that registered it
passed to them, not the address of the variable that holds the ftrace_ops
that registered it.

Use a mov instead of a lea to store the ftrace_ops into the parameter
of the function tracing callback.
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Reviewed-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Link: http://lkml.kernel.org/r/20131113152004.459787f9@gandalf.local.homeSigned-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
Cc: <stable@vger.kernel.org> # v3.8+
parent d6e0a2dd
...@@ -1082,7 +1082,7 @@ ENTRY(ftrace_caller) ...@@ -1082,7 +1082,7 @@ ENTRY(ftrace_caller)
pushl $0 /* Pass NULL as regs pointer */ pushl $0 /* Pass NULL as regs pointer */
movl 4*4(%esp), %eax movl 4*4(%esp), %eax
movl 0x4(%ebp), %edx movl 0x4(%ebp), %edx
leal function_trace_op, %ecx movl function_trace_op, %ecx
subl $MCOUNT_INSN_SIZE, %eax subl $MCOUNT_INSN_SIZE, %eax
.globl ftrace_call .globl ftrace_call
...@@ -1140,7 +1140,7 @@ ENTRY(ftrace_regs_caller) ...@@ -1140,7 +1140,7 @@ ENTRY(ftrace_regs_caller)
movl 12*4(%esp), %eax /* Load ip (1st parameter) */ movl 12*4(%esp), %eax /* Load ip (1st parameter) */
subl $MCOUNT_INSN_SIZE, %eax /* Adjust ip */ subl $MCOUNT_INSN_SIZE, %eax /* Adjust ip */
movl 0x4(%ebp), %edx /* Load parent ip (2nd parameter) */ movl 0x4(%ebp), %edx /* Load parent ip (2nd parameter) */
leal function_trace_op, %ecx /* Save ftrace_pos in 3rd parameter */ movl function_trace_op, %ecx /* Save ftrace_pos in 3rd parameter */
pushl %esp /* Save pt_regs as 4th parameter */ pushl %esp /* Save pt_regs as 4th parameter */
GLOBAL(ftrace_regs_call) GLOBAL(ftrace_regs_call)
......
...@@ -88,7 +88,7 @@ END(function_hook) ...@@ -88,7 +88,7 @@ END(function_hook)
MCOUNT_SAVE_FRAME \skip MCOUNT_SAVE_FRAME \skip
/* Load the ftrace_ops into the 3rd parameter */ /* Load the ftrace_ops into the 3rd parameter */
leaq function_trace_op, %rdx movq function_trace_op(%rip), %rdx
/* Load ip into the first parameter */ /* Load ip into the first parameter */
movq RIP(%rsp), %rdi movq RIP(%rsp), %rdi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment