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: <f3d50e5c-5779-4cf4-b279-31eeef2462c6@intel.com>
Date: Mon, 16 Dec 2024 11:05:10 -0800
From: "Chang S. Bae" <chang.seok.bae@...el.com>
To: Dave Hansen <dave.hansen@...ux.intel.com>, <linux-kernel@...r.kernel.org>
CC: <x86@...nel.org>, <tglx@...utronix.de>, <bp@...en8.de>,
	<rafael@...nel.org>, <lenb@...nel.org>, <dave.jiang@...el.com>,
	<irenic.rajneesh@...il.com>, <david.e.box@...el.com>
Subject: Re: [PATCH 09/10] x86/fpu: Remove unnecessary CPUID level check

On 12/13/2024 12:50 PM, Dave Hansen wrote:
> 
> diff -puN arch/x86/kernel/fpu/xstate.c~xsave-leaf-checks-2 arch/x86/kernel/fpu/xstate.c
> --- a/arch/x86/kernel/fpu/xstate.c~xsave-leaf-checks-2	2024-12-13 12:45:36.903226562 -0800
> +++ b/arch/x86/kernel/fpu/xstate.c	2024-12-13 12:45:36.907226732 -0800
> @@ -764,11 +764,6 @@ void __init fpu__init_system_xstate(unsi
>   		return;
>   	}
>   
> -	if (boot_cpu_data.cpuid_level < XSTATE_CPUID) {
> -		WARN_ON_FPU(1);
> -		return;
> -	}
> -

I think this change effectively reverts commit ee813d53a8e9 ("x86, 
xsave: Check cpuid level for XSTATE_CPUID (0x0d)").

At the time of its introduction, commit b38b06659055 ("x86: filter CPU 
features dependent on unavailable CPUID levels") was already there. The 
cpu_has_xsave flag (now boot_cpu_has(X86_FEATURE_XSAVE)) should be false 
for CPUs with a lower CPUID level in this:

void __cpuinit xsave_init(void)
{
     if (!cpu_has_xsave)
         return;
     ...
        xstate_enable_boot_cpu();
}

Then, the sanity check introduced in this code path appears redundant:

xsave_init()
-> xstate_enable_boot_cpu()
     -> setup_xstate_init()
         -> setup_xstate_features()

Reviewed-by: Chang S. Bae <chang.seok.bae@...el.com>

Thanks,
Chang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ