KVM Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v3] doc: kvm: Fix return description of KVM_SET_MSRS
@ 2019-09-05  0:57 Xiaoyao Li
  2019-09-10 17:14 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Xiaoyao Li @ 2019-09-05  0:57 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: Xiaoyao Li, Jonathan Corbet, Sean Christopherson, kvm, linux-doc,
	linux-kernel

Userspace can use ioctl KVM_SET_MSRS to update a set of MSRs of guest.
This ioctl set specified MSRs one by one. If it fails to set an MSR,
e.g., due to setting reserved bits, the MSR is not supported/emulated by
KVM, etc..., it stops processing the MSR list and returns the number of
MSRs have been set successfully.

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
---
v3:
  refine the description based on Sean's comment.  

v2:
  elaborate the changelog and description of ioctl KVM_SET_MSRS based on
  Sean's comments.
---
 Documentation/virt/kvm/api.txt | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Documentation/virt/kvm/api.txt b/Documentation/virt/kvm/api.txt
index 2d067767b617..24541e52e96e 100644
--- a/Documentation/virt/kvm/api.txt
+++ b/Documentation/virt/kvm/api.txt
@@ -586,7 +586,7 @@ Capability: basic
 Architectures: x86
 Type: vcpu ioctl
 Parameters: struct kvm_msrs (in)
-Returns: 0 on success, -1 on error
+Returns: number of msrs successfully set (see below), -1 on error
 
 Writes model-specific registers to the vcpu.  See KVM_GET_MSRS for the
 data structures.
@@ -595,6 +595,11 @@ Application code should set the 'nmsrs' member (which indicates the
 size of the entries array), and the 'index' and 'data' members of each
 array entry.
 
+It tries to set the MSRs in array entries[] one by one. If setting an MSR
+fails, e.g., due to setting reserved bits, the MSR isn't supported/emulated
+by KVM, etc..., it stops processing the MSR list and returns the number of
+MSRs that have been set successfully.
+
 
 4.20 KVM_SET_CPUID
 
-- 
2.19.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] doc: kvm: Fix return description of KVM_SET_MSRS
  2019-09-05  0:57 [PATCH v3] doc: kvm: Fix return description of KVM_SET_MSRS Xiaoyao Li
@ 2019-09-10 17:14 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2019-09-10 17:14 UTC (permalink / raw)
  To: Xiaoyao Li, Radim Krčmář
  Cc: Jonathan Corbet, Sean Christopherson, kvm, linux-doc, linux-kernel

On 05/09/19 02:57, Xiaoyao Li wrote:
> Userspace can use ioctl KVM_SET_MSRS to update a set of MSRs of guest.
> This ioctl set specified MSRs one by one. If it fails to set an MSR,
> e.g., due to setting reserved bits, the MSR is not supported/emulated by
> KVM, etc..., it stops processing the MSR list and returns the number of
> MSRs have been set successfully.
> 
> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>

Queued, thanks.

Paolo

> ---
> v3:
>   refine the description based on Sean's comment.  
> 
> v2:
>   elaborate the changelog and description of ioctl KVM_SET_MSRS based on
>   Sean's comments.
> ---
>  Documentation/virt/kvm/api.txt | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/virt/kvm/api.txt b/Documentation/virt/kvm/api.txt
> index 2d067767b617..24541e52e96e 100644
> --- a/Documentation/virt/kvm/api.txt
> +++ b/Documentation/virt/kvm/api.txt
> @@ -586,7 +586,7 @@ Capability: basic
>  Architectures: x86
>  Type: vcpu ioctl
>  Parameters: struct kvm_msrs (in)
> -Returns: 0 on success, -1 on error
> +Returns: number of msrs successfully set (see below), -1 on error
>  
>  Writes model-specific registers to the vcpu.  See KVM_GET_MSRS for the
>  data structures.
> @@ -595,6 +595,11 @@ Application code should set the 'nmsrs' member (which indicates the
>  size of the entries array), and the 'index' and 'data' members of each
>  array entry.
>  
> +It tries to set the MSRs in array entries[] one by one. If setting an MSR
> +fails, e.g., due to setting reserved bits, the MSR isn't supported/emulated
> +by KVM, etc..., it stops processing the MSR list and returns the number of
> +MSRs that have been set successfully.
> +
>  
>  4.20 KVM_SET_CPUID
>  
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-05  0:57 [PATCH v3] doc: kvm: Fix return description of KVM_SET_MSRS Xiaoyao Li
2019-09-10 17:14 ` Paolo Bonzini

KVM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kvm/0 kvm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kvm kvm/ https://lore.kernel.org/kvm \
		kvm@vger.kernel.org kvm@archiver.kernel.org
	public-inbox-index kvm


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.kvm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox