From b5e51ef787660bffe9cd059e7abe32f3b1667a98 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Mon, 8 Dec 2025 21:06:58 +0100 Subject: [PATCH 1/3] bug: Let report_bug_entry() provide the correct bugaddr report_bug_entry() always provides zero for bugaddr but could easily extract the correct address from the provided bug_entry. Just do that to have proper warning messages. E.g. adding an artificial: void foo(void) { WARN_ONCE(1, "bar"); } function generates this warning message: WARNING: arch/s390/kernel/setup.c:1017 at 0x0, CPU#0: swapper/0/0 ^^^ With the correct bug address this changes to: WARNING: arch/s390/kernel/setup.c:1017 at foo+0x1c/0x40, CPU#0: swapper/0/0 ^^^^^^^^^^^^^ Fixes: 7d2c27a0ec5e ("bug: Add report_bug_entry()") Signed-off-by: Heiko Carstens Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://patch.msgid.link/20251208200658.3431511-1-hca@linux.ibm.com --- lib/bug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bug.c b/lib/bug.c index edd9041f89f3..c6f691f3d42d 100644 --- a/lib/bug.c +++ b/lib/bug.c @@ -262,7 +262,7 @@ enum bug_trap_type report_bug_entry(struct bug_entry *bug, struct pt_regs *regs) bool rcu = false; rcu = warn_rcu_enter(); - ret = __report_bug(bug, 0, regs); + ret = __report_bug(bug, bug_addr(bug), regs); warn_rcu_exit(rcu); return ret; From d36067d6ea00827e9b8fc087d8216710cb99b3cf Mon Sep 17 00:00:00 2001 From: Brendan Jackman Date: Sun, 7 Dec 2025 03:53:18 +0000 Subject: [PATCH 2/3] bug: Hush suggest-attribute=format for __warn_printf() Recent additions to this function cause GCC 14.3.0 to get excited (W=1) and suggest a missing attribute: lib/bug.c: In function '__warn_printf': lib/bug.c:187:25: error: function '__warn_printf' be a candidate for 'gnu_printf' format attribute [-Werror=suggest-attribute=format] 187 | vprintk(fmt, *args); | ^~~~~~~ Disable the diagnostic locally, following the pattern used for stuff like va_format(). Fixes: 5c47b7f3d1a9 ("bug: Add BUG_FORMAT_ARGS infrastructure") Signed-off-by: Brendan Jackman Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://patch.msgid.link/20251207-warn-printf-gcc-v1-1-b597d612b94b@google.com --- lib/bug.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/bug.c b/lib/bug.c index c6f691f3d42d..623c467a8b76 100644 --- a/lib/bug.c +++ b/lib/bug.c @@ -173,6 +173,9 @@ struct bug_entry *find_bug(unsigned long bugaddr) return module_find_bug(bugaddr); } +__diag_push(); +__diag_ignore(GCC, all, "-Wsuggest-attribute=format", + "Not a valid __printf() conversion candidate."); static void __warn_printf(const char *fmt, struct pt_regs *regs) { if (!fmt) @@ -192,6 +195,7 @@ static void __warn_printf(const char *fmt, struct pt_regs *regs) printk("%s", fmt); } +__diag_pop(); static enum bug_trap_type __report_bug(struct bug_entry *bug, unsigned long bugaddr, struct pt_regs *regs) { From bdae29d6512ddc589200b9ae6bda467bdbab863d Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Fri, 5 Dec 2025 10:07:53 +0000 Subject: [PATCH 3/3] rseq: Always inline rseq_debug_syscall_return() To get the full benefit of: eaa9088d568c ("rseq: Use static branch for syscall exit debug when GENERIC_IRQ_ENTRY=y") clang needs an __always_inline instead of a plain inline qualifier: $ for i in {1..10}; do taskset -c 4 perf5 bench syscall basic -l 100000000 | grep "ops/sec"; done Before After ops/sec 15424491 15872221 +2.9% Signed-off-by: Eric Dumazet Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Reviewed-by: Mathieu Desnoyers Link: https://patch.msgid.link/20251205100753.4073221-1-edumazet@google.com --- include/linux/rseq_entry.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/rseq_entry.h b/include/linux/rseq_entry.h index c92167ff8a7f..a36b472627de 100644 --- a/include/linux/rseq_entry.h +++ b/include/linux/rseq_entry.h @@ -596,7 +596,7 @@ static __always_inline void rseq_exit_to_user_mode_legacy(void) void __rseq_debug_syscall_return(struct pt_regs *regs); -static inline void rseq_debug_syscall_return(struct pt_regs *regs) +static __always_inline void rseq_debug_syscall_return(struct pt_regs *regs) { if (static_branch_unlikely(&rseq_debug_enabled)) __rseq_debug_syscall_return(regs);