All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: arm64: Fix the KVM_ARM_PREFERRED_TARGET documentation
@ 2026-08-31 16:28 Fuad Tabba
  2026-09-08 13:30 ` Wei-Lin Chang
  0 siblings, 1 reply; 2+ messages in thread
From: Fuad Tabba @ 2026-08-31 16:28 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton, kvmarm, linux-arm-kernel,
	linux-kernel
  Cc: Catalin Marinas, Will Deacon, Joey Gouly, Steffen Eiden,
	Suzuki K Poulose, Zenghui Yu, Vincent Donnefort, Quentin Perret,
	Fuad Tabba, kvm

KVM_ARM_PREFERRED_TARGET has never set a feature bit: the original arm64
implementation zeroed the bitmap, and kvm_vcpu_preferred_target(), which
only ever zeroed it, was removed by commit 5346f7e13e5e ("KVM: arm64:
Always return generic v8 as the preferred target"). The ENODEV error had
gone earlier still, with commit 08e873cb70f3 ("KVM: arm64: Change the
return type of kvm_vcpu_preferred_target()"). Document what it returns,
that userspace selects vCPU features itself, and drop the error.

No functional change intended.

Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
---
 Documentation/virt/kvm/api.rst | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
index e0430cc750c9e..193f3b0ec77d1 100644
--- a/Documentation/virt/kvm/api.rst
+++ b/Documentation/virt/kvm/api.rst
@@ -3600,20 +3600,14 @@ Possible features:
 :Parameters: struct kvm_vcpu_init (out)
 :Returns: 0 on success; -1 on error
 
-Errors:
-
-  ======     ==========================================
-  ENODEV     no preferred target available for the host
-  ======     ==========================================
-
 This queries KVM for preferred CPU target type which can be emulated
 by KVM on underlying host.
 
-The ioctl returns struct kvm_vcpu_init instance containing information
-about preferred CPU target type and recommended features for it.  The
-kvm_vcpu_init->features bitmap returned will have feature bits set if
-the preferred target recommends setting these features, but this is
-not mandatory.
+The ioctl returns a struct kvm_vcpu_init instance containing the
+preferred CPU target type. The kvm_vcpu_init->features bitmap is
+returned empty: userspace selects the vCPU features itself, and their
+availability is reported by the capabilities listed under
+KVM_ARM_VCPU_INIT.
 
 The information returned by this ioctl can be used to prepare an instance
 of struct kvm_vcpu_init for KVM_ARM_VCPU_INIT ioctl which will result in

base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
-- 
2.39.5



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

* Re: [PATCH] KVM: arm64: Fix the KVM_ARM_PREFERRED_TARGET documentation
  2026-08-31 16:28 [PATCH] KVM: arm64: Fix the KVM_ARM_PREFERRED_TARGET documentation Fuad Tabba
@ 2026-09-08 13:30 ` Wei-Lin Chang
  0 siblings, 0 replies; 2+ messages in thread
From: Wei-Lin Chang @ 2026-09-08 13:30 UTC (permalink / raw)
  To: Fuad Tabba, Marc Zyngier, Oliver Upton, kvmarm, linux-arm-kernel,
	linux-kernel
  Cc: Catalin Marinas, Will Deacon, Joey Gouly, Steffen Eiden,
	Suzuki K Poulose, Zenghui Yu, Vincent Donnefort, Quentin Perret,
	Fuad Tabba, kvm

On Mon, Aug 31, 2026 at 05:28:15PM +0100, Fuad Tabba wrote:
> KVM_ARM_PREFERRED_TARGET has never set a feature bit: the original arm64
> implementation zeroed the bitmap, and kvm_vcpu_preferred_target(), which
> only ever zeroed it, was removed by commit 5346f7e13e5e ("KVM: arm64:
> Always return generic v8 as the preferred target"). The ENODEV error had
> gone earlier still, with commit 08e873cb70f3 ("KVM: arm64: Change the
> return type of kvm_vcpu_preferred_target()"). Document what it returns,
> that userspace selects vCPU features itself, and drop the error.
> 
> No functional change intended.
> 
> Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>

Reviewed-by: Wei-Lin Chang <weilin.chang@arm.com>

> ---
>  Documentation/virt/kvm/api.rst | 16 +++++-----------
>  1 file changed, 5 insertions(+), 11 deletions(-)
> 
> diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
> index e0430cc750c9e..193f3b0ec77d1 100644
> --- a/Documentation/virt/kvm/api.rst
> +++ b/Documentation/virt/kvm/api.rst
> @@ -3600,20 +3600,14 @@ Possible features:
>  :Parameters: struct kvm_vcpu_init (out)
>  :Returns: 0 on success; -1 on error
>  
> -Errors:
> -
> -  ======     ==========================================
> -  ENODEV     no preferred target available for the host
> -  ======     ==========================================
> -
>  This queries KVM for preferred CPU target type which can be emulated
>  by KVM on underlying host.
>  
> -The ioctl returns struct kvm_vcpu_init instance containing information
> -about preferred CPU target type and recommended features for it.  The
> -kvm_vcpu_init->features bitmap returned will have feature bits set if
> -the preferred target recommends setting these features, but this is
> -not mandatory.
> +The ioctl returns a struct kvm_vcpu_init instance containing the
> +preferred CPU target type. The kvm_vcpu_init->features bitmap is
> +returned empty: userspace selects the vCPU features itself, and their
> +availability is reported by the capabilities listed under
> +KVM_ARM_VCPU_INIT.
>  
>  The information returned by this ioctl can be used to prepare an instance
>  of struct kvm_vcpu_init for KVM_ARM_VCPU_INIT ioctl which will result in
> 
> base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
> -- 
> 2.39.5
> 


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

end of thread, other threads:[~2026-09-08 13:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 16:28 [PATCH] KVM: arm64: Fix the KVM_ARM_PREFERRED_TARGET documentation Fuad Tabba
2026-09-08 13:30 ` Wei-Lin Chang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.