From nobody Wed Dec 17 07:08:04 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0590A20FAB4 for ; Thu, 27 Mar 2025 10:30:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071404; cv=none; b=Lptuoc5zqlJWySQwv9WNjbMnUbPij5aD4A9MC8H1T5prLW7n8CcXwIlitdbz9P6BfdkJz57INNmqy8o+6Hq0D6Kie0zb/6YzqIo3SB6JYxyvGUHjGOZAJIA4CSlmQv3Ue5OnRvngbbvYoJD4gPEicdaY3sqzlaghwOtg7jEu3ZA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071404; c=relaxed/simple; bh=H074XjrmWtzSuFHce5jj8Mm94I4RRwp0SASD9hzDHoo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YAUrP3xcUtpjLGeI7FBIf4gTufaEbgbYsgRbieVVPepTPY4Kyjx/ugnV87SxUrc2yyp1ctW7nhgFT3DWssZI8fTjc0Qd1PZPzqAtcu1kqy6NGpMIKS033TDoleeN+KdbCwoJwK+qsdAM7S22CiW/V/aKiwG47GsEEgzVhWD2gFY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YAevQ/7G; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YAevQ/7G" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45F8AC4CEDD; Thu, 27 Mar 2025 10:30:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743071403; bh=H074XjrmWtzSuFHce5jj8Mm94I4RRwp0SASD9hzDHoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YAevQ/7GlyVi5USJC3vG1zYnYTdCKA04mpM4sbIX0flGNAyG5G7yHYaB2OMbDpZ3G yKwQTf1/kIrp0fVfhJrqtfQ+6Lag3CdDy5ON8NSZIKRF+Bcj+Oxw3QdbnE1q3WDc8V t+QM9M/tPtQmg584kZZ2zkt3D69WSTcVLPQ+ox9AAeCHCYrT7OuviudNbOtbqsix5r SkpW0gUeJU9Vw/jlIMRxmc90MF9VSog60y+gpw5OsUKp0JXTz4C8O71lxoqas7+c82 RUFBVF0W1y5nF2BUEpD/1ExqbsOnV+4CrbOd02M0231gF//N9mPLWumfBtJK6rpRjl /LPnievlRqyoQ== From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Peter Zijlstra Subject: [PATCH 01/14] bugs/core: Extend __WARN_FLAGS() with the 'cond_str' parameter Date: Thu, 27 Mar 2025 11:29:40 +0100 Message-ID: <20250327102953.813608-2-mingo@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250327102953.813608-1-mingo@kernel.org> References: <20250327102953.813608-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Push the new parameter down into every architecture that defines __WARN_FLA= GS(): arm64 loongarch parisc powerpc riscv s390 sh x86 Don't pass anything substantial down yet, just propagate the new parameter with empty strings, without generating it or using it. ( The string is never NULL, so it can be concatenated at the preprocessor level. ) Signed-off-by: Ingo Molnar Cc: --- arch/arm64/include/asm/bug.h | 2 +- arch/loongarch/include/asm/bug.h | 2 +- arch/parisc/include/asm/bug.h | 4 ++-- arch/powerpc/include/asm/bug.h | 2 +- arch/riscv/include/asm/bug.h | 2 +- arch/s390/include/asm/bug.h | 2 +- arch/sh/include/asm/bug.h | 2 +- arch/x86/include/asm/bug.h | 2 +- include/asm-generic/bug.h | 7 ++++--- 9 files changed, 13 insertions(+), 12 deletions(-) diff --git a/arch/arm64/include/asm/bug.h b/arch/arm64/include/asm/bug.h index 28be048db3f6..bceeaec21fb9 100644 --- a/arch/arm64/include/asm/bug.h +++ b/arch/arm64/include/asm/bug.h @@ -19,7 +19,7 @@ unreachable(); \ } while (0) =20 -#define __WARN_FLAGS(flags) __BUG_FLAGS(BUGFLAG_WARNING|(flags)) +#define __WARN_FLAGS(cond_str, flags) __BUG_FLAGS(BUGFLAG_WARNING|(flags)) =20 #define HAVE_ARCH_BUG =20 diff --git a/arch/loongarch/include/asm/bug.h b/arch/loongarch/include/asm/= bug.h index f6f254f2c5db..51c2cb98d728 100644 --- a/arch/loongarch/include/asm/bug.h +++ b/arch/loongarch/include/asm/bug.h @@ -42,7 +42,7 @@ asm_inline volatile (__stringify(ASM_BUG_FLAGS(flags)) \ extra); =20 -#define __WARN_FLAGS(flags) \ +#define __WARN_FLAGS(cond_str, flags) \ do { \ instrumentation_begin(); \ __BUG_FLAGS(BUGFLAG_WARNING|(flags), ANNOTATE_REACHABLE(10001b));\ diff --git a/arch/parisc/include/asm/bug.h b/arch/parisc/include/asm/bug.h index 833555f74ffa..1a87cf80ec3c 100644 --- a/arch/parisc/include/asm/bug.h +++ b/arch/parisc/include/asm/bug.h @@ -50,7 +50,7 @@ #endif =20 #ifdef CONFIG_DEBUG_BUGVERBOSE -#define __WARN_FLAGS(flags) \ +#define __WARN_FLAGS(cond_str, flags) \ do { \ asm volatile("\n" \ "1:\t" PARISC_BUG_BREAK_ASM "\n" \ @@ -66,7 +66,7 @@ "i" (sizeof(struct bug_entry)) ); \ } while(0) #else -#define __WARN_FLAGS(flags) \ +#define __WARN_FLAGS(cond_str, flags) \ do { \ asm volatile("\n" \ "1:\t" PARISC_BUG_BREAK_ASM "\n" \ diff --git a/arch/powerpc/include/asm/bug.h b/arch/powerpc/include/asm/bug.h index 1db485aacbd9..34d39ec79720 100644 --- a/arch/powerpc/include/asm/bug.h +++ b/arch/powerpc/include/asm/bug.h @@ -72,7 +72,7 @@ } while (0) #define HAVE_ARCH_BUG =20 -#define __WARN_FLAGS(flags) BUG_ENTRY("twi 31, 0, 0", BUGFLAG_WARNING | (f= lags)) +#define __WARN_FLAGS(cond_str, flags) BUG_ENTRY("twi 31, 0, 0", BUGFLAG_WA= RNING | (flags)) =20 #ifdef CONFIG_PPC64 #define BUG_ON(x) do { \ diff --git a/arch/riscv/include/asm/bug.h b/arch/riscv/include/asm/bug.h index 1aaea81fb141..b22ee4d2c882 100644 --- a/arch/riscv/include/asm/bug.h +++ b/arch/riscv/include/asm/bug.h @@ -76,7 +76,7 @@ do { \ unreachable(); \ } while (0) =20 -#define __WARN_FLAGS(flags) __BUG_FLAGS(BUGFLAG_WARNING|(flags)) +#define __WARN_FLAGS(cond_str, flags) __BUG_FLAGS(BUGFLAG_WARNING|(flags)) =20 #define HAVE_ARCH_BUG =20 diff --git a/arch/s390/include/asm/bug.h b/arch/s390/include/asm/bug.h index c500d45fb465..ef3e495ec1e3 100644 --- a/arch/s390/include/asm/bug.h +++ b/arch/s390/include/asm/bug.h @@ -46,7 +46,7 @@ unreachable(); \ } while (0) =20 -#define __WARN_FLAGS(flags) do { \ +#define __WARN_FLAGS(cond_str, flags) do { \ __EMIT_BUG(BUGFLAG_WARNING|(flags)); \ } while (0) =20 diff --git a/arch/sh/include/asm/bug.h b/arch/sh/include/asm/bug.h index 05a485c4fabc..834c621ab249 100644 --- a/arch/sh/include/asm/bug.h +++ b/arch/sh/include/asm/bug.h @@ -52,7 +52,7 @@ do { \ unreachable(); \ } while (0) =20 -#define __WARN_FLAGS(flags) \ +#define __WARN_FLAGS(cond_str, flags) \ do { \ __asm__ __volatile__ ( \ "1:\t.short %O0\n" \ diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h index f0e9acf72547..413b86b876d9 100644 --- a/arch/x86/include/asm/bug.h +++ b/arch/x86/include/asm/bug.h @@ -92,7 +92,7 @@ do { \ * were to trigger, we'd rather wreck the machine in an attempt to get the * message out than not know about it. */ -#define __WARN_FLAGS(flags) \ +#define __WARN_FLAGS(cond_str, flags) \ do { \ __auto_type __flags =3D BUGFLAG_WARNING|(flags); \ instrumentation_begin(); \ diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 387720933973..af76e4a04b16 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h @@ -100,17 +100,18 @@ extern __printf(1, 2) void __warn_printk(const char *= fmt, ...); instrumentation_end(); \ } while (0) #else -#define __WARN() __WARN_FLAGS(BUGFLAG_TAINT(TAINT_WARN)) +#define __WARN() __WARN_FLAGS("", BUGFLAG_TAINT(TAINT_WARN)) #define __WARN_printf(taint, arg...) do { \ instrumentation_begin(); \ __warn_printk(arg); \ - __WARN_FLAGS(BUGFLAG_NO_CUT_HERE | BUGFLAG_TAINT(taint));\ + __WARN_FLAGS("", BUGFLAG_NO_CUT_HERE | BUGFLAG_TAINT(taint));\ instrumentation_end(); \ } while (0) #define WARN_ON_ONCE(condition) ({ \ int __ret_warn_on =3D !!(condition); \ if (unlikely(__ret_warn_on)) \ - __WARN_FLAGS(BUGFLAG_ONCE | \ + __WARN_FLAGS("", \ + BUGFLAG_ONCE | \ BUGFLAG_TAINT(TAINT_WARN)); \ unlikely(__ret_warn_on); \ }) --=20 2.45.2 From nobody Wed Dec 17 07:08:04 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B8097210F6A for ; Thu, 27 Mar 2025 10:30:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071405; cv=none; b=GD2efFSsrjhSFJEaV69xLPrJyrrZS6+tDyOl7GblClUznSev99fnnAXLxeTrSYleJuV2EDOpwHAyaTjodFRNUMNCZeQstOidaJfitpN33KD9kzh8ticMUUB1eixAvk7DokcjBDWgiSIRdxlxpOAajAk6DYx+WQdqYM+R/3yWQEA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071405; c=relaxed/simple; bh=tLoDff4noC9eDpa+e8BeKdNFYnRcpSD+Synn8gBfa78=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=REcNfP1yMwJujfJgHcxSnwh34FCuextRFAYqAY9SHN0jVsR7wysWsDINPWXL9p6hraslkqHFlF12ipcfxOrEG9qpO6W+rOz0FmAz20SD6gXxcRC69uOXP5Ekj6YQjwVBwbeFacrV2XeAD398FG/dyiLYRw924SCnk+tAQEN5Y7A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oOxdaWMZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oOxdaWMZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03286C4CEEB; Thu, 27 Mar 2025 10:30:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743071405; bh=tLoDff4noC9eDpa+e8BeKdNFYnRcpSD+Synn8gBfa78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oOxdaWMZ+xxyG/nIb3n9dzfYhJC+cY6vH6WdqUc+dCBfDzeoKHXpzo5HjTef6Nqf3 0AlPTeSIwmpljFw2sfUCIyqARRyyv3a8DvoLWdDlKK3c1Wp6f0QxoSmaDl4++OWehp nOvX9u7uI8L3SJGc/p41Ldm/niieTrTmNZN6w8oL2vjMUWT7XBmjTUS89ppTxeZjeU t/t5WOB6q9sWK1/WQFSqwYpYqj76fFnmVM6bEtO9XFvQDQWg26r4b0qVmZWktkoaa7 eBOWaZ7BikTNP1XNKDXYO5klMSPFbG4UG0rXwgJvnrhrR0iznOKu0P/F5N6tXd99rI 6KpgSGinfp04w== From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Peter Zijlstra Subject: [PATCH 02/14] bugs/core: Pass down the condition string of WARN_ON_ONCE(cond) warnings to __WARN_FLAGS() Date: Thu, 27 Mar 2025 11:29:41 +0100 Message-ID: <20250327102953.813608-3-mingo@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250327102953.813608-1-mingo@kernel.org> References: <20250327102953.813608-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Doing this will allow architecture code to store and print out this information as part of the WARN_ON and BUG_ON facilities. The format of the string is '[condition]', for example: WARN_ON_ONCE(idx < 0 && ptr); Will get the '[idx < 0 && ptr]' string literal passed down as 'cond_str' in __WARN_FLAGS(). Signed-off-by: Ingo Molnar Cc: --- include/asm-generic/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index af76e4a04b16..c8e7126bc26e 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h @@ -110,7 +110,7 @@ extern __printf(1, 2) void __warn_printk(const char *fm= t, ...); #define WARN_ON_ONCE(condition) ({ \ int __ret_warn_on =3D !!(condition); \ if (unlikely(__ret_warn_on)) \ - __WARN_FLAGS("", \ + __WARN_FLAGS("["#condition"] ", \ BUGFLAG_ONCE | \ BUGFLAG_TAINT(TAINT_WARN)); \ unlikely(__ret_warn_on); \ --=20 2.45.2 From nobody Wed Dec 17 07:08:04 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1862921129A for ; Thu, 27 Mar 2025 10:30:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071407; cv=none; b=hdLPbS7vdHqzrFl9RwzfODFMR5TU0W5zSc89TL65OWBsxh55PPhfuwlAhJSB6m+hD3KWKnCI+iTyhkMK4X+KkTEYkBJAjs+zHqXoQ6LDc8i6ZQZ5zlnHvJ4q8k6+ha4k9Iupo/MWWNvp765jOOtjXvTbpSFOrVYOa+i5RkzO170= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071407; c=relaxed/simple; bh=v63/wEjVZ21rpDvd+eA4iuuSMVSV/g81NATswursLNI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VxEPVFYsltBjjvbffPxLlB7AnQnlxUDSYUGiIvHbcoq+RtTUh13XSSn7tHs9xzHlmXTh7MxpPeD4i/TLo8Ky8AOvYwu31Au5x6rBajVCY+lVGHdlXDNcT+QENEsZ1VfSB/cgk+WDsEC8IznrBGr/JsfRFCiwCLjvioJKIQE9C7w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sRsrwCAy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sRsrwCAy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B54B5C4CEDD; Thu, 27 Mar 2025 10:30:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743071407; bh=v63/wEjVZ21rpDvd+eA4iuuSMVSV/g81NATswursLNI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sRsrwCAyCS4By0EDGYFw0TIzlBWWJatscWmWfWhvcJr85PxByorvPJ9f4ytOX0wGE eDKADyw+J1Fv0EIwaNRIhwDB3naVxpWAY0M1WgkzNGpzF6waZ9pZQm1ZcAjUH+tKkg s0VyV3ErhGZpa1UrdsaAW803kUdn6ZaF1LHZYlPTW9jwDVoQwPIA4dh865i3VD7y8P Z5NW3kwvPflHUf8WlqyuDQqxsAcVdukqIME8qPlUsvEXF4xCxCGnE7mPNC3dIg4noA m4CsaIPX+DCHEhogLLrPXLGWncYgrZf8SAbNSQqIsjP3DvKYSHIpRVl26cfnQCF0xX dlK1xr7GTYWeQ== From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Peter Zijlstra Subject: [PATCH 03/14] bugs/x86: Extend _BUG_FLAGS() with the 'cond_str' parameter Date: Thu, 27 Mar 2025 11:29:42 +0100 Message-ID: <20250327102953.813608-4-mingo@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250327102953.813608-1-mingo@kernel.org> References: <20250327102953.813608-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Just pass down the parameter, don't do anything with it yet. Signed-off-by: Ingo Molnar Cc: --- arch/x86/include/asm/bug.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h index 413b86b876d9..aff1c6b7a7f3 100644 --- a/arch/x86/include/asm/bug.h +++ b/arch/x86/include/asm/bug.h @@ -39,7 +39,7 @@ =20 #ifdef CONFIG_DEBUG_BUGVERBOSE =20 -#define _BUG_FLAGS(ins, flags, extra) \ +#define _BUG_FLAGS(cond_str, ins, flags, extra) \ do { \ asm_inline volatile("1:\t" ins "\n" \ ".pushsection __bug_table,\"aw\"\n" \ @@ -57,7 +57,7 @@ do { \ =20 #else /* !CONFIG_DEBUG_BUGVERBOSE */ =20 -#define _BUG_FLAGS(ins, flags, extra) \ +#define _BUG_FLAGS(cond_str, ins, flags, extra) \ do { \ asm_inline volatile("1:\t" ins "\n" \ ".pushsection __bug_table,\"aw\"\n" \ @@ -74,7 +74,7 @@ do { \ =20 #else =20 -#define _BUG_FLAGS(ins, flags, extra) asm volatile(ins) +#define _BUG_FLAGS(cond_str, ins, flags, extra) asm volatile(ins) =20 #endif /* CONFIG_GENERIC_BUG */ =20 @@ -82,7 +82,7 @@ do { \ #define BUG() \ do { \ instrumentation_begin(); \ - _BUG_FLAGS(ASM_UD2, 0, ""); \ + _BUG_FLAGS("", ASM_UD2, 0, ""); \ __builtin_unreachable(); \ } while (0) =20 @@ -96,7 +96,7 @@ do { \ do { \ __auto_type __flags =3D BUGFLAG_WARNING|(flags); \ instrumentation_begin(); \ - _BUG_FLAGS(ASM_UD2, __flags, ANNOTATE_REACHABLE(1b)); \ + _BUG_FLAGS(cond_str, ASM_UD2, __flags, ANNOTATE_REACHABLE(1b)); \ instrumentation_end(); \ } while (0) =20 --=20 2.45.2 From nobody Wed Dec 17 07:08:04 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 39722210F4A for ; Thu, 27 Mar 2025 10:30:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071409; cv=none; b=WO2iacSOeroDoAuACpW36y3Q6Bf/PpX5WoxQMy9jRvSXul80c5NzK3Tcdcv8CYJ4Qrpz7vZhWa2Buf1FkodNnn5KAOphEr9Retbcxx2enk+tN3EW0sXtSb6trIvUHRfBCddMeW4AV4jyate28ColMTX/ZR/nDJowfrJvR/eUF74= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071409; c=relaxed/simple; bh=3aJ6T4I0hOstaWRJQ16Hr5v+WsyZZUl5P2e65fi6MxQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BY766NuKCmiwEwOq0Gv1kGnNGgb90n7yEvxg8XdPk568Rz0gB/PWOWv5Xkq9lfYX/rQpj2ozwl3GG+YxDjmfr1GsQIhDihCnOuGUkJRa8k+nuAgBN2NEdb525SjtycieYzNvb0ONXUBW8BY7r5KriL783bNQUu3JZaopLNvGLW0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lDA3hMvW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lDA3hMvW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74220C4CEEA; Thu, 27 Mar 2025 10:30:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743071408; bh=3aJ6T4I0hOstaWRJQ16Hr5v+WsyZZUl5P2e65fi6MxQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lDA3hMvWEnJ0W5ZTeCfKDG6TL4P6UUUKFAwHfIigGseQCJaqfV25bzloCTGyJbqfm aN+YRVHaGutZhtQ66IUdJ0NOQu1ncgjKWJblsUqKEM0BqIZqmvYNPG979lweT6i3wG On4KXXGXpVyIrLZIfcYmjW3rGzEKsuw8NMKo6sYA0JLvcZqHHlf7hX+qxZ/lMLs18M mNv9ohQL3FS7irbZ2ZzR/FVrOdLyb06SpJQdd/5aYU/5RqZ05aXmfyrWhY4/zF1mES ZrAGpPaxm78NqEuIWUucd4eZ/AfUz689x9C6Tly6dqW+J12a+zSzAe6NRcXS0vBFbc dNPXOv94AXG+g== From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Peter Zijlstra Subject: [PATCH 04/14] bugs/x86: Augment warnings output by concatenating 'cond_str' with the regular __FILE__ string in _BUG_FLAGS() Date: Thu, 27 Mar 2025 11:29:43 +0100 Message-ID: <20250327102953.813608-5-mingo@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250327102953.813608-1-mingo@kernel.org> References: <20250327102953.813608-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This allows the reuse of the UD2 based 'struct bug_entry' low-overhead _BUG_FLAGS() implementation and string-printing backend, without having to add a new field. An example: If we have the following WARN_ON_ONCE() in kernel/sched/core.c: WARN_ON_ONCE(idx < 0 && ptr); Then previously _BUG_FLAGS() would store this string in bug_entry::file: "kernel/sched/core.c" After this patch, it would store and print: "[idx < 0 && ptr] kernel/sched/core.c" Which is an extended string that will be printed in warnings. Suggested-by: Linus Torvalds Signed-off-by: Ingo Molnar Cc: --- arch/x86/include/asm/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h index aff1c6b7a7f3..e966199c8ef7 100644 --- a/arch/x86/include/asm/bug.h +++ b/arch/x86/include/asm/bug.h @@ -50,7 +50,7 @@ do { \ "\t.org 2b+%c3\n" \ ".popsection\n" \ extra \ - : : "i" (__FILE__), "i" (__LINE__), \ + : : "i" (cond_str __FILE__), "i" (__LINE__), \ "i" (flags), \ "i" (sizeof(struct bug_entry))); \ } while (0) --=20 2.45.2 From nobody Wed Dec 17 07:08:04 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 87274211712 for ; Thu, 27 Mar 2025 10:30:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071410; cv=none; b=n7mcX8g5A4oauCBOKEZveXeLoL1xqr5fGh9Fm0E2fauMZzLr3FXjFCAQMQY03f3FeQi4izAhKaWvs4Fygv333hr98wDMn5GO9yVhz6ZTlWcg92pBNIXp36Gt8psHmh05Tc2TimzFNR/HLpGAyngK5Jo0TTuj86w9uZfCPeUkWA8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071410; c=relaxed/simple; bh=lbZJml6REyBa5Wqf6whljObeSVlpAH/8U8yaPU9LXBQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fuW5SDMY6dCQXbnOtqIPp69w0oXeCC7t9YTdyQwCLcEDMwZK1R8JJgb1FoPywueq539OKAwDpiXtE/GTbqT7jW+fifIH7d2EFI+OmxPeE4j3UTvsh7flfJW5kgTg+YCMlzyU8RSzTbv01mBgJlNUMt/sH0xd+4gEdOLLMfzGGug= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YiFnNZke; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YiFnNZke" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33020C4CEDD; Thu, 27 Mar 2025 10:30:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743071410; bh=lbZJml6REyBa5Wqf6whljObeSVlpAH/8U8yaPU9LXBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YiFnNZkeI7JgpBv25HYkHSKNyzApg2CQ2eRNboSy/UcBlKzQW3qfCpQrI4xhgwLne UAEclnxYT9ZIT7TA6QQbEYjk3QmUMj/oLKJsokeR//XjU2nZcXAxK54Kggv/p+ImpN Kb9pXl+++HkJ3RFd3lkL16p0k9Bz+27Op6mMm1tUVvga8NxidAlXI5AfXiLU8y93hh 4vqv688S2ZnGiwtj+K+xuv1GhFDPLdzMInhyd7QE2Jswv7x6Poz1rhwJDfK96/LuYN NFzeYQhSTDKmYkNBvUA9aLvPSaNvBAOksMBVrS8X8gKMkHforFysVmWmZ+ql1NTSRf 3iuLxBmvHuveA== From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Peter Zijlstra Subject: [PATCH 05/14] bugs/powerpc: Pass in 'cond_str' to BUG_ENTRY() Date: Thu, 27 Mar 2025 11:29:44 +0100 Message-ID: <20250327102953.813608-6-mingo@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250327102953.813608-1-mingo@kernel.org> References: <20250327102953.813608-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Pass in the condition string from __WARN_FLAGS(), WARN_ON() and BUG_ON(), but don't use it yet. Signed-off-by: Ingo Molnar Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Naveen N Rao Cc: linuxppc-dev@lists.ozlabs.org Cc: --- arch/powerpc/include/asm/bug.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/bug.h b/arch/powerpc/include/asm/bug.h index 34d39ec79720..b5537ba176b5 100644 --- a/arch/powerpc/include/asm/bug.h +++ b/arch/powerpc/include/asm/bug.h @@ -51,7 +51,7 @@ ".previous\n" #endif =20 -#define BUG_ENTRY(insn, flags, ...) \ +#define BUG_ENTRY(cond_str, insn, flags, ...) \ __asm__ __volatile__( \ "1: " insn "\n" \ _EMIT_BUG_ENTRY \ @@ -67,12 +67,12 @@ */ =20 #define BUG() do { \ - BUG_ENTRY("twi 31, 0, 0", 0); \ + BUG_ENTRY("", "twi 31, 0, 0", 0); \ unreachable(); \ } while (0) #define HAVE_ARCH_BUG =20 -#define __WARN_FLAGS(cond_str, flags) BUG_ENTRY("twi 31, 0, 0", BUGFLAG_WA= RNING | (flags)) +#define __WARN_FLAGS(cond_str, flags) BUG_ENTRY(cond_str, "twi 31, 0, 0", = BUGFLAG_WARNING | (flags)) =20 #ifdef CONFIG_PPC64 #define BUG_ON(x) do { \ @@ -80,7 +80,7 @@ if (x) \ BUG(); \ } else { \ - BUG_ENTRY(PPC_TLNEI " %4, 0", 0, "r" ((__force long)(x))); \ + BUG_ENTRY(#x, PPC_TLNEI " %4, 0", 0, "r" ((__force long)(x))); \ } \ } while (0) =20 @@ -90,7 +90,7 @@ if (__ret_warn_on) \ __WARN(); \ } else { \ - BUG_ENTRY(PPC_TLNEI " %4, 0", \ + BUG_ENTRY(#x, PPC_TLNEI " %4, 0", \ BUGFLAG_WARNING | BUGFLAG_TAINT(TAINT_WARN), \ "r" (__ret_warn_on)); \ } \ --=20 2.45.2 From nobody Wed Dec 17 07:08:04 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 940D920F08F for ; Thu, 27 Mar 2025 10:30:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071412; cv=none; b=TeCcO0DP3DuRdvWjZwtbd7Bh6FTIuqOVO7ezzbSU2emuRp/BtDolCNQ+NCBqT3PkRSNGmnNZyEe5nvcTXwoezYY4ThbLk0YDJ1ZcF2jJpnJnhhUoeELSd3cLkpUq0sVb76bH0wJCfj5cj6tIh/J/fB2KtApvIimO8GHgSUVEUMo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071412; c=relaxed/simple; bh=qshCScgV/MqD57qKV2BMnny4UAyTRFWht447HRdrgdk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qn1r01mdGoMJ4mtUQvgVkemiSETCN6L1oErZHrEa49/rbuiIP/OWCOhsKVJy8KzmFzouI8w/GaSw0WNonpTCcxVax1aVWVrozvz9UOmVOIETe/PMTvzIXfcgzm+4WlynPImw5mIL72PPIzkr3fL77cpxEMkoV80he62Oc3SADxM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eF2n7WU9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eF2n7WU9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3427C4CEEB; Thu, 27 Mar 2025 10:30:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743071412; bh=qshCScgV/MqD57qKV2BMnny4UAyTRFWht447HRdrgdk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eF2n7WU9ZRoQp08tdF99Zheo0scKhzoO3o1/fpYgH/2/0hHbUmJx+/wAvZ3MXgNnN 2Zh35UYzIU/XAeMVmvB8E/0O3WSYAm53FnBTuC0Qdzmu1gsHAem0O6MuctvlR/ET5/ bfTvjw2KB4tHGV5RfPTIrI+bFteKZut71u0XL8mTGRzivv3EXTP1hIR1q5+54/jqok yXhC0GVWKh0l3etvTrkMCuT9vfNox+91zfHLTlPx1xoQXhEoS0yf8pY5rCNsoZm4gb PH7+7CiRtpG88vj7zWwcL1x3Yjr17ks3KPNjBbFFCmbs0y9cS9vSeTX2IY5XiVZbTl U14vre9vU/ciA== From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Peter Zijlstra Subject: [PATCH 06/14] bugs/powerpc: Concatenate 'cond_str' with '__FILE__' in BUG_ENTRY(), to extend WARN_ON/BUG_ON output Date: Thu, 27 Mar 2025 11:29:45 +0100 Message-ID: <20250327102953.813608-7-mingo@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250327102953.813608-1-mingo@kernel.org> References: <20250327102953.813608-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Extend WARN_ON and BUG_ON style output from: WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410 to: WARNING: CPU: 0 PID: 0 at [idx < 0 && ptr] kernel/sched/core.c:8511 sched= _init+0x20/0x410 Note that the output will be further reorganized later in this series. Signed-off-by: Ingo Molnar Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Naveen N Rao Cc: linuxppc-dev@lists.ozlabs.org Cc: --- arch/powerpc/include/asm/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/bug.h b/arch/powerpc/include/asm/bug.h index b5537ba176b5..a2120fbedd09 100644 --- a/arch/powerpc/include/asm/bug.h +++ b/arch/powerpc/include/asm/bug.h @@ -55,7 +55,7 @@ __asm__ __volatile__( \ "1: " insn "\n" \ _EMIT_BUG_ENTRY \ - : : "i" (__FILE__), "i" (__LINE__), \ + : : "i" (cond_str __FILE__), "i" (__LINE__), \ "i" (flags), \ "i" (sizeof(struct bug_entry)), \ ##__VA_ARGS__) --=20 2.45.2 From nobody Wed Dec 17 07:08:04 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0080920FA99 for ; Thu, 27 Mar 2025 10:30:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071414; cv=none; b=X1vfaeFURGewXq11Xv4JpruQLXoqUwE0tm27O1knc9kuijflaKMxIS+S7vPuX5IY23yWiwAdpZxpfVCoQ4ogV+xz2FA9GqjhKKkmZoAQXfEY4zn9A+l7/D0xZctiozrV9K3aDppnNCW8U3tuWouI40F6gDtgfZ30M0AAV5P3EuI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071414; c=relaxed/simple; bh=AwKLO6MlaTLedN7k+hdE1I2gJG0P/wVaqml4h5jIdvM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Si0hdCj1TtUGc4sBqVnrDgTJ016ZI/WgbAdo4xirc9QM+On/pn9TTR0aRThkcCMXn3wrzcxXSaGSHzVsXkHfkz76fJvLmIwX7xfHrsF9RKtiYBXYCWKPfkTT3pdWprWI3AYeOSjCAZbbp/Us14FtdANArkX2mm3DpB36p40WxpQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cjUQcAvQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cjUQcAvQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FD66C4CEDD; Thu, 27 Mar 2025 10:30:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743071413; bh=AwKLO6MlaTLedN7k+hdE1I2gJG0P/wVaqml4h5jIdvM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cjUQcAvQ8frxg9vUD0TSyfF2PgDrieeHXkiXGPnc5XeobxE9B4/q5TrBunzpKfQPk +DGkK0AvCMHk1PP6gAT/rZT4PWgkh5WhNoYkr56hXuBN99l97Y1hazSidm4nk9kIUU tJLfJM+41d+yfzDg4P7UH09TsDs3aTvV4BuYVY1sBLp5jOZPxS+/IXgPVAT3DZL31y pOPBXVtaRT9b0ZOZ53gwHZMp/E6n1cCWdfnxFoCGAKGqPkA6w81USxVxqp1wnG5Kk6 Lcbr/ypboGr7IzN4Xo3IxHEXYKFhEJLuWHFakkboNy3b+Ttf/RiP1AWxGjrZwMAPoi IjY247Td2z+qA== From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Peter Zijlstra Subject: [PATCH 07/14] bugs/LoongArch: Pass in 'cond_str' to __BUG_ENTRY() Date: Thu, 27 Mar 2025 11:29:46 +0100 Message-ID: <20250327102953.813608-8-mingo@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250327102953.813608-1-mingo@kernel.org> References: <20250327102953.813608-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Pass in the condition string from __WARN_FLAGS(), but don't use it yet. Signed-off-by: Ingo Molnar Cc: Huacai Chen Cc: WANG Xuerui Cc: Peter Zijlstra Cc: Josh Poimboeuf Cc: --- arch/loongarch/include/asm/bug.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/arch/loongarch/include/asm/bug.h b/arch/loongarch/include/asm/= bug.h index 51c2cb98d728..3c377984457d 100644 --- a/arch/loongarch/include/asm/bug.h +++ b/arch/loongarch/include/asm/bug.h @@ -20,39 +20,38 @@ #endif =20 #ifndef CONFIG_GENERIC_BUG -#define __BUG_ENTRY(flags) +#define __BUG_ENTRY(cond_str, flags) #else -#define __BUG_ENTRY(flags) \ +#define __BUG_ENTRY(cond_str, flags) \ .pushsection __bug_table, "aw"; \ .align 2; \ 10000: .long 10001f - .; \ _BUGVERBOSE_LOCATION(__FILE__, __LINE__) \ - .short flags; \ + .short flags; \ .popsection; \ 10001: #endif =20 -#define ASM_BUG_FLAGS(flags) \ - __BUG_ENTRY(flags) \ +#define ASM_BUG_FLAGS(cond_str, flags) \ + __BUG_ENTRY(cond_str, flags) \ break BRK_BUG; =20 -#define ASM_BUG() ASM_BUG_FLAGS(0) +#define ASM_BUG() ASM_BUG_FLAGS("", 0) =20 -#define __BUG_FLAGS(flags, extra) \ - asm_inline volatile (__stringify(ASM_BUG_FLAGS(flags)) \ - extra); +#define __BUG_FLAGS(cond_str, flags, extra) \ + asm_inline volatile (__stringify(ASM_BUG_FLAGS(cond_str, flags)) extra); =20 #define __WARN_FLAGS(cond_str, flags) \ do { \ instrumentation_begin(); \ - __BUG_FLAGS(BUGFLAG_WARNING|(flags), ANNOTATE_REACHABLE(10001b));\ + __BUG_FLAGS(cond_str, BUGFLAG_WARNING|(flags), ANNOTATE_REACHABLE(10001b)= );\ instrumentation_end(); \ } while (0) =20 #define BUG() \ do { \ instrumentation_begin(); \ - __BUG_FLAGS(0, ""); \ + __BUG_FLAGS("", 0, ""); \ unreachable(); \ } while (0) =20 --=20 2.45.2 From nobody Wed Dec 17 07:08:04 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 147D1212F94 for ; Thu, 27 Mar 2025 10:30:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071416; cv=none; b=fuypQ1WlAtnz0rSxtbsM7WwUCsX4BEtyya44pUpeoiix07Bp5oNBzSCT1qlpuQCUhZ/0Qrw9iIkHm0nzSmijbsAClXOTP+RqAQyFdCBvHdK+LV0RVfqinKMuLKi0dqthf6XjPrnrWIvGlmrMy1+A5TpCbGqPK6/NkByTLNavoYg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071416; c=relaxed/simple; bh=5mRPbd/my8fa7329JnbBsyhBO5PlHw3277AFB2PVQ2k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gKQG5KZe6Wx+U8Wwrw5re4mI+EIJ3fjhJmFRQQp+gRpmhG//fEKdx95UUTCX3+b/Gkw9AZF60l7fbkqiunkGeY0L425SPYrPyWhs4XC6vH9CWNkDKO96puQznpCWi+JNNY6xFpG92tZjkWSN1CjuePn3SArDY6lHQvOVDF7cosQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gyRoPkAC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gyRoPkAC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D068C4CEE8; Thu, 27 Mar 2025 10:30:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743071415; bh=5mRPbd/my8fa7329JnbBsyhBO5PlHw3277AFB2PVQ2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gyRoPkACBZL/HjyAxROOUtoj/sK0TE9wy0gGWW75LbsrgSsYuHLWrRQQQDZTMsXGx 6vGCAn5ztSN2qmlpg/ZhVU2MrWb+wofVQPXmvjyILJx3txW3y2Rwe18yIapTp64tR+ trzVOOHTsYppiz81JbZYWPEuUrpMAObZjNJmIcq6+SXoCwjIKaTTTsbqHBzoczXoxh e0PUaZ5VV/jhXrJeh++xEygOhla4KjGgkbwFtAsQRrnscn5kqID8dnPpP1kst99Fxo ueJEmfaHt3/OYNxDXXdy9Il7jE3FQ+QKnPq2QuvRGf+4frcZ1dUrgjtr/fPXjVvxM5 qlwLhtPXhRSsQ== From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Peter Zijlstra Subject: [PATCH 08/14] bugs/LoongArch: Concatenate 'cond_str' with '__FILE__' in __BUG_ENTRY(), to extend WARN_ON/BUG_ON output Date: Thu, 27 Mar 2025 11:29:47 +0100 Message-ID: <20250327102953.813608-9-mingo@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250327102953.813608-1-mingo@kernel.org> References: <20250327102953.813608-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Extend WARN_ON and BUG_ON style output from: WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410 to: WARNING: CPU: 0 PID: 0 at [idx < 0 && ptr] kernel/sched/core.c:8511 sched= _init+0x20/0x410 Note that the output will be further reorganized later in this series. Signed-off-by: Ingo Molnar Cc: Huacai Chen Cc: WANG Xuerui Cc: Peter Zijlstra Cc: Josh Poimboeuf Cc: --- arch/loongarch/include/asm/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/loongarch/include/asm/bug.h b/arch/loongarch/include/asm/= bug.h index 3c377984457d..305b3746c858 100644 --- a/arch/loongarch/include/asm/bug.h +++ b/arch/loongarch/include/asm/bug.h @@ -26,7 +26,7 @@ .pushsection __bug_table, "aw"; \ .align 2; \ 10000: .long 10001f - .; \ - _BUGVERBOSE_LOCATION(__FILE__, __LINE__) \ + _BUGVERBOSE_LOCATION(cond_str __FILE__, __LINE__) \ .short flags; \ .popsection; \ 10001: --=20 2.45.2 From nobody Wed Dec 17 07:08:04 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C1B10213236 for ; Thu, 27 Mar 2025 10:30:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071417; cv=none; b=O60eWNHzny7auyvBt+vBx78Ox3zD3SAEk3JHHmrPTm4McbVLVZQCH49BkliOe3GJW4zvu3mjvPMtXakwW2ASiTiNweznYr0C/aiNBGxxQ2XIlD78d4uyvbQXVTLlEYqIh9tjvdjTUwJYp3UQv826bts2TxKqxucLUqYeJMdHh3A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071417; c=relaxed/simple; bh=D0EBAcu5h+E8B+tSkeOpT9HaAEV4VC97bQRYTcVTptc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O1Jaxlw8id0Zr/k6qiFf0hvvRRcjsD7wqHTR85iwaw0YSs7GZGZzGl7YQhPUOJQtNky802FM48J+WTpty939ODhm3llQbs5vwQACfcVQoZCjfEanZHiGhcEQJDo1jEUV3LZ8AWTeqQ8qr1Ra72aFtRvmrgvVpRCVyk0mJHJstho= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pzDu2Qv2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pzDu2Qv2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A630C4CEEA; Thu, 27 Mar 2025 10:30:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743071417; bh=D0EBAcu5h+E8B+tSkeOpT9HaAEV4VC97bQRYTcVTptc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pzDu2Qv2Ne4ETr45QNd/lejf5XS8AsdaB+5e/DnVUb84LXYboqIYSRxNVzK1KOh+7 48RZjO3bmLtk3g85wyCGOxr/xNsw4ljOS3Y/VcS73MtJi+RWht52DUrv9XmLhd8brI 9ddtjHDIsSJEHlcNdTphsmmYoaV2hy7T1wmeynrsu1UDaXnJzuzqG29Og9NsQnYaBs Ubh+HE8VDAfT/6jQ+5yGc5lgjo/kvLKLSWqyBeZonhhdN+IoejO5T1KkQgyHppDNZS Llvr3eT4m37/H+4N0wvVExZsVXvLOA/z3Ks4x3yc/hxAOd9oo/pi3pECnIIse0LqNy Q8hIAMRKDj9zg== From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Peter Zijlstra Subject: [PATCH 09/14] bugs/s390: Pass in 'cond_str' to __EMIT_BUG() Date: Thu, 27 Mar 2025 11:29:48 +0100 Message-ID: <20250327102953.813608-10-mingo@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250327102953.813608-1-mingo@kernel.org> References: <20250327102953.813608-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Pass in the condition string from __WARN_FLAGS(), but do not concatenate it with __FILE__, because the __bug_table is apparently indexed by 16 bits and increasing string size overflows it on defconfig builds. Signed-off-by: Ingo Molnar Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: Sven Schnelle Cc: linux-s390@vger.kernel.org Cc: --- arch/s390/include/asm/bug.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/s390/include/asm/bug.h b/arch/s390/include/asm/bug.h index ef3e495ec1e3..30f8785a01f5 100644 --- a/arch/s390/include/asm/bug.h +++ b/arch/s390/include/asm/bug.h @@ -8,7 +8,7 @@ =20 #ifdef CONFIG_DEBUG_BUGVERBOSE =20 -#define __EMIT_BUG(x) do { \ +#define __EMIT_BUG(cond_str, x) do { \ asm_inline volatile( \ "0: mc 0,0\n" \ ".section .rodata.str,\"aMS\",@progbits,1\n" \ @@ -27,7 +27,7 @@ =20 #else /* CONFIG_DEBUG_BUGVERBOSE */ =20 -#define __EMIT_BUG(x) do { \ +#define __EMIT_BUG(cond_str, x) do { \ asm_inline volatile( \ "0: mc 0,0\n" \ ".section __bug_table,\"aw\"\n" \ @@ -42,12 +42,12 @@ #endif /* CONFIG_DEBUG_BUGVERBOSE */ =20 #define BUG() do { \ - __EMIT_BUG(0); \ + __EMIT_BUG("", 0); \ unreachable(); \ } while (0) =20 #define __WARN_FLAGS(cond_str, flags) do { \ - __EMIT_BUG(BUGFLAG_WARNING|(flags)); \ + __EMIT_BUG(cond_str, BUGFLAG_WARNING|(flags)); \ } while (0) =20 #define WARN_ON(x) ({ \ --=20 2.45.2 From nobody Wed Dec 17 07:08:04 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 84FA320FAA9 for ; Thu, 27 Mar 2025 10:30:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071419; cv=none; b=XxjUn6u4wZn1873q/JFCg4MpVrthNzRv/D0QyNVitM5Cxuc8HLfLCwlnZmCtXoNe+BRMejjGnPxi3HYNBhLX2+87e9dr0GkyoOeZyQWCWetnmQkQkV9mS9JSQM1RbTqAxM/wLMvsdLq+bcLpFt4Vbf9HvnDzbbekDJwOovGerUo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071419; c=relaxed/simple; bh=molGG3aPYi74hz9WVuXlbE1iJFE0MWmpVUKVIij8Ws4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lT/DDclUCFpyKCHnfVDxuwtnz2pVBPIYmcs1gSmaGMtMHW6CWzjehy+AkwG2gr5/ouGRaLSSLmFZ42Y3prBcGUHwinz7FxbY2jkl1VPLip6MLDpMs+gl7d67++3EmmtLDdZQcOR2CLgUlAQfk+NToMCuxNCDb9E7lolDtqFH32I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=biJxKx8+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="biJxKx8+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9E05C4CEDD; Thu, 27 Mar 2025 10:30:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743071419; bh=molGG3aPYi74hz9WVuXlbE1iJFE0MWmpVUKVIij8Ws4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=biJxKx8+zuUi+vNzm8YlLU88q2/Tn9vH7l3F1/Adm1a+X/rJKUlEwACBPkwOBvC5I 75VcVgdo3Ff/jMcMXDJ8VemeZwEikvhnEQm405t/Nn3Boms0xoQG2DwM3lsdDqTOkh IVOb1qSmN6TjOR/HiYMjNi2WqpSvDgaqH5H8RVT/qYZLQEOjM62jgKsNuM5abrXJZK wQEquhPN9zOShwiR7ObZ8WwdQXrGnsqIac+V9YmXPX17zOAF8MBDxLQsHSjjmdyabY b1HLBApG3LSjWgLTjcdk2fVgFmZ4InDeIWbfcMBigowjRhBdhWm/d/wQ+R1AiGvyn7 Lvy2KpMBd0jYA== From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Peter Zijlstra Subject: [PATCH 10/14] bugs/riscv: Pass in 'cond_str' to __BUG_FLAGS() Date: Thu, 27 Mar 2025 11:29:49 +0100 Message-ID: <20250327102953.813608-11-mingo@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250327102953.813608-1-mingo@kernel.org> References: <20250327102953.813608-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Pass in the condition string from __WARN_FLAGS() to __BUG_FLAGS(), but don't use it yet. Signed-off-by: Ingo Molnar Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Alexandre Ghiti Cc: linux-riscv@lists.infradead.org Cc: --- arch/riscv/include/asm/bug.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/riscv/include/asm/bug.h b/arch/riscv/include/asm/bug.h index b22ee4d2c882..feaf456d465b 100644 --- a/arch/riscv/include/asm/bug.h +++ b/arch/riscv/include/asm/bug.h @@ -50,7 +50,7 @@ typedef u32 bug_insn_t; #endif =20 #ifdef CONFIG_GENERIC_BUG -#define __BUG_FLAGS(flags) \ +#define __BUG_FLAGS(cond_str, flags) \ do { \ __asm__ __volatile__ ( \ "1:\n\t" \ @@ -66,17 +66,17 @@ do { \ "i" (sizeof(struct bug_entry))); \ } while (0) #else /* CONFIG_GENERIC_BUG */ -#define __BUG_FLAGS(flags) do { \ +#define __BUG_FLAGS(cond_str, flags) do { \ __asm__ __volatile__ ("ebreak\n"); \ } while (0) #endif /* CONFIG_GENERIC_BUG */ =20 #define BUG() do { \ - __BUG_FLAGS(0); \ + __BUG_FLAGS("", 0); \ unreachable(); \ } while (0) =20 -#define __WARN_FLAGS(cond_str, flags) __BUG_FLAGS(BUGFLAG_WARNING|(flags)) +#define __WARN_FLAGS(cond_str, flags) __BUG_FLAGS(cond_str, BUGFLAG_WARNIN= G|(flags)) =20 #define HAVE_ARCH_BUG =20 --=20 2.45.2 From nobody Wed Dec 17 07:08:04 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E4ABD20FAA1 for ; Thu, 27 Mar 2025 10:30:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071421; cv=none; b=C91Jx0me/hfKOW/vI5LL4lU3Ky9YonYgA6V5ndaowMUqGCnXjPGb+eoxpWI/bO98fRmq3knXo84xJgM6+Lexae7qi0+lJJnNMXCEmtypSqUWJF2AJrp40TBAkPiPEDf9Zz1D6PNzEinGf6TT6fv3ZQmxLB5e5/EgQJf4tdmPoas= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071421; c=relaxed/simple; bh=/BxY/YKk2UJG2lxI/lsTF++98Em3QYZhD/GUPXzzoTU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FzwtzP7Fg7qnu0E2V3qUSU5j3P0tledlIpning6hT9sBGUDUSrQefvZlkNOeDSg9W8sNVBSG/zX0CLPGlyFjpVm2H/KZ4BIKNlUtx1keN3DqiolXQlcc+LuTk3D9c6oq11E0BCiRkh9eKcaeR4s4RTeKU+38LaRFG/1fYOWdGfw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=abDo4WDm; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="abDo4WDm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87995C4CEEA; Thu, 27 Mar 2025 10:30:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743071420; bh=/BxY/YKk2UJG2lxI/lsTF++98Em3QYZhD/GUPXzzoTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=abDo4WDm+tn863zPF5fd5i5/oIqBOiwzHKnliAAp7veihfherq8+aXuQcKLPlJasV clPBh2H7EQAsZ+VNELPL4HTgz1wDPGq34bLuHqtYMFqrfnBbyJwGdUzEHP1pvSvXC/ oOuDRUPs1rYUcyZrtF1HSAq4dKB/pcA5wCXsQuDCaQ/k4ZN+xS6HM77nVQW/l1Xivr 4nfE+Y00q0TrQn9saZUnk8bQlyTfGd4zYQma+xN/UfwHyHU78A7041zWCn/4qYV7jL /+r+eO/QUxrFgx1ycpUmQ1/CbTOtx0y8BAV+byNp7LeM12t6vZl1uCwryC/71NMd1M W/cev/gTJOx1A== From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Peter Zijlstra Subject: [PATCH 11/14] bugs/riscv: Concatenate 'cond_str' with '__FILE__' in __BUG_FLAGS(), to extend WARN_ON/BUG_ON output Date: Thu, 27 Mar 2025 11:29:50 +0100 Message-ID: <20250327102953.813608-12-mingo@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250327102953.813608-1-mingo@kernel.org> References: <20250327102953.813608-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Extend WARN_ON and BUG_ON style output from: WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410 to: WARNING: CPU: 0 PID: 0 at [idx < 0 && ptr] kernel/sched/core.c:8511 sched= _init+0x20/0x410 Note that the output will be further reorganized later in this series. Signed-off-by: Ingo Molnar Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Alexandre Ghiti Cc: linux-riscv@lists.infradead.org Cc: --- arch/riscv/include/asm/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/include/asm/bug.h b/arch/riscv/include/asm/bug.h index feaf456d465b..6278523dd2d1 100644 --- a/arch/riscv/include/asm/bug.h +++ b/arch/riscv/include/asm/bug.h @@ -61,7 +61,7 @@ do { \ ".org 2b + %3\n\t" \ ".popsection" \ : \ - : "i" (__FILE__), "i" (__LINE__), \ + : "i" (cond_str __FILE__), "i" (__LINE__), \ "i" (flags), \ "i" (sizeof(struct bug_entry))); \ } while (0) --=20 2.45.2 From nobody Wed Dec 17 07:08:04 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0157A2139B2 for ; Thu, 27 Mar 2025 10:30:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071423; cv=none; b=cl5BJHflEDAjpDlRux0sQcw+yQQlO6LXmBIffZuuWoU/EcgCFlxjHq8JSQC8Z9Hv8FYdjZTMH1Ex4cHU9ACoYnfMbRY0FRztX7u3bea2jDUooYJOgpEHUar4g2l+/BKBQRU5JoCPKy2+xmflG3n5nW9oSKCol4V7QlKzI73uaD0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071423; c=relaxed/simple; bh=UI09yfLxFHOEwRrp5YVkeao7N1IMba4sGY241tm5ILE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cC4nHeggvaTHnM+jR3euM7UYsO1iC02kUWznYZ3l5yC/VE+d7LyrZAJ8Gljj464WeKUjAhg3HsCHxxCGW86dfnz5bcbP5t98V656MNFZsJVXGxvMvXG8G07/hpr5eBvJdqJyOf+c3vXn8zDEpoV8WDB/QmYj52mjZnsyHgI00y8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QPeIb7XV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QPeIb7XV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 442E1C4CEDD; Thu, 27 Mar 2025 10:30:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743071422; bh=UI09yfLxFHOEwRrp5YVkeao7N1IMba4sGY241tm5ILE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QPeIb7XVX4hiSnMKTW3DiI+jVsm1eaGu4OAz3ZR+Z2YWY363TqTmH1+FZaf38eSGL RCPiq0ZFwdPwlZAUiYnYp3T9I8jT7KkLnCUtcsshb2xOv2yMCrfkai+j2QjmgfkPxR SiDekkafBN5DZt0oeuQRFCwrMCGeHK/A3HeAFJpccRTrk4rY/qNIQuhOMlcUgveZmO k+C0pVEHn5a9ac+Iw0b9AcaI7Zf6KbqsKjWqKdc931B6cC75KA6OAv0cvm0GS4M9Rb yXhe7Afy3Vl0fMk17ohQxb+c1cTTU+Zy3Ej/VG5RGu863UuClEteH5VPtp7V0Cr4rw 6lAubRPA3ecmg== From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Peter Zijlstra Subject: [PATCH 12/14] bugs/parisc: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), to extend WARN_ON/BUG_ON output Date: Thu, 27 Mar 2025 11:29:51 +0100 Message-ID: <20250327102953.813608-13-mingo@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250327102953.813608-1-mingo@kernel.org> References: <20250327102953.813608-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Extend WARN_ON and BUG_ON style output from: WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410 to: WARNING: CPU: 0 PID: 0 at [idx < 0 && ptr] kernel/sched/core.c:8511 sched= _init+0x20/0x410 Note that the output will be further reorganized later in this series. Signed-off-by: Ingo Molnar Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: linux-parisc@vger.kernel.org Cc: --- arch/parisc/include/asm/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/parisc/include/asm/bug.h b/arch/parisc/include/asm/bug.h index 1a87cf80ec3c..2d14d6cf21f3 100644 --- a/arch/parisc/include/asm/bug.h +++ b/arch/parisc/include/asm/bug.h @@ -61,7 +61,7 @@ "\t.short %1, %2\n" \ "\t.blockz %3-2*4-2*2\n" \ "\t.popsection" \ - : : "i" (__FILE__), "i" (__LINE__), \ + : : "i" (cond_str __FILE__), "i" (__LINE__), \ "i" (BUGFLAG_WARNING|(flags)), \ "i" (sizeof(struct bug_entry)) ); \ } while(0) --=20 2.45.2 From nobody Wed Dec 17 07:08:04 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B8AD8213E6D for ; Thu, 27 Mar 2025 10:30:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071424; cv=none; b=Y4RqWERThoX6GE3baSATim0+R6bGQkSY3R2rzFJt8XyUR0Bhladtu6sQvr3nn76wpRQFI6quqZhWN8JkcjbLMpSGrOMzmmHAhyjh1eqJCnP8p3HE1vWL6rT0gznf5WWPgDbBys5hq24rqysI0E4CZxoBjwAfX89GHFL/VQoFqrE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071424; c=relaxed/simple; bh=VJHlQLtEvA4VjWEipi509Ucv0vZx7zN0iSCfs2PYkT8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M/3ByY4BpVZPJAkGE5h5vwqm2EiaqFzIbv4pn+pApb/vNwnL3l2lV/deajv8Bp3t+1g6/Srsv8nc+OVdxtjDZcrxLJNKlvun+6gef5htLso0LptAxrMxVONw+fUJXMZM/IyAlljxsuZ8gDhJ8w0yiGtHLvvHvc6lnKSQysLk2zE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=J/7IUsna; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="J/7IUsna" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01D04C4CEE8; Thu, 27 Mar 2025 10:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743071424; bh=VJHlQLtEvA4VjWEipi509Ucv0vZx7zN0iSCfs2PYkT8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J/7IUsnayc7UVD3c/BAz2ScGy28LLOYt593F6fy/C8BCyxCSPlH9YiDV0+vEjH+fd HQ1oa02qLo5LIQf/45kuUm1Y6i9VRbisxCzvZHQGrCsCuUi/u7p4sA23cOiEYjkQLG nBMSTnekOsNFMSTK3OQwMOP7bJasl1OcYYOKcWRl2l5i6M/OvYlTimxmPc5/q5u8X9 9X0DRshAUWW6t+e/4UB35sSqg9OGr2Gm1TI2vg8THKnTFHVzggN4S8m0fONOS91hNZ fNI0okhuPuIrISUDvVTEsRmH8Kc9O9R0nFcSaqu08OqT4gNm8lymWgb1cY8qAVVyDi OJxfZwvC9NCVg== From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Peter Zijlstra Subject: [PATCH 13/14] bugs/sh: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), to extend WARN_ON/BUG_ON output Date: Thu, 27 Mar 2025 11:29:52 +0100 Message-ID: <20250327102953.813608-14-mingo@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250327102953.813608-1-mingo@kernel.org> References: <20250327102953.813608-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Extend WARN_ON and BUG_ON style output from: WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410 to: WARNING: CPU: 0 PID: 0 at [idx < 0 && ptr] kernel/sched/core.c:8511 sched= _init+0x20/0x410 Note that the output will be further reorganized later in this series. Signed-off-by: Ingo Molnar Cc: Yoshinori Sato Cc: Rich Felker Cc: John Paul Adrian Glaubitz Cc: linux-sh@vger.kernel.org Cc: --- arch/sh/include/asm/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sh/include/asm/bug.h b/arch/sh/include/asm/bug.h index 834c621ab249..20d5220bf452 100644 --- a/arch/sh/include/asm/bug.h +++ b/arch/sh/include/asm/bug.h @@ -59,7 +59,7 @@ do { \ _EMIT_BUG_ENTRY \ : \ : "n" (TRAPA_BUG_OPCODE), \ - "i" (__FILE__), \ + "i" (cond_str __FILE__), \ "i" (__LINE__), \ "i" (BUGFLAG_WARNING|(flags)), \ "i" (sizeof(struct bug_entry))); \ --=20 2.45.2 From nobody Wed Dec 17 07:08:04 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 778B6214205 for ; Thu, 27 Mar 2025 10:30:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071426; cv=none; b=dOc9G14SOXT1/QYIrSv6X3ap3ZluBSE+vqr+YsYfGnNX1n5vlVJ1Fvi3JcOIE/wQFS6xJ+XoNIhIbQ6j63kEWgzBVregf6TjNc/x0b6S/csV2sthQydV3FqeQTEqM17SUKDDexra26/p/lZfoZHpE4Jjbn4T7CC9uAsN9R0l9No= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743071426; c=relaxed/simple; bh=JZmwNsDqLZxIgq2TSsWv+OrlfHD4sc+gRut+0sfnc0A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iw5rZiTroH2IC9qHJ8URRzOlEVUJXbMLzsFr4ou34T6YS01qZ35pm8BczNzADwDdyidcwDmHODZt4NC9e2MyyblEnARY8EpSp7jH0aT5xdOjf9VQdHh9c6u51Mo7UGUcKsRh1vJuFWobAIQTT5urJN4H72HG5+3+HkNSfLKslhQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pLxE7xlS; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pLxE7xlS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3850C4CEEA; Thu, 27 Mar 2025 10:30:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743071425; bh=JZmwNsDqLZxIgq2TSsWv+OrlfHD4sc+gRut+0sfnc0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pLxE7xlSByCNsAadhCeaUBswG2X4q4UoPTRxF6kjpv/B0VNPi6s3FysAgMAvZk5mY 1DEiVC8CZZZ2o17GZINu68KAvQQOaiOBGcqt9WaEVJHs0kOdqIj1b/XWHddh5QJLjR M6VFMi5YtB8LY/2uM9ckW5jsnRE29tMJI0BzUlJ/Nm3ZiEwePb0d+y+g/hXgqAqTmP tayHtdO9aySFBQDXgHQDZ4I79esvrfyRPv5cAvzYke0D5IuSQwsWsApt0rEThAiJ9I oijrfNwz7C3ojtbmghze4bz6suCLf01RJnNBo9NiARXNw2yipsRKrKywhm1MRr9KPl OA/PO1AiexQWg== From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Peter Zijlstra Subject: [PATCH 14/14] bugs/core: Reorganize fields in the first line of WARNING output, add ->comm[] output Date: Thu, 27 Mar 2025 11:29:53 +0100 Message-ID: <20250327102953.813608-15-mingo@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250327102953.813608-1-mingo@kernel.org> References: <20250327102953.813608-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" With the introduction of the condition string as part of the 'file' string output of kernel warnings, the first line has become a bit harder to read: WARNING: CPU: 0 PID: 0 at [ptr =3D=3D 0 && 1] kernel/sched/core.c:8511 s= ched_init+0x20/0x410 Re-order the fields by importance (higher to lower), make the 'at' meaningf= ul again, and add '->comm[]' output which is often more valuable than a PID. Also, remove the 'PID' prefix - in combination with comm it's clear what it= is. These changes make the output only slightly longer: WARNING: [ptr =3D=3D 0 && 1] kernel/sched/core.c:8511 at sched_init+0x20= /0x410 CPU#0: swapper/0 While adding more information and making it better organized. Signed-off-by: Ingo Molnar Cc: --- kernel/panic.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/kernel/panic.c b/kernel/panic.c index d8635d5cecb2..e57a61faa05f 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -724,13 +724,15 @@ void __warn(const char *file, int line, void *caller,= unsigned taint, =20 disable_trace_on_warning(); =20 - if (file) - pr_warn("WARNING: CPU: %d PID: %d at %s:%d %pS\n", - raw_smp_processor_id(), current->pid, file, line, - caller); - else - pr_warn("WARNING: CPU: %d PID: %d at %pS\n", - raw_smp_processor_id(), current->pid, caller); + if (file) { + pr_warn("WARNING: %s:%d at %pS, CPU#%d: %s/%d\n", + file, line, caller, + raw_smp_processor_id(), current->comm, current->pid); + } else { + pr_warn("WARNING: at %pS, CPU#%d: %s/%d\n", + caller, + raw_smp_processor_id(), current->comm, current->pid); + } =20 #pragma GCC diagnostic push #ifndef __clang__ --=20 2.45.2