From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8535A28750A for ; Mon, 8 Dec 2025 20:27:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765225632; cv=none; b=gxMEpR++2sstxtg4AmAQUWt0HnVMZobcG+rAjzwgsjWtt8my62r0xwabUWBzRnzLPbocKYHOT1jsuAh/t7ZHfJuW39Qhr8ApApqTW98rLit0ulLqnT4aw4BL2uv7+ZQojusdXk7IEw4WpO4NFe2c4+1BR62kISBX7ZqTIBDSwK4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765225632; c=relaxed/simple; bh=e++F03d+y1c+KsY+nLKT2wwxG2VrEjeDHeQwd7jXhBI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RTxkAuwwqcpgmL/CDR6A84TWqqoxuocj0o7ky/8QkKAS/wwdu4CUcNyVdSOgcbXXAsdjg+g7KxpAYE96KnhOzQb5sQd5tzWQYMjYKq0tFypdEMi1bhA8OZPQH6djC2Jb+vAeGuqbG5Ev1j1LYMaYA2PsLr0GZ+69m10lzu8u3yw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=IOSC6ZJk; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="IOSC6ZJk" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=De3RAKy9brSHURpEL0MxgAft/9IfYYDEwIQN9bNE6g4=; b=IOSC6ZJkLssjxWeBWq8Cd2cZx7 WQzqkRMgvxgHxhcg/NPUMnMzccwbwNzweUd0DM5el3AnzWuCbTXKVMHjmX15B+xRAjwQgqeASSnbD poSeb3ngfxqXihSrmb9m5x7kzICNUXIoJE+nmgMK9lga/h/TB/GaB4EuXKKeuUPgkcTd4QGjU1qKA BtlwFRc0teaOoTVpxMt95NzkKucv/2i5J1J7mY7C/W4hxoFuSmr0610W8EVPyesHBsD5iSE/R2Jw5 9TYeP0g5n+24U9MWTSy34H2RWPBkTCZfui2grT7AMmLY8zqn2MV7ZI6GT29hifN1LKHWPiDJgbmE0 UycIbxzg==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vSgxY-0000000Aj5w-23q2; Mon, 08 Dec 2025 19:31:48 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 8E16E30306F; Mon, 08 Dec 2025 21:27:05 +0100 (CET) Date: Mon, 8 Dec 2025 21:27:05 +0100 From: Peter Zijlstra To: Heiko Carstens Cc: Josh Poimboeuf , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH] bug: Let report_but_entry() provide the correct bugaddr Message-ID: <20251208202705.GH3707891@noisy.programming.kicks-ass.net> References: <20251208200658.3431511-1-hca@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251208200658.3431511-1-hca@linux.ibm.com> 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 > --- > 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 >