[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <34ad15d6-d525-1fe0-8aa7-92a52a19861c@redhat.com>
Date: Tue, 21 Dec 2021 10:30:47 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: "Wang, Wei W" <wei.w.wang@...el.com>,
"Liu, Jing2" <jing2.liu@...el.com>,
"x86@...nel.org" <x86@...nel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"bp@...en8.de" <bp@...en8.de>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>
Cc: "seanjc@...gle.com" <seanjc@...gle.com>,
"Nakajima, Jun" <jun.nakajima@...el.com>,
"Tian, Kevin" <kevin.tian@...el.com>,
"jing2.liu@...ux.intel.com" <jing2.liu@...ux.intel.com>,
"Zeng, Guang" <guang.zeng@...el.com>,
"Zhong, Yang" <yang.zhong@...el.com>
Subject: Re: [PATCH v2 18/23] kvm: x86: Get/set expanded xstate buffer
On 12/21/21 10:06, Wang, Wei W wrote:
>> (I'm not sure if the first sentence is true in the code, but if not it is a bug that
>> has to be fixed :)).
> For the implementation, KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2) always return kvm->vcpus[0]->arch.guest_fpu.uabi_size.
> Do you want to change it to below?
>
> If (kvm->vcpus[0]->arch.guest_fpu.uabi_size < 4096)
> return 0;
return 4096;
since the minimum size of struct kvm_xsave2 (with no extra) is 4096.
Paolo
> else
> return kvm->vcpus[0]->arch.guest_fpu.uabi_size;
>
> If the size is less than 4096 (e.g. no dynamic xfeatures enabled),
> userspace should use the old KVM_GET_XSAVE (instead of KVM_GET_XSAVE2)?
> (KVM_GET_XSAVE2 supports to work with size less than 4096, so I think this isn't necessary)
Powered by blists - more mailing lists