Skip to content

Commit

Permalink
x86/ftrace: Support objtool vmlinux.o validation in ftrace_64.S
Browse files Browse the repository at this point in the history
With objtool vmlinux.o validation of return_to_handler(), now that
objtool has visibility inside the retpoline, jumping from EMPTY state to
a proper function state results in a stack state mismatch.

return_to_handler() is actually quite normal despite the underlying
magic.  Just annotate it as a normal function.

Acked-by: Steven Rostedt (VMware) <[email protected]>
Signed-off-by: Josh Poimboeuf <[email protected]>
Link: https://lore.kernel.org/r/14f48e623f61dbdcd84cf27a56ed8ccae73199ef.1611263462.git.jpoimboe@redhat.com
  • Loading branch information
jpoimboe committed Jan 26, 2021
1 parent 8269485 commit 7cae4b1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions arch/x86/kernel/ftrace_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,7 @@ SYM_FUNC_START(ftrace_graph_caller)
retq
SYM_FUNC_END(ftrace_graph_caller)

SYM_CODE_START(return_to_handler)
UNWIND_HINT_EMPTY
SYM_FUNC_START(return_to_handler)
subq $24, %rsp

/* Save the return values */
Expand All @@ -350,5 +349,5 @@ SYM_CODE_START(return_to_handler)
movq (%rsp), %rax
addq $24, %rsp
JMP_NOSPEC rdi
SYM_CODE_END(return_to_handler)
SYM_FUNC_END(return_to_handler)
#endif

0 comments on commit 7cae4b1

Please sign in to comment.