[RFC PATCH v6 08/35] HACK! KVM: arm64: Enable SPE virtualization only in VHE mode

Alexandru Elisei
2025-11-14T16:07:54Z

For RFC only.

Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
arch/arm64/kvm/spe.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kvm/spe.c b/arch/arm64/kvm/spe.c
index 7e38f7d9075b..101258b55053 100644
--- a/arch/arm64/kvm/spe.c
+++ b/arch/arm64/kvm/spe.c
@@ -24,8 +24,8 @@ void kvm_host_spe_init(struct arm_spe_pmu *arm_spu)
{
struct arm_spu_entry *entry;

- /* TODO: pKVM support */
- if (is_protected_kvm_enabled())
+ /* TODO: pKVM and nVHE support */
+ if (is_protected_kvm_enabled() || !has_vhe())
return;

guard(mutex)(&arm_spus_lock);
--
2.51.2