The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] x86/split_lock: Remove dead kmsg formatting when split_lock_detect=fatal
@ 2025-12-15 18:11 Rong Zhang
  2026-01-04 19:17 ` [PATCH] x86/split_lock: Zap the unwieldy switch-case in sld_state_show() Borislav Petkov
  2026-01-04 19:18 ` [tip: x86/cleanups] x86/split_lock: Remove dead string when split_lock_detect=fatal tip-bot2 for Rong Zhang
  0 siblings, 2 replies; 13+ messages in thread
From: Rong Zhang @ 2025-12-15 18:11 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin
  Cc: Rong Zhang, Fenghua Yu, linux-kernel

sld_state_show() has a dead kmsg formatting:

	if (A) {
		...
	} else if (B) {
		pr_info(... A ? str1 : str2 ...);
	}

where A is always false in the second block, implied by the "if (A)
else" pattern. Hence, str2 is always used.

This seems to be some mysterious legacy inherited from the earlier patch
revisions of commit ebb1064e7c2e ("x86/traps: Handle #DB for bus lock").
Earlier revisions [1] did enable both sld and bld at the same time to
detect non-WB bus_locks when split_lock_detect=fatal, but that's no
longer true in the merged revision.

Remove it and translate the pr_info() into its equivalent form.

[1]: https://lore.kernel.org/r/20201121023624.3604415-3-fenghua.yu@intel.com/

Signed-off-by: Rong Zhang <i@rong.moe>
---
 arch/x86/kernel/cpu/bus_lock.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/bus_lock.c b/arch/x86/kernel/cpu/bus_lock.c
index dbc99a47be45..77eadf3b7040 100644
--- a/arch/x86/kernel/cpu/bus_lock.c
+++ b/arch/x86/kernel/cpu/bus_lock.c
@@ -413,9 +413,7 @@ static void sld_state_show(void)
 		if (boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT)) {
 			pr_info("#AC: crashing the kernel on kernel split_locks and sending SIGBUS on user-space split_locks\n");
 		} else if (boot_cpu_has(X86_FEATURE_BUS_LOCK_DETECT)) {
-			pr_info("#DB: sending SIGBUS on user-space bus_locks%s\n",
-				boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT) ?
-				" from non-WB" : "");
+			pr_info("#DB: sending SIGBUS on user-space bus_locks\n");
 		}
 		break;
 	case sld_ratelimit:

base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-03-13 20:23 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-15 18:11 [PATCH] x86/split_lock: Remove dead kmsg formatting when split_lock_detect=fatal Rong Zhang
2026-01-04 19:17 ` [PATCH] x86/split_lock: Zap the unwieldy switch-case in sld_state_show() Borislav Petkov
2026-01-07  5:38   ` Xiaoyao Li
2026-01-07 11:28     ` Borislav Petkov
2026-01-07 16:41       ` Luck, Tony
2026-01-08 10:38         ` Borislav Petkov
2026-02-26 14:50           ` [PATCH -v2] x86/split_lock: Restructure " Borislav Petkov
2026-02-26 21:01             ` Luck, Tony
2026-02-27 16:32               ` Borislav Petkov
2026-03-06  2:57             ` Xiaoyao Li
2026-03-13 15:25               ` Borislav Petkov
2026-03-13 20:22             ` [tip: x86/cleanups] " tip-bot2 for Borislav Petkov
2026-01-04 19:18 ` [tip: x86/cleanups] x86/split_lock: Remove dead string when split_lock_detect=fatal tip-bot2 for Rong Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox