kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Jing Liu <jing2.liu@intel.com>,
	x86@kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, tglx@linutronix.de,
	mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com
Cc: seanjc@google.com, jun.nakajima@intel.com, kevin.tian@intel.com,
	jing2.liu@linux.intel.com, guang.zeng@intel.com,
	wei.w.wang@intel.com, yang.zhong@intel.com
Subject: Re: [PATCH v2 20/23] docs: kvm: Add KVM_GET_XSAVE2
Date: Mon, 20 Dec 2021 10:04:00 +0100	[thread overview]
Message-ID: <39ca9998-e936-8a5b-4cd8-596d907f4d8f@redhat.com> (raw)
In-Reply-To: <20211217153003.1719189-21-jing2.liu@intel.com>

On 12/17/21 16:30, Jing Liu wrote:
> From: Wei Wang <wei.w.wang@intel.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.

This commit message is incorrect, since KVM_ENABLE_CAP(KVM_CAP_XSAVE2) 
was removed from the API.  You can squash this patch in patch 18, and 
also add to the documentation the same notes that I made in the reply.

Thanks,

Paolo

> Signed-off-by: Wei Wang <wei.w.wang@intel.com>
> Signed-off-by: Zeng Guang <guang.zeng@intel.com>
> Signed-off-by: Jing Liu <jing2.liu@intel.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).

Typo, s/XSAV2/XSAVE2/

>   
>   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).

Typo, s/XSAV2/XSAVE2/

> +
>   5. The kvm_run structure
>   ========================
>   
> 


  reply	other threads:[~2021-12-20  9:06 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17 15:29 [PATCH v2 00/23] AMX Support in KVM Jing Liu
2021-12-17 15:29 ` [PATCH v2 01/23] x86/fpu: Extend fpu_xstate_prctl() with guest permissions Jing Liu
2021-12-17 18:45   ` Thomas Gleixner
2021-12-17 18:47     ` Thomas Gleixner
2021-12-17 15:29 ` [PATCH v2 02/23] x86/fpu: Prepare guest FPU for dynamically enabled FPU features Jing Liu
2021-12-17 15:29 ` [PATCH v2 03/23] kvm: x86: Fix xstate_required_size() to follow XSTATE alignment rule Jing Liu
2021-12-17 15:29 ` [PATCH v2 04/23] kvm: x86: Exclude unpermitted xfeatures at KVM_GET_SUPPORTED_CPUID Jing Liu
2021-12-20 13:20   ` Paolo Bonzini
2021-12-17 15:29 ` [PATCH v2 05/23] kvm: x86: Check permitted dynamic xfeatures at KVM_SET_CPUID2 Jing Liu
2021-12-17 15:29 ` [PATCH v2 06/23] x86/fpu: Make XFD initialization in __fpstate_reset() a function argument Jing Liu
2021-12-17 15:29 ` [PATCH v2 07/23] x86/fpu: Add guest support to xfd_enable_feature() Jing Liu
2021-12-17 15:29 ` [PATCH v2 08/23] x86/fpu: Provide fpu_update_guest_perm_features() for guest Jing Liu
2021-12-17 18:50   ` Thomas Gleixner
2021-12-17 15:29 ` [PATCH v2 09/23] kvm: x86: Enable dynamic XSAVE features at KVM_SET_CPUID2 Jing Liu
2021-12-17 15:29 ` [PATCH v2 10/23] x86/fpu: Provide fpu_update_guest_xfd() for IA32_XFD emulation Jing Liu
2021-12-17 15:29 ` [PATCH v2 11/23] kvm: x86: Add emulation for IA32_XFD Jing Liu
2021-12-17 15:29 ` [PATCH v2 12/23] x86/fpu: Prepare xfd_err in struct fpu_guest Jing Liu
2021-12-17 15:29 ` [PATCH v2 13/23] kvm: x86: Intercept #NM for saving IA32_XFD_ERR Jing Liu
2021-12-17 15:29 ` [PATCH v2 14/23] kvm: x86: Emulate IA32_XFD_ERR for guest Jing Liu
2021-12-17 15:29 ` [PATCH v2 15/23] kvm: x86: Add XCR0 support for Intel AMX Jing Liu
2021-12-17 15:29 ` [PATCH v2 16/23] kvm: x86: Add CPUID " Jing Liu
2021-12-17 15:29 ` [PATCH v2 17/23] x86/fpu: add uabi_size to guest_fpu Jing Liu
2021-12-17 15:29 ` [PATCH v2 18/23] kvm: x86: Get/set expanded xstate buffer Jing Liu
2021-12-20  9:04   ` Paolo Bonzini
2021-12-21  2:45     ` Wang, Wei W
2021-12-21  8:45       ` Paolo Bonzini
2021-12-21  9:06         ` Wang, Wei W
2021-12-21  9:30           ` Paolo Bonzini
2021-12-17 15:29 ` [PATCH v2 19/23] kvm: selftests: Add support for KVM_CAP_XSAVE2 Jing Liu
2021-12-20 13:19   ` Paolo Bonzini
2021-12-17 15:30 ` [PATCH v2 20/23] docs: kvm: Add KVM_GET_XSAVE2 Jing Liu
2021-12-20  9:04   ` Paolo Bonzini [this message]
2021-12-17 15:30 ` [PATCH v2 21/23] x86/fpu: Provide fpu_sync_guest_vmexit_xfd_state() Jing Liu
2021-12-17 15:30 ` [PATCH v2 22/23] kvm: x86: Disable interception for IA32_XFD on demand Jing Liu
2021-12-20  9:07   ` Paolo Bonzini
2021-12-21  6:42     ` Liu, Jing2
2021-12-21  8:46       ` Paolo Bonzini
2021-12-17 15:30 ` [PATCH v2 23/23] kvm: x86: Disable RDMSR interception of IA32_XFD_ERR Jing Liu
2021-12-20  9:08   ` Paolo Bonzini
2021-12-21  6:29     ` Liu, Jing2
2021-12-21  8:48       ` Paolo Bonzini
2021-12-21  9:00         ` Liu, Jing2
2021-12-21  9:05           ` Paolo Bonzini
2021-12-17 18:52 ` [PATCH v2 00/23] AMX Support in KVM Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=39ca9998-e936-8a5b-4cd8-596d907f4d8f@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=guang.zeng@intel.com \
    --cc=jing2.liu@intel.com \
    --cc=jing2.liu@linux.intel.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=wei.w.wang@intel.com \
    --cc=x86@kernel.org \
    --cc=yang.zhong@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).