aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/mcount64.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/mcount64.S')
-rw-r--r--arch/s390/kernel/mcount64.S29
1 files changed, 9 insertions, 20 deletions
diff --git a/arch/s390/kernel/mcount64.S b/arch/s390/kernel/mcount64.S
index c37211c6092b..e73667286ac0 100644
--- a/arch/s390/kernel/mcount64.S
+++ b/arch/s390/kernel/mcount64.S
@@ -7,6 +7,8 @@
7 7
8#include <asm/asm-offsets.h> 8#include <asm/asm-offsets.h>
9 9
10 .section .kprobes.text, "ax"
11
10 .globl ftrace_stub 12 .globl ftrace_stub
11ftrace_stub: 13ftrace_stub:
12 br %r14 14 br %r14
@@ -16,12 +18,6 @@ _mcount:
16#ifdef CONFIG_DYNAMIC_FTRACE 18#ifdef CONFIG_DYNAMIC_FTRACE
17 br %r14 19 br %r14
18 20
19 .data
20 .globl ftrace_dyn_func
21ftrace_dyn_func:
22 .quad ftrace_stub
23 .previous
24
25 .globl ftrace_caller 21 .globl ftrace_caller
26ftrace_caller: 22ftrace_caller:
27#endif 23#endif
@@ -35,26 +31,19 @@ ftrace_caller:
35 stg %r1,__SF_BACKCHAIN(%r15) 31 stg %r1,__SF_BACKCHAIN(%r15)
36 lgr %r2,%r14 32 lgr %r2,%r14
37 lg %r3,168(%r15) 33 lg %r3,168(%r15)
38#ifdef CONFIG_DYNAMIC_FTRACE
39 larl %r14,ftrace_dyn_func
40#else
41 larl %r14,ftrace_trace_function 34 larl %r14,ftrace_trace_function
42#endif
43 lg %r14,0(%r14) 35 lg %r14,0(%r14)
44 basr %r14,%r14 36 basr %r14,%r14
45#ifdef CONFIG_FUNCTION_GRAPH_TRACER 37#ifdef CONFIG_FUNCTION_GRAPH_TRACER
46#ifdef CONFIG_DYNAMIC_FTRACE 38 lg %r2,168(%r15)
39 lg %r3,272(%r15)
47 .globl ftrace_graph_caller 40 .globl ftrace_graph_caller
48ftrace_graph_caller: 41ftrace_graph_caller:
49 # This unconditional branch gets runtime patched. Change only if 42# The bras instruction gets runtime patched to call prepare_ftrace_return.
50 # you know what you are doing. See ftrace_enable_graph_caller(). 43# See ftrace_enable_ftrace_graph_caller. The patched instruction is:
51 j 0f 44# bras %r14,prepare_ftrace_return
52#endif 45 bras %r14,0f
53 lg %r2,272(%r15) 460: stg %r2,168(%r15)
54 lg %r3,168(%r15)
55 brasl %r14,prepare_ftrace_return
56 stg %r2,168(%r15)
570:
58#endif 47#endif
59 aghi %r15,160 48 aghi %r15,160
60 lmg %r2,%r5,32(%r15) 49 lmg %r2,%r5,32(%r15)