[RFC PATCH v7 28/28] KVM: arm64: Allow the creation of a SPE enabled VM
Lorenzo Stoakes (ARM)
ljs at kernel.org
Tue Nov 3 11:49:14 PST 2026
On Thu, Sep 03, 2026 at 05:06:23PM +0100, Alexandru Elisei wrote:
> Everything is in place, allow userspace to enable SPE for a virtual
> machine.
I guess I've become fairly predictable :P but I think you should say more in
this commit message.
Explain what's being enabled, that you've laid the foundations, why you're
default =y, the dependency on the PMU, etc.
Also worth mentioning that you're bumping KVM_VCPU_MAX_FEATURES to make SPE
actually available to users when before it wasn't (and that you were doing the
work incrementally and only enabling once all in place for e.g.).
>
> Signed-off-by: Alexandru Elisei <alexandru.elisei at arm.com>
Agree on your response to Sashiko.
> ---
> arch/arm64/include/asm/kvm_host.h | 2 +-
> arch/arm64/kvm/Kconfig | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
> index ff77f6ac3adf..32b30ffdcf77 100644
> --- a/arch/arm64/include/asm/kvm_host.h
> +++ b/arch/arm64/include/asm/kvm_host.h
> @@ -40,7 +40,7 @@
>
> #define KVM_MAX_VCPUS VGIC_V3_MAX_CPUS
>
> -#define KVM_VCPU_MAX_FEATURES 10
> +#define KVM_VCPU_MAX_FEATURES 11
> #define KVM_VCPU_VALID_FEATURES (BIT(KVM_VCPU_MAX_FEATURES) - 1)
>
> #define KVM_REQ_SLEEP \
> diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
> index 2bc8e34c538d..a285b18eb1cc 100644
> --- a/arch/arm64/kvm/Kconfig
> +++ b/arch/arm64/kvm/Kconfig
> @@ -106,9 +106,9 @@ endif # NVHE_EL2_DEBUG
>
>
> config KVM_ARM_SPE
> - bool
> + bool "Support SPE in guest"
I think this description could have been there all along?
> depends on KVM && ARM_SPE_PMU
> - default n
> + default y
Definitely need to justify this for a new feature :) Especially as there are
erratum.
I guess the argument is that it depends on ARM_SPE_PMU and somebody setting that
would by implication want KVM_ARM_SPE.
If you go that way probably better to just make it explicit so the user can't
have a weird setup with 1 but not the other?
Something like:
config KVM_ARM_SPE
- bool
+ def_bool y
depends on KVM && ARM_SPE_PMU
- default n
Maybe?
> help
> Adds support for Statistical Profiling Extension (SPE) in virtual
> machines.
> --
> 2.43.0
>
>
--
Cheers, Lorenzo
More information about the linux-arm-kernel
mailing list