lkml.org 
[lkml]   [2021]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    Subject[PATCH 07/15] x86/ftrace: Use function_nocfi in MCOUNT_ADDR
    From
    With CONFIG_CFI_CLANG, the compiler replaces the __fentry__ address in
    MCOUNT_ADDR with the address of a CFI jump table. Use function_nocfi()
    to get the actual function address.

    Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
    ---
    arch/x86/include/asm/ftrace.h | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
    index 9f3130f40807..0b7567994f4a 100644
    --- a/arch/x86/include/asm/ftrace.h
    +++ b/arch/x86/include/asm/ftrace.h
    @@ -6,7 +6,7 @@
    #ifndef CC_USING_FENTRY
    # error Compiler does not support fentry?
    #endif
    -# define MCOUNT_ADDR ((unsigned long)(__fentry__))
    +# define MCOUNT_ADDR ((unsigned long)(function_nocfi(__fentry__)))
    #define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */

    #ifdef CONFIG_DYNAMIC_FTRACE
    --
    2.31.1.368.gbe11c130af-goog
    \
     
     \ /
      Last update: 2021-04-16 22:40    [W:4.699 / U:0.456 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site