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] [day] [month] [year] [list]
Message-ID: <69118db9-4394-4c65-b53a-084dca917f14@zytor.com>
Date: Wed, 4 Jun 2025 15:42:26 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Khalid Ali <khaliidcaliy@...il.com>, tglx@...utronix.de, mingo@...hat.com,
        bp@...en8.de, dave.hansen@...ux.intel.com
Cc: x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/kerrnel/FPU: clear MP bit of cr0

On 2025-05-26 01:22, Khalid Ali wrote:
> 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>

Note also that we DO initialize all bits of CR0 elsewhere in the code 
(head_32.S and head_64.S) to:

#define CR0_STATE       (X86_CR0_PE | X86_CR0_MP | X86_CR0_ET | \
                          X86_CR0_NE | X86_CR0_WP | X86_CR0_AM | \
                          X86_CR0_PG)

So it is currently defined; this patch would actually *introduce* a bug.

It is a bit confusing to have the bits initialized in different places, 
so I would agree with setting it explicitly, even if it is redundant.

	-hpa


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ