[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251215182907.152881-1-i@rong.moe>
Date: Tue, 16 Dec 2025 02:11:51 +0800
From: Rong Zhang <i@...g.moe>
To: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>
Cc: Rong Zhang <i@...g.moe>,
Fenghua Yu <fenghuay@...dia.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] x86/split_lock: Remove dead kmsg formatting when split_lock_detect=fatal
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@...g.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
Powered by blists - more mailing lists