mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Rong Zhang" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Rong Zhang <i@rong.moe>, "Borislav Petkov (AMD)" <bp@alien8.de>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/cleanups] x86/split_lock: Remove dead string when split_lock_detect=fatal
Date: Sun, 04 Jan 2026 19:18:30 -0000	[thread overview]
Message-ID: <176755431116.510.16624657260337348261.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20251215182907.152881-1-i@rong.moe>

The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID:     6823f10dcc84f35ca652eff0448f7da3d3b26548
Gitweb:        https://git.kernel.org/tip/6823f10dcc84f35ca652eff0448f7da3d3b26548
Author:        Rong Zhang <i@rong.moe>
AuthorDate:    Tue, 16 Dec 2025 02:11:51 +08:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Sun, 04 Jan 2026 14:26:02 +01:00

x86/split_lock: Remove dead string when split_lock_detect=fatal

sld_state_show() has a dead str1 below:

  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

  ebb1064e7c2e ("x86/traps: Handle #DB for bus lock").

Earlier revisions¹ 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.

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

  [ bp: Massage commit message; simplify braces ]

Signed-off-by: Rong Zhang <i@rong.moe>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20251215182907.152881-1-i@rong.moe
---
 arch/x86/kernel/cpu/bus_lock.c |  9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/cpu/bus_lock.c b/arch/x86/kernel/cpu/bus_lock.c
index dbc99a4..fb16666 100644
--- a/arch/x86/kernel/cpu/bus_lock.c
+++ b/arch/x86/kernel/cpu/bus_lock.c
@@ -410,13 +410,10 @@ static void sld_state_show(void)
 		}
 		break;
 	case sld_fatal:
-		if (boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT)) {
+		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" : "");
-		}
+		else if (boot_cpu_has(X86_FEATURE_BUS_LOCK_DETECT))
+			pr_info("#DB: sending SIGBUS on user-space bus_locks\n");
 		break;
 	case sld_ratelimit:
 		if (boot_cpu_has(X86_FEATURE_BUS_LOCK_DETECT))

      parent reply	other threads:[~2026-01-04 19:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-15 18:11 [PATCH] x86/split_lock: Remove dead kmsg formatting " 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-bot2 for Rong Zhang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=176755431116.510.16624657260337348261.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=bp@alien8.de \
    --cc=i@rong.moe \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®