On Sun, Feb 18, 2024 at 11:47:19PM -0800, Yang Weijiang wrote: >Update CPUID.(EAX=0DH,ECX=1).EBX to reflect current required xstate size >due to XSS MSR modification. >CPUID(EAX=0DH,ECX=1).EBX reports the required storage size of all enabled >xstate features in (XCR0 | IA32_XSS). The CPUID value can be used by guest >before allocate sufficient xsave buffer. > >Note, KVM does not yet support any XSS based features, i.e. supported_xss >is guaranteed to be zero at this time. > >Opportunistically modify XSS write access logic as: >If XSAVES is not enabled in the guest CPUID, forbid setting IA32_XSS msr >to anything but 0, even if the write is host initiated. > >Suggested-by: Sean Christopherson <seanjc@xxxxxxxxxx> >Co-developed-by: Zhang Yi Z <yi.z.zhang@xxxxxxxxxxxxxxx> >Signed-off-by: Zhang Yi Z <yi.z.zhang@xxxxxxxxxxxxxxx> >Signed-off-by: Yang Weijiang <weijiang.yang@xxxxxxxxx> >Reviewed-by: Maxim Levitsky <mlevitsk@xxxxxxxxxx> Reviewed-by: Chao Gao <chao.gao@xxxxxxxxx>