From 0d4cc1daff5002105632ed24c3ac451cfeb51d99 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 | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/arch/arm64/kvm/hyp/nvhe/mem_protect.c b/arch/arm64/kvm/hyp/nvhe/mem_protect.c index 25ebf70944b7..1d36fd64d42b 100644 --- a/arch/arm64/kvm/hyp/nvhe/mem_protect.c +++ b/arch/arm64/kvm/hyp/nvhe/mem_protect.c @@ -490,18 +490,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); - kvm_iommu_host_stage2_idmap_complete(false); - - return 0; + return kvm_pgtable_stage2_reclaim_leaves(&host_mmu.pgt, start, size); } static int host_stage2_unmap_unmoveable_regs(void)