Commit b5f1fc31 authored by Peter Zijlstra's avatar Peter Zijlstra

x86/ftrace: Remove ftrace_epilogue()

Remove the weird jumps to RET and simply use RET.

This then promotes ftrace_stub() to a real function; which becomes
important for kcfi.
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220915111148.719080593@infradead.orgSigned-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
parent 67bf6493
...@@ -172,20 +172,14 @@ SYM_INNER_LABEL(ftrace_call, SYM_L_GLOBAL) ...@@ -172,20 +172,14 @@ SYM_INNER_LABEL(ftrace_call, SYM_L_GLOBAL)
*/ */
SYM_INNER_LABEL(ftrace_caller_end, SYM_L_GLOBAL) SYM_INNER_LABEL(ftrace_caller_end, SYM_L_GLOBAL)
ANNOTATE_NOENDBR ANNOTATE_NOENDBR
RET
jmp ftrace_epilogue
SYM_FUNC_END(ftrace_caller); SYM_FUNC_END(ftrace_caller);
STACK_FRAME_NON_STANDARD_FP(ftrace_caller) STACK_FRAME_NON_STANDARD_FP(ftrace_caller)
SYM_FUNC_START(ftrace_epilogue) SYM_FUNC_START(ftrace_stub)
/*
* This is weak to keep gas from relaxing the jumps.
*/
SYM_INNER_LABEL_ALIGN(ftrace_stub, SYM_L_WEAK)
UNWIND_HINT_FUNC UNWIND_HINT_FUNC
ENDBR
RET RET
SYM_FUNC_END(ftrace_epilogue) SYM_FUNC_END(ftrace_stub)
SYM_FUNC_START(ftrace_regs_caller) SYM_FUNC_START(ftrace_regs_caller)
/* Save the current flags before any operations that can change them */ /* Save the current flags before any operations that can change them */
...@@ -262,14 +256,11 @@ SYM_INNER_LABEL(ftrace_regs_caller_jmp, SYM_L_GLOBAL) ...@@ -262,14 +256,11 @@ SYM_INNER_LABEL(ftrace_regs_caller_jmp, SYM_L_GLOBAL)
popfq popfq
/* /*
* As this jmp to ftrace_epilogue can be a short jump * The trampoline will add the return.
* it must not be copied into the trampoline.
* The trampoline will add the code to jump
* to the return.
*/ */
SYM_INNER_LABEL(ftrace_regs_caller_end, SYM_L_GLOBAL) SYM_INNER_LABEL(ftrace_regs_caller_end, SYM_L_GLOBAL)
ANNOTATE_NOENDBR ANNOTATE_NOENDBR
jmp ftrace_epilogue RET
/* Swap the flags with orig_rax */ /* Swap the flags with orig_rax */
1: movq MCOUNT_REG_SIZE(%rsp), %rdi 1: movq MCOUNT_REG_SIZE(%rsp), %rdi
...@@ -280,7 +271,7 @@ SYM_INNER_LABEL(ftrace_regs_caller_end, SYM_L_GLOBAL) ...@@ -280,7 +271,7 @@ SYM_INNER_LABEL(ftrace_regs_caller_end, SYM_L_GLOBAL)
/* Restore flags */ /* Restore flags */
popfq popfq
UNWIND_HINT_FUNC UNWIND_HINT_FUNC
jmp ftrace_epilogue RET
SYM_FUNC_END(ftrace_regs_caller) SYM_FUNC_END(ftrace_regs_caller)
STACK_FRAME_NON_STANDARD_FP(ftrace_regs_caller) STACK_FRAME_NON_STANDARD_FP(ftrace_regs_caller)
......
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