This repository was archived by the owner on Oct 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 88#include <asm/segment.h>
99#include <asm/export.h>
1010#include <asm/ftrace.h>
11+ #include <asm/nospec-branch.h>
1112
1213#ifdef CC_USING_FENTRY
1314# define function_hook __fentry__
@@ -197,7 +198,8 @@ ftrace_stub:
197198 movl 0x4 (%ebp ), %edx
198199 subl $MCOUNT_INSN_SIZE, %eax
199200
200- call *ftrace_trace_function
201+ movl ftrace_trace_function, %ecx
202+ CALL_NOSPEC %ecx
201203
202204 popl %edx
203205 popl %ecx
@@ -241,5 +243,5 @@ return_to_handler:
241243 movl %eax , %ecx
242244 popl %edx
243245 popl %eax
244- jmp * %ecx
246+ JMP_NOSPEC %ecx
245247#endif
Original file line number Diff line number Diff line change 77#include <asm/ptrace.h>
88#include <asm/ftrace.h>
99#include <asm/export.h>
10-
10+ #include <asm/nospec-branch.h>
1111
1212 .code64
1313 .section .entry.text, "ax"
@@ -286,8 +286,8 @@ trace:
286286 * ip and parent ip are used and the list function is called when
287287 * function tracing is enabled.
288288 */
289- call * ftrace_trace_function
290-
289+ movq ftrace_trace_function, %r8
290+ CALL_NOSPEC %r8
291291 restore_mcount_regs
292292
293293 jmp fgraph_trace
@@ -329,5 +329,5 @@ GLOBAL(return_to_handler)
329329 movq 8 (%rsp ), %rdx
330330 movq (%rsp ), %rax
331331 addq $24 , %rsp
332- jmp * %rdi
332+ JMP_NOSPEC %rdi
333333#endif
You can’t perform that action at this time.
0 commit comments