Re: [PATCH v9 4/5] x86/xsave: Make XSAVE check the base CPUID features before enabling

From: Andi Kleen
Date: Fri Oct 13 2017 - 13:48:55 EST


> > + /*
> > + * Clear XSAVE features that are disabled in the normal CPUID.
> > + */
> > + for (i = 0; i < ARRAY_SIZE(xsave_cpuid_features); i++) {
> > + if (!boot_cpu_has(xsave_cpuid_features[i]))
> > + xfeatures_mask &= ~BIT(i);
> > + }
> > +
> > xfeatures_mask &= fpu__get_supported_xfeatures_mask();
> >
> > /* Enable xstate instructions to be able to continue with initialization: */
>
> This patch has similar problems to the ones I reported against 2/5.

I'm not clear what I'm supposed to change here. The array cannot be __initdata
because it is used at cpu hotplug. Nothing else seems to apply.

-Andi