lkml.org 
[lkml]   [2021]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v4 16/22] x86/fpu/xstate: Extend the table to map state components with features
Date
On Mar 20, 2021, at 14:25, Thomas Gleixner <tglx@linutronix.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

\
 
 \ /
  Last update: 2021-03-23 22:53    [W:0.112 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site