Re: [PATCH v3 10/11] KVM: arm64: Dispatch stage-2 destruction by VM flavor

From: Steven Price

Date: Wed Nov 18 2026 - 12:04:53 EST


On 17/11/2026 15:02, Fuad Tabba wrote:
> Hi Steven,
>
> On Mon, 16 Nov 2026 16:43:56 +0000, Steven Price <steven.price@xxxxxxx> wrote:
> [...]
>> diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
> [...]
>> static void kvm_stage2_destroy(struct kvm_pgtable *pgt)
>> {
>> struct kvm *kvm = kvm_s2_mmu_to_kvm(pgt->mmu);
>> - unsigned int ia_bits = VTCR_EL2_IPA(pgt->mmu->vtcr);
>> -
>> - /*
>> - * Realm RTTs are inaccessible to the host and may contain stale data
>> - * after the RMM has released them. The non-root RTTs are explicitly
>> - * destroyed through RMI before the RD is destroyed; only the root PGD
>> - * pages remain to be freed here.
>> - */
>> - if (!kvm_vm_is_realm(kvm))
>> - stage2_destroy_range(pgt, 0, BIT(ia_bits));
>
> Could this patch go before patch 4? Then patch 4 wouldn't need to add
> this check.

Yes, that's a good idea - I'll make that change.

Thanks,
Steve