diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2014-11-24 13:21:09 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2014-12-01 14:07:39 -0500 |
commit | 094dfc545139510f251b9595850aa63fe2a8c131 (patch) | |
tree | 1d92fc26e6a38cbd3938e1ab1fe2fbf5584bfb7a | |
parent | 05df710ec343cf351475e86bfaf89938e5114d69 (diff) |
ftrace/x86: Have save_mcount_regs store RIP in %rdi for first parameter
Instead of having save_mcount_regs store the RIP in %rdx as a temp register
to place it in the proper location of the pt_regs on the stack. Use the
%rdi register as the temp register. This lets us remove the extra store
in the ftrace_caller_setup macro.
Link: http://lkml.kernel.org/r/CA+55aFwF+qCGSKdGaEgW4p6N65GZ5_XTV=1NbtWDvxnd5yYLiw@mail.gmail.com
Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1411262304010.3961@nanos
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | arch/x86/kernel/mcount_64.S | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86/kernel/mcount_64.S b/arch/x86/kernel/mcount_64.S index 0a693d011980..4f1b27642495 100644 --- a/arch/x86/kernel/mcount_64.S +++ b/arch/x86/kernel/mcount_64.S | |||
@@ -51,8 +51,8 @@ | |||
51 | movq %r8, R8(%rsp) | 51 | movq %r8, R8(%rsp) |
52 | movq %r9, R9(%rsp) | 52 | movq %r9, R9(%rsp) |
53 | /* Move RIP to its proper location */ | 53 | /* Move RIP to its proper location */ |
54 | movq SS+8(%rsp), %rdx | 54 | movq SS+8(%rsp), %rdi |
55 | movq %rdx, RIP(%rsp) | 55 | movq %rdi, RIP(%rsp) |
56 | .endm | 56 | .endm |
57 | 57 | ||
58 | .macro restore_mcount_regs skip=0 | 58 | .macro restore_mcount_regs skip=0 |
@@ -75,8 +75,7 @@ GLOBAL(\trace_label) | |||
75 | /* Load the ftrace_ops into the 3rd parameter */ | 75 | /* Load the ftrace_ops into the 3rd parameter */ |
76 | movq function_trace_op(%rip), %rdx | 76 | movq function_trace_op(%rip), %rdx |
77 | 77 | ||
78 | /* Load ip into the first parameter */ | 78 | /* %rdi already has %rip from the save_mcount_regs macro */ |
79 | movq RIP(%rsp), %rdi | ||
80 | subq $MCOUNT_INSN_SIZE, %rdi | 79 | subq $MCOUNT_INSN_SIZE, %rdi |
81 | /* Load the parent_ip into the second parameter */ | 80 | /* Load the parent_ip into the second parameter */ |
82 | #ifdef CC_USING_FENTRY | 81 | #ifdef CC_USING_FENTRY |