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

Borislav Petkov
2020-02-28T18:31:39Z

On Fri, Feb 28, 2020 at 10:11:44AM -0800, Yu-cheng Yu wrote:
> CET has 16 bytes for ring-3 setting, 24 bytes for ring-0.
> Saving supervisor states somewhere else and copying back is not better
> either.

Well, if you're going to save a lot bigger user states area which is
going to be absolutely wasted cycles in that case, you better save those
couple of bytes in another buffer and then copy them into the final state
buffer which gets restored.

> We save supervisor states only when xfeatures_mask_supervisor() is not
> zero.

And on which systems is it not zero? On systems which have supervisor
features or on systems which have *and* *are* *using* supervisor
features?

--
Regards/Gruss,
Boris.