diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2014-11-24 11:30:58 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2014-12-01 14:07:16 -0500 |
commit | 4bcdf1522fb11b6c3a3dabe4432b54da2bd6bc0e (patch) | |
tree | 46343572932223c431d3188b4e8b6ed54874178d | |
parent | 76c2f13c5515979adab5de3ebda27c309f459a7b (diff) |
ftrace/x86: Move MCOUNT_SAVE_FRAME out of header file
Linus pointed out that MCOUNT_SAVE_FRAME is used in only a single file
and that there's no reason that it should be in a header file.
Move the macro to the code that uses it.
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>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | arch/x86/include/asm/ftrace.h | 33 | ||||
-rw-r--r-- | arch/x86/kernel/mcount_64.S | 29 |
2 files changed, 29 insertions, 33 deletions
diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h index e1f7fecaa7d6..f45acad3c4b6 100644 --- a/arch/x86/include/asm/ftrace.h +++ b/arch/x86/include/asm/ftrace.h | |||
@@ -1,39 +1,6 @@ | |||
1 | #ifndef _ASM_X86_FTRACE_H | 1 | #ifndef _ASM_X86_FTRACE_H |
2 | #define _ASM_X86_FTRACE_H | 2 | #define _ASM_X86_FTRACE_H |
3 | 3 | ||
4 | #ifdef __ASSEMBLY__ | ||
5 | |||
6 | /* skip is set if the stack was already partially adjusted */ | ||
7 | .macro MCOUNT_SAVE_FRAME skip=0 | ||
8 | /* | ||
9 | * We add enough stack to save all regs. | ||
10 | */ | ||
11 | subq $(SS+8-\skip), %rsp | ||
12 | movq %rax, RAX(%rsp) | ||
13 | movq %rcx, RCX(%rsp) | ||
14 | movq %rdx, RDX(%rsp) | ||
15 | movq %rsi, RSI(%rsp) | ||
16 | movq %rdi, RDI(%rsp) | ||
17 | movq %r8, R8(%rsp) | ||
18 | movq %r9, R9(%rsp) | ||
19 | /* Move RIP to its proper location */ | ||
20 | movq SS+8(%rsp), %rdx | ||
21 | movq %rdx, RIP(%rsp) | ||
22 | .endm | ||
23 | |||
24 | .macro MCOUNT_RESTORE_FRAME skip=0 | ||
25 | movq R9(%rsp), %r9 | ||
26 | movq R8(%rsp), %r8 | ||
27 | movq RDI(%rsp), %rdi | ||
28 | movq RSI(%rsp), %rsi | ||
29 | movq RDX(%rsp), %rdx | ||
30 | movq RCX(%rsp), %rcx | ||
31 | movq RAX(%rsp), %rax | ||
32 | addq $(SS+8-\skip), %rsp | ||
33 | .endm | ||
34 | |||
35 | #endif | ||
36 | |||
37 | #ifdef CONFIG_FUNCTION_TRACER | 4 | #ifdef CONFIG_FUNCTION_TRACER |
38 | #ifdef CC_USING_FENTRY | 5 | #ifdef CC_USING_FENTRY |
39 | # define MCOUNT_ADDR ((long)(__fentry__)) | 6 | # define MCOUNT_ADDR ((long)(__fentry__)) |
diff --git a/arch/x86/kernel/mcount_64.S b/arch/x86/kernel/mcount_64.S index 24842c701660..94fe46725fe0 100644 --- a/arch/x86/kernel/mcount_64.S +++ b/arch/x86/kernel/mcount_64.S | |||
@@ -21,6 +21,35 @@ | |||
21 | # define function_hook mcount | 21 | # define function_hook mcount |
22 | #endif | 22 | #endif |
23 | 23 | ||
24 | /* skip is set if the stack was already partially adjusted */ | ||
25 | .macro MCOUNT_SAVE_FRAME skip=0 | ||
26 | /* | ||
27 | * We add enough stack to save all regs. | ||
28 | */ | ||
29 | subq $(SS+8-\skip), %rsp | ||
30 | movq %rax, RAX(%rsp) | ||
31 | movq %rcx, RCX(%rsp) | ||
32 | movq %rdx, RDX(%rsp) | ||
33 | movq %rsi, RSI(%rsp) | ||
34 | movq %rdi, RDI(%rsp) | ||
35 | movq %r8, R8(%rsp) | ||
36 | movq %r9, R9(%rsp) | ||
37 | /* Move RIP to its proper location */ | ||
38 | movq SS+8(%rsp), %rdx | ||
39 | movq %rdx, RIP(%rsp) | ||
40 | .endm | ||
41 | |||
42 | .macro MCOUNT_RESTORE_FRAME skip=0 | ||
43 | movq R9(%rsp), %r9 | ||
44 | movq R8(%rsp), %r8 | ||
45 | movq RDI(%rsp), %rdi | ||
46 | movq RSI(%rsp), %rsi | ||
47 | movq RDX(%rsp), %rdx | ||
48 | movq RCX(%rsp), %rcx | ||
49 | movq RAX(%rsp), %rax | ||
50 | addq $(SS+8-\skip), %rsp | ||
51 | .endm | ||
52 | |||
24 | /* skip is set if stack has been adjusted */ | 53 | /* skip is set if stack has been adjusted */ |
25 | .macro ftrace_caller_setup trace_label skip=0 | 54 | .macro ftrace_caller_setup trace_label skip=0 |
26 | MCOUNT_SAVE_FRAME \skip | 55 | MCOUNT_SAVE_FRAME \skip |