Re: [PATCH v9 12/26] x86/fpu/xstate: Use feature disable (XFD) to protect dynamic user state

Bae, Chang Seok
2021-08-18T21:38:21Z

On Aug 18, 2021, at 14:17, Borislav Petkov <bp@alien8.de> wrote:
> On Wed, Aug 18, 2021 at 08:43:50PM +0000, Bae, Chang Seok wrote:
>> Maybe I’m missing something, but I wonder what’s the difference
>> from reading XCR0.
>
> Wny, because adding another prctl() is too damn hard?

Well, IIUC, merely XGETBV(0) in the kernel instead of from userspace.

> What if this modus operandi of features userspace can use with kernel
> assistance but need an explicit request and are off otherwise, gets
> extended beyond XSAVE-managed features?

What if it never happens? It will be just the same as XGETBV(0). I think on
the flip side there is also a benefit of maintaining a simple API as possible.

Thanks,
Chang