Re: [patch V3 06/66] x86/fpu: Make xfeatures_mask_all __ro_after_init

From: Borislav Petkov
Date: Sun Jun 20 2021 - 04:46:18 EST


On Fri, Jun 18, 2021 at 04:18:29PM +0200, Thomas Gleixner wrote:
> Nothing has to modify this after init.
>
> But of course there is code which unconditionaly masks xfeatures_mask_all

WARNING: 'unconditionaly' may be misspelled - perhaps 'unconditionally'?
#71:
But of course there is code which unconditionaly masks xfeatures_mask_all
^^^^^^^^^^^^^^
> @@ -896,8 +888,18 @@ void __init fpu__init_system_xstate(void
> setup_init_fpu_buf();
> setup_xstate_comp_offsets();
> setup_supervisor_only_offsets();
> - print_xstate_offset_size();
>
> + /*
> + * Paranoia check whether something in the setup modified the
> + * xfeatures mask.
> + */
> + if (xfeatures != xfeatures_mask_all) {
> + pr_err("x86/fpu: xfeatures modified during init %016llx %016llx, disabling XSAVE\n",

Let's make that:

pr_err("x86/fpu: xfeatures modified from 0x%016llx to 0x%016llx during init, disabling XSAVE\n",

so that it is clear which is which.

With those:

Reviewed-by: Borislav Petkov <bp@xxxxxxx>

--
Regards/Gruss,
Boris.

SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg