lkml.org 
[lkml]   [2021]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [patch 5/6] x86/fpu: Provide fpu_update_guest_xcr0/xfd()
From
On 12/15/21 11:27, Paolo Bonzini wrote:
> On 12/15/21 11:09, Thomas Gleixner wrote:
>> Lets assume the restore order is XSTATE, XCR0, XFD:
>>
>>       XSTATE has everything in init state, which means the default
>>       buffer is good enough
>>
>>       XCR0 has everything enabled including AMX, so the buffer is
>>       expanded
>>
>>       XFD has AMX disable set, which means the buffer expansion was
>>       pointless
>>
>> If we go there, then we can just use a full expanded buffer for KVM
>> unconditionally and be done with it. That spares a lot of code.
>
> If we decide to use a full expanded buffer as soon as KVM_SET_CPUID2 is
> done, that would work for me.

Off-list, Thomas mentioned doing it even at vCPU creation as long as the
prctl has been called. That is also okay and even simpler.

There's also another important thing that hasn't been mentioned so far:
KVM_GET_SUPPORTED_CPUID should _not_ include the dynamic bits in
CPUID[0xD] if they have not been requested with prctl. It's okay to
return the AMX bit, but not the bit in CPUID[0xD].

Paolo

\
 
 \ /
  Last update: 2021-12-15 11:42    [W:0.266 / U:3.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site