linux/arch/powerpc/kernel/trace
Hari Bathini db54c28702 powerpc64/ftrace: workaround clang recording GEP in __patchable_function_entries
Support for -fpatchable-function-entry on ppc64le was added in Clang
with [1]. However, when no prefix NOPs are specified - as is the case
with CONFIG_PPC_FTRACE_OUT_OF_LINE - the first NOP is emitted at LEP,
but Clang records the Global Entry Point (GEP) unlike GCC which does
record the Local Entry Point (LEP). Issue [2] has been raised to align
Clang's behavior with GCC. As a temporary workaround to ensure ftrace
initialization works as expected with Clang, derive the LEP using
ppc_function_entry() for kernel symbols and by looking for the below
module GEP sequence for module addresses, until [2] is resolved:

	ld	r2, -8(r12)
	add	r2, r2, r12

[1] https://github.com/llvm/llvm-project/pull/151569
[2] https://github.com/llvm/llvm-project/issues/163706

Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260127084926.34497-4-hbathini@linux.ibm.com
2026-03-07 16:02:25 +05:30
..
Makefile powerpc/trace: Account for -fpatchable-function-entry support by toolchain 2024-10-31 11:00:52 +11:00
ftrace.c powerpc64/ftrace: workaround clang recording GEP in __patchable_function_entries 2026-03-07 16:02:25 +05:30
ftrace_64_pg.c powerpc/ftrace: Use RCU in all users of __module_text_address(). 2025-03-10 11:54:45 +01:00
ftrace_64_pg_entry.S powerpc/ftrace: Consolidate ftrace support into fewer files 2023-08-22 00:09:05 +10:00
ftrace_entry.S powerpc/ftrace: support CONFIG_FUNCTION_GRAPH_RETVAL 2025-09-16 16:13:00 +05:30
trace_clock.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00