Re: [RFC PATCH 9/9] arm64/debug: Mark debug exception helpers __always_inline
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Date: 2026-07-30 00:03:31
Also in:
linux-arm-kernel, linux-mm, lkml, llvm
On Wed, 29 Jul 2026 14:08:46 -0400 Steven Rostedt [off-list ref] wrote:
Masami, On Mon, 27 Jul 2026 12:25:48 +0000 Hongyan Xia [off-list ref] wrote:quoted
From: Hongyan Xia <redacted> Static inline should be enough to actually inline functions for most compilers, but my Clang-19 somehow thinks it's better to outline them. These tiny helpers then live in normal .text sections instead of .noinstr sections, violating noinstr. Mark them __always_inline so the compiler can never outline them. Signed-off-by: Hongyan Xia <redacted> --- arch/arm64/include/asm/esr.h | 2 +- arch/arm64/include/asm/percpu.h | 2 +- arch/arm64/include/asm/preempt.h | 4 ++-- arch/arm64/include/asm/ptrace.h | 4 ++-- arch/arm64/kernel/debug-monitors.c | 2 +- include/linux/kprobes.h | 8 ++++----Are you OK with this patch? If so, can you ack it?
Yeah, this patch looks good to me. Anyway these are expected to be inlined. Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> For other patches, Sashiko noted some comments, I need to check it. Thank you,
-- Stevequoted
6 files changed, 11 insertions(+), 11 deletions(-)[..]quoted
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 8c4f3bb24429..5880445ed0f0 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h@@ -384,17 +384,17 @@ static inline void kprobe_ftrace_kill(void) {} struct kprobe *get_kprobe(void *addr); /* kprobe_running() will just return the current_kprobe on this CPU */ -static inline struct kprobe *kprobe_running(void) +static __always_inline struct kprobe *kprobe_running(void) { return __this_cpu_read(current_kprobe); } -static inline void reset_current_kprobe(void) +static __always_inline void reset_current_kprobe(void) { __this_cpu_write(current_kprobe, NULL); } -static inline struct kprobe_ctlblk *get_kprobe_ctlblk(void) +static __always_inline struct kprobe_ctlblk *get_kprobe_ctlblk(void) { return this_cpu_ptr(&kprobe_ctlblk); }@@ -449,7 +449,7 @@ static inline struct kprobe *get_kprobe(void *addr) { return NULL; } -static inline struct kprobe *kprobe_running(void) +static __always_inline struct kprobe *kprobe_running(void) { return NULL; }
-- Masami Hiramatsu (Google) [off-list ref]