Commit e434b08b authored by Mark Brown's avatar Mark Brown Committed by Catalin Marinas

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: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent e2d591d2
...@@ -75,17 +75,17 @@ ...@@ -75,17 +75,17 @@
add x29, sp, #S_STACKFRAME add x29, sp, #S_STACKFRAME
.endm .endm
ENTRY(ftrace_regs_caller) SYM_CODE_START(ftrace_regs_caller)
ftrace_regs_entry 1 ftrace_regs_entry 1
b ftrace_common b ftrace_common
ENDPROC(ftrace_regs_caller) SYM_CODE_END(ftrace_regs_caller)
ENTRY(ftrace_caller) SYM_CODE_START(ftrace_caller)
ftrace_regs_entry 0 ftrace_regs_entry 0
b ftrace_common b ftrace_common
ENDPROC(ftrace_caller) SYM_CODE_END(ftrace_caller)
ENTRY(ftrace_common) SYM_CODE_START(ftrace_common)
sub x0, x30, #AARCH64_INSN_SIZE // ip (callsite's BL insn) sub x0, x30, #AARCH64_INSN_SIZE // ip (callsite's BL insn)
mov x1, x9 // parent_ip (callsite's LR) mov x1, x9 // parent_ip (callsite's LR)
ldr_l x2, function_trace_op // op ldr_l x2, function_trace_op // op
...@@ -122,17 +122,17 @@ ftrace_common_return: ...@@ -122,17 +122,17 @@ ftrace_common_return:
add sp, sp, #S_FRAME_SIZE + 16 add sp, sp, #S_FRAME_SIZE + 16
ret x9 ret x9
ENDPROC(ftrace_common) SYM_CODE_END(ftrace_common)
#ifdef CONFIG_FUNCTION_GRAPH_TRACER #ifdef CONFIG_FUNCTION_GRAPH_TRACER
ENTRY(ftrace_graph_caller) SYM_CODE_START(ftrace_graph_caller)
ldr x0, [sp, #S_PC] ldr x0, [sp, #S_PC]
sub x0, x0, #AARCH64_INSN_SIZE // ip (callsite's BL insn) sub x0, x0, #AARCH64_INSN_SIZE // ip (callsite's BL insn)
add x1, sp, #S_LR // parent_ip (callsite's LR) add x1, sp, #S_LR // parent_ip (callsite's LR)
ldr x2, [sp, #S_FRAME_SIZE] // parent fp (callsite's FP) ldr x2, [sp, #S_FRAME_SIZE] // parent fp (callsite's FP)
bl prepare_ftrace_return bl prepare_ftrace_return
b ftrace_common_return b ftrace_common_return
ENDPROC(ftrace_graph_caller) SYM_CODE_END(ftrace_graph_caller)
#endif #endif
#else /* CONFIG_DYNAMIC_FTRACE_WITH_REGS */ #else /* CONFIG_DYNAMIC_FTRACE_WITH_REGS */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment