Re: [PATCH v2 8/8] x86/fpu/xstate: Restore supervisor xstates for __fpu__restore_sig()

From: Sebastian Andrzej Siewior
Date: Fri Feb 28 2020 - 11:50:30 EST


On 2020-02-28 08:20:27 [-0800], Yu-cheng Yu wrote:
> On Fri, 2020-02-28 at 17:23 +0100, Borislav Petkov wrote:
> > On Fri, Feb 28, 2020 at 07:53:38AM -0800, Yu-cheng Yu wrote:
> > > Yes, saving only supervisor states is optimal, but doing XSAVES with a
> > > partial RFBM changes xcomp_bv.
> >
> > ... and that means what exactly in plain english?
>
> When XSAVES writes to an xsave buffer, xsave->header.xcomp_bv is set to
> include only saved components, effectively changing the buffer's format.

How large is this supervisor state at most? I guess saving the AVX512
state just to get the 2 bytes of the supervisor state at the right spot
is not really optimal.
But this is the performance divisionâ

> I will include this in the comments.

If you do so, please state that the first hunk is only interested in the
supervisor-state bits and everything else is ignored.

> Yu-cheng

Sebastian