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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 23 Mar 2021 21:52:14 +0000
From:   "Bae, Chang Seok" <chang.seok.bae@...el.com>
To:     Thomas Gleixner <tglx@...utronix.de>
CC:     "bp@...e.de" <bp@...e.de>, "luto@...nel.org" <luto@...nel.org>,
        "mingo@...nel.org" <mingo@...nel.org>,
        "x86@...nel.org" <x86@...nel.org>,
        "Brown, Len" <len.brown@...el.com>,
        "Hansen, Dave" <dave.hansen@...el.com>,
        "Liu, Jing2" <jing2.liu@...el.com>,
        "Shankar, Ravi V" <ravi.v.shankar@...el.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 16/22] x86/fpu/xstate: Extend the table to map state
 components with features

On Mar 20, 2021, at 14:25, Thomas Gleixner <tglx@...utronix.de> wrote:
> 
> And you could have changed the existing table just so:
> 
> static unsigned short xsave_cpuid_features[] __initdata = {
> 	[XFEATURE_FP]                          = X86_FEATURE_FPU,
> 	[XFEATURE_SSE]                         = X86_FEATURE_XMM,
> 	[XFEATURE_YMM]                         = X86_FEATURE_AVX,
> 	[XFEATURE_BNDREGS]                     = X86_FEATURE_MPX,
> 	[XFEATURE_BNDCSR]                      = X86_FEATURE_MPX,
> 	[XFEATURE_OPMASK]                      = X86_FEATURE_AVX512F,
> 	[XFEATURE_ZMM_Hi256]                   = X86_FEATURE_AVX512F,
> 	[XFEATURE_Hi16_ZMM]                    = X86_FEATURE_AVX512F,
> 	[XFEATURE_PT_UNIMPLEMENTED_SO_FAR]     = X86_FEATURE_INTEL_PT,
> 	[XFEATURE_PKRU]                        = X86_FEATURE_PKU,
> 	[XFEATURE_PASID]                       = X86_FEATURE_ENQCMD,
> };
> 
> and the implementation to:            
> 
>        for (i = 0; i < ARRAY_SIZE(xsave_cpuid_features); i++) {
> -		if (xsave_cpuid_features[i] || !boot_cpu_has(xsave_cpuid_features[i]))
> +		if (xsave_cpuid_features[i] || !boot_cpu_has(xsave_cpuid_features[i]))
>                	xfeatures_mask_all &= ~BIT_ULL(i);
> 
> Even with the gaps for XTILE the table is smaller, the code is simpler…

True, I will follow your suggestion. Maybe follow-up with a new patch before
posting v5.

Thank you for the suggestion.

Chang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ