Skip to content

Commit e434b08

Browse files
brooniectmarinas
authored andcommitted
arm64: ftrace: Correct annotation of ftrace_caller assembly
In an effort to clarify and simplify the annotation of assembly functions new macros have been introduced. These replace ENTRY and ENDPROC with two different annotations for normal functions and those with unusual calling conventions. The patchable function entry versions of ftrace_*_caller don't follow the usual AAPCS rules, pushing things onto the stack which they don't clean up, and therefore should be annotated as code rather than functions. Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
1 parent e2d591d commit e434b08

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

arch/arm64/kernel/entry-ftrace.S

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,17 @@
7575
add x29, sp, #S_STACKFRAME
7676
.endm
7777

78-
ENTRY(ftrace_regs_caller)
78+
SYM_CODE_START(ftrace_regs_caller)
7979
ftrace_regs_entry 1
8080
b ftrace_common
81-
ENDPROC(ftrace_regs_caller)
81+
SYM_CODE_END(ftrace_regs_caller)
8282

83-
ENTRY(ftrace_caller)
83+
SYM_CODE_START(ftrace_caller)
8484
ftrace_regs_entry 0
8585
b ftrace_common
86-
ENDPROC(ftrace_caller)
86+
SYM_CODE_END(ftrace_caller)
8787

88-
ENTRY(ftrace_common)
88+
SYM_CODE_START(ftrace_common)
8989
sub x0, x30, #AARCH64_INSN_SIZE // ip (callsite's BL insn)
9090
mov x1, x9 // parent_ip (callsite's LR)
9191
ldr_l x2, function_trace_op // op
@@ -122,17 +122,17 @@ ftrace_common_return:
122122
add sp, sp, #S_FRAME_SIZE + 16
123123

124124
ret x9
125-
ENDPROC(ftrace_common)
125+
SYM_CODE_END(ftrace_common)
126126

127127
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
128-
ENTRY(ftrace_graph_caller)
128+
SYM_CODE_START(ftrace_graph_caller)
129129
ldr x0, [sp, #S_PC]
130130
sub x0, x0, #AARCH64_INSN_SIZE // ip (callsite's BL insn)
131131
add x1, sp, #S_LR // parent_ip (callsite's LR)
132132
ldr x2, [sp, #S_FRAME_SIZE] // parent fp (callsite's FP)
133133
bl prepare_ftrace_return
134134
b ftrace_common_return
135-
ENDPROC(ftrace_graph_caller)
135+
SYM_CODE_END(ftrace_graph_caller)
136136
#endif
137137

138138
#else /* CONFIG_DYNAMIC_FTRACE_WITH_REGS */

0 commit comments

Comments
 (0)