summaryrefslogtreecommitdiffstats
path: root/samples/ftrace/ftrace-direct-too.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2022-03-08 16:30:34 +0100
committerPeter Zijlstra <peterz@infradead.org>2022-03-15 10:32:38 +0100
commit0aec21cfb51bc1856206f312d8c13bf1f368d78e (patch)
tree27f8562227aea41fa3c75739c1dfe525df8c8261 /samples/ftrace/ftrace-direct-too.c
parentx86/ibt,bpf: Add ENDBR instructions to prologue and trampoline (diff)
downloadlinux-0aec21cfb51bc1856206f312d8c13bf1f368d78e.tar.xz
linux-0aec21cfb51bc1856206f312d8c13bf1f368d78e.zip
x86/ibt,ftrace: Add ENDBR to samples/ftrace
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Link: https://lore.kernel.org/r/20220308154318.523421433@infradead.org
Diffstat (limited to 'samples/ftrace/ftrace-direct-too.c')
-rw-r--r--samples/ftrace/ftrace-direct-too.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/samples/ftrace/ftrace-direct-too.c b/samples/ftrace/ftrace-direct-too.c
index c93fb0e95173..6690468c5cc2 100644
--- a/samples/ftrace/ftrace-direct-too.c
+++ b/samples/ftrace/ftrace-direct-too.c
@@ -19,11 +19,14 @@ extern void my_tramp(void *);
#ifdef CONFIG_X86_64
+#include <asm/ibt.h>
+
asm (
" .pushsection .text, \"ax\", @progbits\n"
" .type my_tramp, @function\n"
" .globl my_tramp\n"
" my_tramp:"
+ ASM_ENDBR
" pushq %rbp\n"
" movq %rsp, %rbp\n"
" pushq %rdi\n"