linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: arm64: Bump KVM_VCPU_MAX_FEATURES
@ 2024-11-27 14:56 Steven Price
  2024-11-27 15:16 ` Marc Zyngier
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Price @ 2024-11-27 14:56 UTC (permalink / raw)
  To: Catalin Marinas, Marc Zyngier, Oliver Upton, Will Deacon
  Cc: Steven Price, Joey Gouly, Suzuki K Poulose, Zenghui Yu, kvmarm,
	linux-arm-kernel, linux-kernel

When the KVM_ARM_VCPU_HAS_EL2 define was added, the value of
KVM_VCPU_MAX_FEATURES wasn't incremented, so that feature has never been
in the KVM_VCPU_VALID_FEATURES bit mask. This means the HAS_EL2 feature
will never be exposed to user space even if the system supports it.

Fixes: 89b0e7de3451 ("KVM: arm64: nv: Introduce nested virtualization VCPU feature")
Signed-off-by: Steven Price <steven.price@arm.com>
---
I might be missing something, and it's possible that
KVM_ARM_VCPU_HAS_EL2 is deliberately not exposed yet. However I'm
working on v6 of the host CCA series and as part of that want to add a
new feature but and bump KVM_VCPU_MAX_FEATURES up to 9.

 arch/arm64/include/asm/kvm_host.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
index e18e9244d17a..af7c827b216e 100644
--- a/arch/arm64/include/asm/kvm_host.h
+++ b/arch/arm64/include/asm/kvm_host.h
@@ -39,7 +39,7 @@
 
 #define KVM_MAX_VCPUS VGIC_V3_MAX_CPUS
 
-#define KVM_VCPU_MAX_FEATURES 7
+#define KVM_VCPU_MAX_FEATURES 8
 #define KVM_VCPU_VALID_FEATURES	(BIT(KVM_VCPU_MAX_FEATURES) - 1)
 
 #define KVM_REQ_SLEEP \
-- 
2.43.0



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

* Re: [PATCH] KVM: arm64: Bump KVM_VCPU_MAX_FEATURES
  2024-11-27 14:56 [PATCH] KVM: arm64: Bump KVM_VCPU_MAX_FEATURES Steven Price
@ 2024-11-27 15:16 ` Marc Zyngier
  2024-11-27 15:24   ` Steven Price
  0 siblings, 1 reply; 4+ messages in thread
From: Marc Zyngier @ 2024-11-27 15:16 UTC (permalink / raw)
  To: Steven Price
  Cc: Catalin Marinas, Oliver Upton, Will Deacon, Joey Gouly,
	Suzuki K Poulose, Zenghui Yu, kvmarm, linux-arm-kernel,
	linux-kernel

On Wed, 27 Nov 2024 14:56:31 +0000,
Steven Price <steven.price@arm.com> wrote:
> 
> When the KVM_ARM_VCPU_HAS_EL2 define was added, the value of
> KVM_VCPU_MAX_FEATURES wasn't incremented, so that feature has never been
> in the KVM_VCPU_VALID_FEATURES bit mask. This means the HAS_EL2 feature
> will never be exposed to user space even if the system supports it.
> 
> Fixes: 89b0e7de3451 ("KVM: arm64: nv: Introduce nested virtualization VCPU feature")
> Signed-off-by: Steven Price <steven.price@arm.com>
> ---
> I might be missing something, and it's possible that
> KVM_ARM_VCPU_HAS_EL2 is deliberately not exposed yet.

This is on purpose. I'm not planning to enable EL2 support until it is
ready.

> However I'm
> working on v6 of the host CCA series and as part of that want to add a
> new feature but and bump KVM_VCPU_MAX_FEATURES up to 9.

Well, I guess that defines some ordering then! :D

	M.

-- 
Without deviation from the norm, progress is not possible.


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

* Re: [PATCH] KVM: arm64: Bump KVM_VCPU_MAX_FEATURES
  2024-11-27 15:16 ` Marc Zyngier
@ 2024-11-27 15:24   ` Steven Price
  2024-11-27 15:41     ` Marc Zyngier
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Price @ 2024-11-27 15:24 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Catalin Marinas, Oliver Upton, Will Deacon, Joey Gouly,
	Suzuki K Poulose, Zenghui Yu, kvmarm, linux-arm-kernel,
	linux-kernel

On 27/11/2024 15:16, Marc Zyngier wrote:
> On Wed, 27 Nov 2024 14:56:31 +0000,
> Steven Price <steven.price@arm.com> wrote:
>>
>> When the KVM_ARM_VCPU_HAS_EL2 define was added, the value of
>> KVM_VCPU_MAX_FEATURES wasn't incremented, so that feature has never been
>> in the KVM_VCPU_VALID_FEATURES bit mask. This means the HAS_EL2 feature
>> will never be exposed to user space even if the system supports it.
>>
>> Fixes: 89b0e7de3451 ("KVM: arm64: nv: Introduce nested virtualization VCPU feature")
>> Signed-off-by: Steven Price <steven.price@arm.com>
>> ---
>> I might be missing something, and it's possible that
>> KVM_ARM_VCPU_HAS_EL2 is deliberately not exposed yet.
> 
> This is on purpose. I'm not planning to enable EL2 support until it is
> ready.

I did suspect that's the case - but it might have been better to knobble
it in system_supported_vcpu_features()/kvm_vcpu_init_check_features()
rather than 'hiding' it in the MAX_FEATURES. But hindsight is a
wonderful thing ;)

>> However I'm
>> working on v6 of the host CCA series and as part of that want to add a
>> new feature but and bump KVM_VCPU_MAX_FEATURES up to 9.
> 
> Well, I guess that defines some ordering then! :D

Indeed - I'll try to remember to include note about this "dependency" in
my cover letter. We're likely to need a few more rounds for CCA to be
ready, so hopefully NV will naturally be there in time :D

Thanks,
Steve



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

* Re: [PATCH] KVM: arm64: Bump KVM_VCPU_MAX_FEATURES
  2024-11-27 15:24   ` Steven Price
@ 2024-11-27 15:41     ` Marc Zyngier
  0 siblings, 0 replies; 4+ messages in thread
From: Marc Zyngier @ 2024-11-27 15:41 UTC (permalink / raw)
  To: Steven Price
  Cc: Catalin Marinas, Oliver Upton, Will Deacon, Joey Gouly,
	Suzuki K Poulose, Zenghui Yu, kvmarm, linux-arm-kernel,
	linux-kernel

On Wed, 27 Nov 2024 15:24:32 +0000,
Steven Price <steven.price@arm.com> wrote:
> 
> On 27/11/2024 15:16, Marc Zyngier wrote:
> > On Wed, 27 Nov 2024 14:56:31 +0000,
> > Steven Price <steven.price@arm.com> wrote:
> >>
> >> When the KVM_ARM_VCPU_HAS_EL2 define was added, the value of
> >> KVM_VCPU_MAX_FEATURES wasn't incremented, so that feature has never been
> >> in the KVM_VCPU_VALID_FEATURES bit mask. This means the HAS_EL2 feature
> >> will never be exposed to user space even if the system supports it.
> >>
> >> Fixes: 89b0e7de3451 ("KVM: arm64: nv: Introduce nested virtualization VCPU feature")
> >> Signed-off-by: Steven Price <steven.price@arm.com>
> >> ---
> >> I might be missing something, and it's possible that
> >> KVM_ARM_VCPU_HAS_EL2 is deliberately not exposed yet.
> > 
> > This is on purpose. I'm not planning to enable EL2 support until it is
> > ready.
> 
> I did suspect that's the case - but it might have been better to knobble
> it in system_supported_vcpu_features()/kvm_vcpu_init_check_features()
> rather than 'hiding' it in the MAX_FEATURES. But hindsight is a
> wonderful thing ;)
> 
> >> However I'm
> >> working on v6 of the host CCA series and as part of that want to add a
> >> new feature but and bump KVM_VCPU_MAX_FEATURES up to 9.
> > 
> > Well, I guess that defines some ordering then! :D
> 
> Indeed - I'll try to remember to include note about this "dependency" in
> my cover letter. We're likely to need a few more rounds for CCA to be
> ready, so hopefully NV will naturally be there in time :D

Any minute now, according to those impersonating a French physicist...

	M.

-- 
Without deviation from the norm, progress is not possible.


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

end of thread, other threads:[~2024-11-27 15:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-27 14:56 [PATCH] KVM: arm64: Bump KVM_VCPU_MAX_FEATURES Steven Price
2024-11-27 15:16 ` Marc Zyngier
2024-11-27 15:24   ` Steven Price
2024-11-27 15:41     ` Marc Zyngier

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