[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251208202705.GH3707891@noisy.programming.kicks-ass.net>
Date: Mon, 8 Dec 2025 21:27:05 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Heiko Carstens <hca@...ux.ibm.com>
Cc: Josh Poimboeuf <jpoimboe@...nel.org>, Ingo Molnar <mingo@...nel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] bug: Let report_but_entry() provide the correct bugaddr
On Mon, Dec 08, 2025 at 09:06:58PM +0100, Heiko Carstens wrote:
> 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
> ^^^^^^^^^^^^^
Indeed. I'll stick this with that W=1 build thing.
Thanks!
> Fixes: 7d2c27a0ec5e ("bug: Add report_bug_entry()")
> Signed-off-by: Heiko Carstens <hca@...ux.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;
> --
> 2.51.0
>
Powered by blists - more mailing lists