From 789dd354a87c622bb04d7c7f0e861b7797a3c430 Mon Sep 17 00:00:00 2001 From: Mostafa Saleh Date: Wed, 2 Jul 2025 12:16:07 +0000 Subject: [PATCH] ANDROID: KVM: arm64: Don't update IOMMU under memory pressure host_stage2_unmap_unmoveable_regs() is called when the hypervisor pool is under pressure to map stage-2 enteries, so it unmap all enteries that can't be donated and owned by the host so it can be lazily faulted later. But that doesn't change any ownership of pages, so they are still owned by the host and must remain mapped in the IOMMU. Bug: 428939924 Change-Id: Id91183619a316a67bda48d8e9adf9b6ef49c104f Signed-off-by: Mostafa Saleh --- arch/arm64/kvm/hyp/nvhe/mem_protect.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/arch/arm64/kvm/hyp/nvhe/mem_protect.c b/arch/arm64/kvm/hyp/nvhe/mem_protect.c index bc1f8cb3faf3..afdd36e4ae8a 100644 --- a/arch/arm64/kvm/hyp/nvhe/mem_protect.c +++ b/arch/arm64/kvm/hyp/nvhe/mem_protect.c @@ -491,17 +491,9 @@ int __pkvm_prot_finalize(void) int host_stage2_unmap_reg_locked(phys_addr_t start, u64 size) { - int ret; - hyp_assert_lock_held(&host_mmu.lock); - ret = kvm_pgtable_stage2_reclaim_leaves(&host_mmu.pgt, start, size); - if (ret) - return ret; - - kvm_iommu_host_stage2_idmap(start, start + size, 0); - - return 0; + return kvm_pgtable_stage2_reclaim_leaves(&host_mmu.pgt, start, size); } static int host_stage2_unmap_unmoveable_regs(void)