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>] [day] [month] [year] [list]
Message-ID: <20250526082414.689-1-khaliidcaliy@gmail.com>
Date: Mon, 26 May 2025 08:22:44 +0000
From: Khalid Ali <khaliidcaliy@...il.com>
To: tglx@...utronix.de,
	mingo@...hat.com,
	bp@...en8.de,
	dave.hansen@...ux.intel.com
Cc: x86@...nel.org,
	hpa@...or.com,
	linux-kernel@...r.kernel.org,
	Khalid Ali <khaliidcaliy@...il.com>
Subject: [PATCH] x86/kerrnel/FPU: clear MP bit of cr0

From: Khalid Ali <khaliidcaliy@...il.com>

Clear MP bit when initializing x87 FPU, since what it does
is making WAIT/FWAIT instructions to react to setting of TS flag.
Right now TS bit is cleared so MP should be cleared, as it is not
needed. This should set the bit in defined state.

Signed-off-by: Khalid Ali <khaliidcaliy@...il.com>
---
 arch/x86/kernel/fpu/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/fpu/init.c b/arch/x86/kernel/fpu/init.c
index 998a08f17e33..2a2b45610b74 100644
--- a/arch/x86/kernel/fpu/init.c
+++ b/arch/x86/kernel/fpu/init.c
@@ -30,7 +30,7 @@ static void fpu__init_cpu_generic(void)
 		cr4_set_bits(cr4_mask);
 
 	cr0 = read_cr0();
-	cr0 &= ~(X86_CR0_TS|X86_CR0_EM); /* clear TS and EM */
+	cr0 &= ~(X86_CR0_TS|X86_CR0_EM|X86_CR0_MP); /* clear TS, EM and MP*/
 	if (!boot_cpu_has(X86_FEATURE_FPU))
 		cr0 |= X86_CR0_EM;
 	write_cr0(cr0);
-- 
2.49.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ