Re: [PATCH v5 14/28] x86/fpu/xstate: Prevent unauthorised use of dynamic user state

From: Bae, Chang Seok
Date: Wed Jun 16 2021 - 15:23:52 EST

On Jun 16, 2021, at 12:01, Hansen, Dave <dave.hansen@xxxxxxxxx> wrote:
> On 6/16/21 11:47 AM, Bae, Chang Seok wrote:
>> Reading XINUSE via XGETBV is cheap but not free. I don't know spending a
>> hundred cycles for this WARN is big deal but this is one of the most
>> performance-critical paths.
> Is XGETBV(1) really a hundred cycles? That seems absurdly high for a
> non-serializing register read.

This was checked to convince the benefit intended by PATCH25 --

> If you're really worried, let's put it under X86_FEATURE_DEBUG_FPU or
> something.

Yes. I will also make sure to include comments for this.