aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/mcount.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/mcount.S')
-rw-r--r--arch/s390/kernel/mcount.S32
1 files changed, 9 insertions, 23 deletions
diff --git a/arch/s390/kernel/mcount.S b/arch/s390/kernel/mcount.S
index dfe015d7398c..1e6a55795628 100644
--- a/arch/s390/kernel/mcount.S
+++ b/arch/s390/kernel/mcount.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,22 +18,12 @@ _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 .long ftrace_stub
23 .previous
24
25 .globl ftrace_caller 21 .globl ftrace_caller
26ftrace_caller: 22ftrace_caller:
27#endif 23#endif
28 stm %r2,%r5,16(%r15) 24 stm %r2,%r5,16(%r15)
29 bras %r1,2f 25 bras %r1,2f
30#ifdef CONFIG_DYNAMIC_FTRACE
310: .long ftrace_dyn_func
32#else
330: .long ftrace_trace_function 260: .long ftrace_trace_function
34#endif
351: .long function_trace_stop 271: .long function_trace_stop
362: l %r2,1b-0b(%r1) 282: l %r2,1b-0b(%r1)
37 icm %r2,0xf,0(%r2) 29 icm %r2,0xf,0(%r2)
@@ -47,21 +39,15 @@ ftrace_caller:
47 l %r14,0(%r14) 39 l %r14,0(%r14)
48 basr %r14,%r14 40 basr %r14,%r14
49#ifdef CONFIG_FUNCTION_GRAPH_TRACER 41#ifdef CONFIG_FUNCTION_GRAPH_TRACER
50#ifdef CONFIG_DYNAMIC_FTRACE 42 l %r2,100(%r15)
43 l %r3,152(%r15)
51 .globl ftrace_graph_caller 44 .globl ftrace_graph_caller
52ftrace_graph_caller: 45ftrace_graph_caller:
53 # This unconditional branch gets runtime patched. Change only if 46# The bras instruction gets runtime patched to call prepare_ftrace_return.
54 # you know what you are doing. See ftrace_enable_graph_caller(). 47# See ftrace_enable_ftrace_graph_caller. The patched instruction is:
55 j 1f 48# bras %r14,prepare_ftrace_return
56#endif 49 bras %r14,0f
57 bras %r1,0f 500: st %r2,100(%r15)
58 .long prepare_ftrace_return
590: l %r2,152(%r15)
60 l %r4,0(%r1)
61 l %r3,100(%r15)
62 basr %r14,%r4
63 st %r2,100(%r15)
641:
65#endif 51#endif
66 ahi %r15,96 52 ahi %r15,96
67 l %r14,56(%r15) 53 l %r14,56(%r15)