Skip to content

Commit 3215de8

Browse files
author
Peter Zijlstra
committed
x86/ibt,ftrace: Annotate ftrace code patching
These are code patching sites, not indirect targets. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Link: https://lore.kernel.org/r/20220308154318.936599479@infradead.org
1 parent 3e3f069 commit 3215de8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arch/x86/kernel/ftrace_64.S

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ SYM_FUNC_START(ftrace_caller)
145145
movq %rcx, RSP(%rsp)
146146

147147
SYM_INNER_LABEL(ftrace_caller_op_ptr, SYM_L_GLOBAL)
148+
ANNOTATE_NOENDBR
148149
/* Load the ftrace_ops into the 3rd parameter */
149150
movq function_trace_op(%rip), %rdx
150151

@@ -155,6 +156,7 @@ SYM_INNER_LABEL(ftrace_caller_op_ptr, SYM_L_GLOBAL)
155156
movq $0, CS(%rsp)
156157

157158
SYM_INNER_LABEL(ftrace_call, SYM_L_GLOBAL)
159+
ANNOTATE_NOENDBR
158160
call ftrace_stub
159161

160162
/* Handlers can change the RIP */
@@ -169,6 +171,7 @@ SYM_INNER_LABEL(ftrace_call, SYM_L_GLOBAL)
169171
* layout here.
170172
*/
171173
SYM_INNER_LABEL(ftrace_caller_end, SYM_L_GLOBAL)
174+
ANNOTATE_NOENDBR
172175

173176
jmp ftrace_epilogue
174177
SYM_FUNC_END(ftrace_caller);
@@ -192,6 +195,7 @@ SYM_FUNC_START(ftrace_regs_caller)
192195
/* save_mcount_regs fills in first two parameters */
193196

194197
SYM_INNER_LABEL(ftrace_regs_caller_op_ptr, SYM_L_GLOBAL)
198+
ANNOTATE_NOENDBR
195199
/* Load the ftrace_ops into the 3rd parameter */
196200
movq function_trace_op(%rip), %rdx
197201

@@ -221,6 +225,7 @@ SYM_INNER_LABEL(ftrace_regs_caller_op_ptr, SYM_L_GLOBAL)
221225
leaq (%rsp), %rcx
222226

223227
SYM_INNER_LABEL(ftrace_regs_call, SYM_L_GLOBAL)
228+
ANNOTATE_NOENDBR
224229
call ftrace_stub
225230

226231
/* Copy flags back to SS, to restore them */
@@ -248,6 +253,7 @@ SYM_INNER_LABEL(ftrace_regs_call, SYM_L_GLOBAL)
248253
*/
249254
testq %rax, %rax
250255
SYM_INNER_LABEL(ftrace_regs_caller_jmp, SYM_L_GLOBAL)
256+
ANNOTATE_NOENDBR
251257
jnz 1f
252258

253259
restore_mcount_regs
@@ -261,6 +267,7 @@ SYM_INNER_LABEL(ftrace_regs_caller_jmp, SYM_L_GLOBAL)
261267
* to the return.
262268
*/
263269
SYM_INNER_LABEL(ftrace_regs_caller_end, SYM_L_GLOBAL)
270+
ANNOTATE_NOENDBR
264271
jmp ftrace_epilogue
265272

266273
/* Swap the flags with orig_rax */

0 commit comments

Comments
 (0)