From: Xiaoyao Li <xiaoyao.li@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org
Cc: "H. Peter Anvin" <hpa@zytor.com>, Tony Luck <tony.luck@intel.com>,
linux-kernel@vger.kernel.org, xiaoyao.li@intel.com
Subject: [PATCH 2/2] x86/split_lock: Drop cpu_model_supports_sld
Date: Thu, 18 Dec 2025 16:00:44 +0800 [thread overview]
Message-ID: <20251218080044.2615106-3-xiaoyao.li@intel.com> (raw)
In-Reply-To: <20251218080044.2615106-1-xiaoyao.li@intel.com>
cpu_model_supports_sld was introduced to indicate whether the CPU on
which the kernel runs supports split lock detection, because at that
time X86_FEATURE_SPLIT_LOCK_DETECT was inadequate since it was set only
when sld_state was sld_warn or sld_fatal.
Now, the semantics of X86_FEATURE_SPLIT_LOCK_DETECT have changed and it
can serve exactly the same purpose of cpu_model_supports_sld.
Drop cpu_model_supports_sld and use X86_FEATURE_SPLIT_LOCK_DETECT
instead.
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
---
arch/x86/kernel/cpu/bus_lock.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/arch/x86/kernel/cpu/bus_lock.c b/arch/x86/kernel/cpu/bus_lock.c
index 28bf208b92cb..b072405b9a72 100644
--- a/arch/x86/kernel/cpu/bus_lock.c
+++ b/arch/x86/kernel/cpu/bus_lock.c
@@ -28,13 +28,6 @@ enum split_lock_detect_state {
static enum split_lock_detect_state sld_state __ro_after_init = sld_off;
static u64 msr_test_ctrl_cache __ro_after_init;
-/*
- * With a name like MSR_TEST_CTL it should go without saying, but don't touch
- * MSR_TEST_CTL unless the CPU is one of the whitelisted models. Writing it
- * on CPUs that do not support SLD can cause fireworks, even when writing '0'.
- */
-static bool cpu_model_supports_sld __ro_after_init;
-
static const struct {
const char *option;
enum split_lock_detect_state state;
@@ -169,7 +162,7 @@ static void sld_update_msr(bool on)
void split_lock_init(void)
{
- if (!cpu_model_supports_sld)
+ if (!boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT))
return;
/*
@@ -387,7 +380,6 @@ static void __init split_lock_setup(struct cpuinfo_x86 *c)
return;
supported:
- cpu_model_supports_sld = true;
__split_lock_setup();
}
--
2.43.0
next prev parent reply other threads:[~2025-12-18 8:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-18 8:00 [PATCH 0/2] x86/split_lock: Fix and cleanup of cpu_model_supports_sld Xiaoyao Li
2025-12-18 8:00 ` [PATCH 1/2] x86/split_lock: Fix handling in split_lock_init() Xiaoyao Li
2025-12-18 8:00 ` Xiaoyao Li [this message]
2026-03-06 2:59 ` [PATCH 0/2] x86/split_lock: Fix and cleanup of cpu_model_supports_sld Xiaoyao Li
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=20251218080044.2615106-3-xiaoyao.li@intel.com \
--to=xiaoyao.li@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--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®