diff options
author | Song Shuai <suagrfillet@gmail.com> | 2023-01-30 16:59:54 +0800 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2023-02-07 12:44:39 -0500 |
commit | 01678fbce3dd2e3042077cf71b68157e733614a0 (patch) | |
tree | 2858675dc8038423237158bfac5701026eab37cf /samples/ftrace/ftrace-direct-too.c | |
parent | a9c4bdd505630469f93f5efedfc7a9ca254996c8 (diff) | |
download | linux-01678fbce3dd2e3042077cf71b68157e733614a0.tar.gz linux-01678fbce3dd2e3042077cf71b68157e733614a0.tar.bz2 linux-01678fbce3dd2e3042077cf71b68157e733614a0.zip |
samples: ftrace: Include the nospec-branch.h only for x86
When other architectures without the nospec functionality write their
direct-call functions of samples/ftrace/*.c, the including of
asm/nospec-branch.h must be taken care to fix the no header file found
error in building process.
This commit (ee3e2469b346 "x86/ftrace: Make it call depth tracking aware")
file-globally includes asm/nospec-branch.h providing CALL_DEPTH_ACCOUNT
for only x86 direct-call functions.
It seems better to move the including to `#ifdef CONFIG_X86_64`.
Link: https://lore.kernel.org/linux-trace-kernel/20230130085954.647845-1-suagrfillet@gmail.com
Signed-off-by: Song Shuai <suagrfillet@gmail.com>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'samples/ftrace/ftrace-direct-too.c')
-rw-r--r-- | samples/ftrace/ftrace-direct-too.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/ftrace/ftrace-direct-too.c b/samples/ftrace/ftrace-direct-too.c index e13fb59a2b47..8139dce2a31c 100644 --- a/samples/ftrace/ftrace-direct-too.c +++ b/samples/ftrace/ftrace-direct-too.c @@ -4,7 +4,6 @@ #include <linux/mm.h> /* for handle_mm_fault() */ #include <linux/ftrace.h> #include <asm/asm-offsets.h> -#include <asm/nospec-branch.h> extern void my_direct_func(struct vm_area_struct *vma, unsigned long address, unsigned int flags); @@ -21,6 +20,7 @@ extern void my_tramp(void *); #ifdef CONFIG_X86_64 #include <asm/ibt.h> +#include <asm/nospec-branch.h> asm ( " .pushsection .text, \"ax\", @progbits\n" |