Merge tag 'x86-urgent-2022-04-03' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / samples / ftrace / ftrace-direct-modify.c
index 2c7c318..39146fa 100644 (file)
@@ -24,20 +24,25 @@ static unsigned long my_ip = (unsigned long)schedule;
 
 #ifdef CONFIG_X86_64
 
+#include <asm/ibt.h>
+
 asm (
 "      .pushsection    .text, \"ax\", @progbits\n"
 "      .type           my_tramp1, @function\n"
 "      .globl          my_tramp1\n"
 "   my_tramp1:"
+       ASM_ENDBR
 "      pushq %rbp\n"
 "      movq %rsp, %rbp\n"
 "      call my_direct_func1\n"
 "      leave\n"
 "      .size           my_tramp1, .-my_tramp1\n"
        ASM_RET
+
 "      .type           my_tramp2, @function\n"
 "      .globl          my_tramp2\n"
 "   my_tramp2:"
+       ASM_ENDBR
 "      pushq %rbp\n"
 "      movq %rsp, %rbp\n"
 "      call my_direct_func2\n"