[RFC PATCH v6 07/35] HACK! KVM: arm64: Disable SPE virtualization if protected KVM is enabled

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

For RFC only.

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

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

+ /* TODO: pKVM support */
+ if (is_protected_kvm_enabled())
+ return;
+
guard(mutex)(&arm_spus_lock);

entry = kmalloc(sizeof(*entry), GFP_KERNEL);
--
2.51.2