[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YMeqz6rav7V5UlLC@zn.tnic>
Date: Mon, 14 Jun 2021 21:15:27 +0200
From: Borislav Petkov <bp@...e.de>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Andy Lutomirski <luto@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Fenghua Yu <fenghua.yu@...el.com>,
Tony Luck <tony.luck@...el.com>,
Yu-cheng Yu <yu-cheng.yu@...el.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Kan Liang <kan.liang@...ux.intel.com>
Subject: Re: [patch V2 01/52] x86/fpu: Make init_fpstate correct with
optimized XSAVE
On Mon, Jun 14, 2021 at 05:44:09PM +0200, Thomas Gleixner wrote:
> @@ -466,10 +489,20 @@ static void __init setup_init_fpu_buf(vo
> copy_kernel_to_xregs_booting(&init_fpstate.xsave);
>
> /*
> - * Dump the init state again. This is to identify the init state
> - * of any feature which is not represented by all zero's.
> + * All components are now in init state. Read the state back so
> + * that init_fpstate contains all non-zero init state. This is only
> + * working with XSAVE,
"This only works with XSAVE, ... "
> but not with XSAVEOPT and XSAVES because
> + * those use the init optimization which skips writing data for
> + * components in init state.
<--- Add a newline in the comment here so that it is not as dense.
> So XSAVE could be used, but that would
> + * require to reshuffle the data when XSAVES is available because
> + * XSAVES uses xstate compaction. But doing so is a pointless
> + * exercise because most components have an all zeros init state
> + * except for the legacy ones (FP and SSE). Those can be saved with
> + * FXSAVE into the legacy area. Adding new features requires to
> + * ensure that init state is all zeroes or if not to add the
> + * necessary handling here.
> */
> - copy_xregs_to_kernel_booting(&init_fpstate.xsave);
> + fxsave_to_kernel(&init_fpstate.fxsave);
With those fixed:
Reviewed-by: Borislav Petkov <bp@...e.de>
--
Regards/Gruss,
Boris.
SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg
Powered by blists - more mailing lists