lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251218080044.2615106-3-xiaoyao.li@intel.com>
Date: Thu, 18 Dec 2025 16:00:44 +0800
From: Xiaoyao Li <xiaoyao.li@...el.com>
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
Cc: "H. Peter Anvin" <hpa@...or.com>,
	Tony Luck <tony.luck@...el.com>,
	linux-kernel@...r.kernel.org,
	xiaoyao.li@...el.com
Subject: [PATCH 2/2] x86/split_lock: Drop cpu_model_supports_sld

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@...el.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ