Message ID | 20211011125059.3378646-1-sumit.garg@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v3] arm64: ftrace: use function_nocfi for _mcount as well | expand |
On Mon, 11 Oct 2021 18:20:59 +0530, Sumit Garg wrote: > Commit 800618f955a9 ("arm64: ftrace: use function_nocfi for ftrace_call") > only fixed address of ftrace_call but address of _mcount needs to be > fixed as well. Use function_nocfi() to get the actual address of _mcount > function as with CONFIG_CFI_CLANG, the compiler replaces function pointers > with jump table addresses which breaks dynamic ftrace as the address of > _mcount is replaced with the address of _mcount.cfi_jt. > > [...] Applied to arm64 (for-next/misc), thanks! [1/1] arm64: ftrace: use function_nocfi for _mcount as well https://git.kernel.org/arm64/c/de56379f21c7 Cheers,
diff --git a/arch/arm64/include/asm/ftrace.h b/arch/arm64/include/asm/ftrace.h index 91fa4baa1a93..347b0cc68f07 100644 --- a/arch/arm64/include/asm/ftrace.h +++ b/arch/arm64/include/asm/ftrace.h @@ -15,7 +15,7 @@ #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS #define ARCH_SUPPORTS_FTRACE_OPS 1 #else -#define MCOUNT_ADDR ((unsigned long)_mcount) +#define MCOUNT_ADDR ((unsigned long)function_nocfi(_mcount)) #endif /* The BL at the callsite's adjusted rec->ip */