[PATCH] arm64: move CFLAGS_REMOVE_insn.o to arch/arm64/lib/Makefile
Pengpeng Hou
hppiscas at 163.com
Thu Dec 3 18:01:41 PST 2026
The ftrace exclusion for insn.o is in arch/arm64/kernel, but the
instruction encoding object is now built in arch/arm64/lib.
Object-specific flag removal is evaluated in the directory building the
object.
Move the rule to the lib Makefile. This addresses the stale rule; it
does not establish that a particular tracing recursion has been
observed.
The issue was found by our static-analysis tool and manually reviewed.
Fixes: 72fd723694b6 ("arm64: Move instruction encoder/decoder under lib/")
Signed-off-by: Pengpeng Hou <hppiscas at 163.com>
---
The original patch was prepared with Gemini. Codex assisted with this
review and revision (Assisted-by: gpt 5).
Built the arm64 lib directory with Clang 18, W=1 and dynamic function
tracing enabled. The compiler command for insn.o included a
patchable-function-entry option before the change and did not include it
afterwards. This checks the object-specific rule, not a running tracer.
arch/arm64/kernel/Makefile | 1 -
arch/arm64/lib/Makefile | 2 ++
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
index fc5d1a0c38b3c74c2930b32a86bfaa95798baf49..442f628bf9ce062512eeafeb82c75ee2a2b73b60 100644
--- a/arch/arm64/kernel/Makefile
+++ b/arch/arm64/kernel/Makefile
@@ -6,7 +6,6 @@
CFLAGS_armv8_deprecated.o := -I$(src)
CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE)
-CFLAGS_REMOVE_insn.o = $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_return_address.o = $(CC_FLAGS_FTRACE)
# Remove stack protector to avoid triggering unneeded stack canary
diff --git a/arch/arm64/lib/Makefile b/arch/arm64/lib/Makefile
index 38ffd359123cc39f538cba0a718eae7406bbc700..1616be091886d8e30369fca656b97ac550062ab0 100644
--- a/arch/arm64/lib/Makefile
+++ b/arch/arm64/lib/Makefile
@@ -3,6 +3,8 @@
# KCSAN uses udelay for introducing watchpoint delay; avoid recursion.
KCSAN_SANITIZE_delay.o := n
+CFLAGS_REMOVE_insn.o = $(CC_FLAGS_FTRACE)
+
lib-y := clear_user.o delay.o copy_from_user.o \
copy_to_user.o copy_page.o \
csum.o insn.o memchr.o memcpy.o \
base-commit: d06ce6f1eb5eeffd4ebcfde345dc34a98131d106
More information about the linux-arm-kernel
mailing list