hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/s390/kernel/mcount.S
....@@ -20,6 +20,7 @@
2020
2121 ENTRY(ftrace_stub)
2222 BR_EX %r14
23
+ENDPROC(ftrace_stub)
2324
2425 #define STACK_FRAME_SIZE (STACK_FRAME_OVERHEAD + __PT_SIZE)
2526 #define STACK_PTREGS (STACK_FRAME_OVERHEAD)
....@@ -34,13 +35,16 @@
3435
3536 ENTRY(_mcount)
3637 BR_EX %r14
37
-
38
+ENDPROC(_mcount)
3839 EXPORT_SYMBOL(_mcount)
3940
4041 ENTRY(ftrace_caller)
4142 .globl ftrace_regs_caller
4243 .set ftrace_regs_caller,ftrace_caller
4344 stg %r14,(__SF_GPRS+8*8)(%r15) # save traced function caller
45
+ lghi %r14,0 # save condition code
46
+ ipm %r14 # don't put any instructions
47
+ sllg %r14,%r14,16 # clobbering CC before this point
4448 lgr %r1,%r15
4549 #if !(defined(CC_USING_HOTPATCH) || defined(CC_USING_NOP_MCOUNT))
4650 aghi %r0,MCOUNT_RETURN_FIXUP
....@@ -53,6 +57,9 @@
5357 # allocate pt_regs and stack frame for ftrace_trace_function
5458 aghi %r15,-STACK_FRAME_SIZE
5559 stg %r1,(STACK_PTREGS_GPRS+15*8)(%r15)
60
+ stg %r14,(STACK_PTREGS_PSW)(%r15)
61
+ lg %r14,(__SF_GPRS+8*8)(%r1) # restore original return address
62
+ stosm (STACK_PTREGS_PSW)(%r15),0
5663 aghi %r1,-TRACED_FUNC_FRAME_SIZE
5764 stg %r1,__SF_BACKCHAIN(%r15)
5865 stg %r0,(STACK_PTREGS_PSW+8)(%r15)
....@@ -75,10 +82,11 @@
7582 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
7683 # The j instruction gets runtime patched to a nop instruction.
7784 # See ftrace_enable_ftrace_graph_caller.
78
-ENTRY(ftrace_graph_caller)
85
+ .globl ftrace_graph_caller
86
+ftrace_graph_caller:
7987 j ftrace_graph_caller_end
80
- lg %r2,(STACK_PTREGS_GPRS+14*8)(%r15)
81
- lg %r3,(STACK_PTREGS_PSW+8)(%r15)
88
+ lmg %r2,%r3,(STACK_PTREGS_GPRS+14*8)(%r15)
89
+ lg %r4,(STACK_PTREGS_PSW+8)(%r15)
8290 brasl %r14,prepare_ftrace_return
8391 stg %r2,(STACK_PTREGS_GPRS+14*8)(%r15)
8492 ftrace_graph_caller_end:
....@@ -87,6 +95,7 @@
8795 lg %r1,(STACK_PTREGS_PSW+8)(%r15)
8896 lmg %r2,%r15,(STACK_PTREGS_GPRS+2*8)(%r15)
8997 BR_EX %r1
98
+ENDPROC(ftrace_caller)
9099
91100 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
92101
....@@ -100,5 +109,6 @@
100109 lgr %r14,%r2
101110 lmg %r2,%r5,32(%r15)
102111 BR_EX %r14
112
+ENDPROC(return_to_handler)
103113
104114 #endif