[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211217153003.1719189-21-jing2.liu@intel.com>
Date: Fri, 17 Dec 2021 07:30:00 -0800
From: Jing Liu <jing2.liu@...el.com>
To: 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, pbonzini@...hat.com
Cc: seanjc@...gle.com, jun.nakajima@...el.com, kevin.tian@...el.com,
jing2.liu@...ux.intel.com, jing2.liu@...el.com,
guang.zeng@...el.com, wei.w.wang@...el.com, yang.zhong@...el.com
Subject: [PATCH v2 20/23] docs: kvm: Add KVM_GET_XSAVE2
From: Wei Wang <wei.w.wang@...el.com>
Update the api doc with the new KVM_GET_XSAVE2 ioctl, which is used
when KVM_CAP_XSAVE2 is negotiated with the userspace. KVM_SET_XSAVE
ioctl is re-used when KVM_CAP_XSAVE2 is used. The kvm_xsave struct
is updated to support data size larger that the legacy hardcoded 4KB.
Signed-off-by: Wei Wang <wei.w.wang@...el.com>
Signed-off-by: Zeng Guang <guang.zeng@...el.com>
Signed-off-by: Jing Liu <jing2.liu@...el.com>
---
Documentation/virt/kvm/api.rst | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
index eb5671ca2dba..0f4ed2d4aea6 100644
--- a/Documentation/virt/kvm/api.rst
+++ b/Documentation/virt/kvm/api.rst
@@ -1566,15 +1566,18 @@ otherwise it will return EBUSY error.
struct kvm_xsave {
__u32 region[1024];
+ __u32 extra[0];
};
This ioctl would copy current vcpu's xsave struct to the userspace.
+Application should use KVM_GET_XSAVE2 if xsave states are larger than
+4KB.
4.43 KVM_SET_XSAVE
------------------
-:Capability: KVM_CAP_XSAVE
+:Capability: KVM_CAP_XSAVE and KVM_CAP_XSAVE2
:Architectures: x86
:Type: vcpu ioctl
:Parameters: struct kvm_xsave (in)
@@ -1585,9 +1588,12 @@ This ioctl would copy current vcpu's xsave struct to the userspace.
struct kvm_xsave {
__u32 region[1024];
+ __u32 extra[0];
};
This ioctl would copy userspace's xsave struct to the kernel.
+Application can use this ioctl for xstate buffer in any size
+returned from KVM_CHECK_EXTENSION(KVM_CAP_XSAV2).
4.44 KVM_GET_XCRS
@@ -5507,6 +5513,27 @@ the trailing ``'\0'``, is indicated by ``name_size`` in the header.
The Stats Data block contains an array of 64-bit values in the same order
as the descriptors in Descriptors block.
+4.42 KVM_GET_XSAVE2
+------------------
+
+:Capability: KVM_CAP_XSAVE2
+:Architectures: x86
+:Type: vcpu ioctl
+:Parameters: struct kvm_xsave (out)
+:Returns: 0 on success, -1 on error
+
+
+::
+
+ struct kvm_xsave {
+ __u32 region[1024];
+ __u32 extra[0];
+ };
+
+This ioctl would copy current vcpu's xsave struct to the userspace.
+Application can use this ioctl for xstate buffer in any size
+returned from KVM_CHECK_EXTENSION(KVM_CAP_XSAV2).
+
5. The kvm_run structure
========================
--
2.27.0
Powered by blists - more mailing lists