kvm: selftests: Add support for KVM_CAP_XSAVE2
When KVM_CAP_XSAVE2 is supported, userspace is expected to allocate buffer for KVM_GET_XSAVE2 and KVM_SET_XSAVE using the size returned by KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2). Signed-off-by: Wei Wang <wei.w.wang@intel.com> Signed-off-by: Guang Zeng <guang.zeng@intel.com> Signed-off-by: Jing Liu <jing2.liu@intel.com> Signed-off-by: Yang Zhong <yang.zhong@intel.com> Message-Id: <20220105123532.12586-20-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
@@ -373,9 +373,23 @@ struct kvm_debugregs {
|
||||
__u64 reserved[9];
|
||||
};
|
||||
|
||||
/* for KVM_CAP_XSAVE */
|
||||
/* for KVM_CAP_XSAVE and KVM_CAP_XSAVE2 */
|
||||
struct kvm_xsave {
|
||||
/*
|
||||
* KVM_GET_XSAVE2 and KVM_SET_XSAVE write and read as many bytes
|
||||
* as are returned by KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2)
|
||||
* respectively, when invoked on the vm file descriptor.
|
||||
*
|
||||
* The size value returned by KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2)
|
||||
* will always be at least 4096. Currently, it is only greater
|
||||
* than 4096 if a dynamic feature has been enabled with
|
||||
* ``arch_prctl()``, but this 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.
|
||||
*/
|
||||
__u32 region[1024];
|
||||
__u32 extra[0];
|
||||
};
|
||||
|
||||
#define KVM_MAX_XCRS 16
|
||||
|
||||
Reference in New Issue
Block a user