[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3ffa47eb-3555-5925-1c55-f89a07ceb4bc@redhat.com>
Date: Mon, 20 Dec 2021 10:04:14 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Jing Liu <jing2.liu@...el.com>, x86@...nel.org,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com
Cc: seanjc@...gle.com, jun.nakajima@...el.com, kevin.tian@...el.com,
jing2.liu@...ux.intel.com, guang.zeng@...el.com,
wei.w.wang@...el.com, yang.zhong@...el.com
Subject: Re: [PATCH v2 18/23] kvm: x86: Get/set expanded xstate buffer
On 12/17/21 16:29, Jing Liu wrote:
> +/* for KVM_CAP_XSAVE and KVM_CAP_XSAVE2 */
> struct kvm_xsave {
> + /*
> + * KVM_GET_XSAVE only uses the first 4096 bytes.
> + *
> + * KVM_GET_XSAVE2 must have the size match what is returned by
> + * KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2).
> + *
> + * KVM_SET_XSAVE uses the extra field if guest_fpu::fpstate::size
> + * exceeds 4096 bytes.
KVM_GET_XSAVE2 and KVM_SET_XSAVE respectively write and read as many
bytes as are returned by KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2), when
invoked on the vm file descriptor. Currently,
KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2) will only return a value that is
greater than 4096 bytes if any dynamic features have been enabled with
``arch_prctl()``; this however may change in the future.
The offsets of the state save areas in struct kvm_xsave follow the
contents of CPUID leaf 0xD on the host.
Paolo
Powered by blists - more mailing lists