From cf2d193d9b798ad522a4b5d16aa72cef66d5e492 Mon Sep 17 00:00:00 2001 From: Quentin Perret Date: Wed, 22 Mar 2023 14:34:14 +0000 Subject: [PATCH] ANDROID: KVM: arm64: Don't recycle non-default PTEs When recycling host stage-2 page-table pages, we currenly blindly unmap all 'non-moveable' regions. To prepare the ground for allowing the mapping of those regions with non-default attributes, let's switch to using the recently introduced kvm_pgtable_stage2_reclaim_leaf() helper which will only reclaim pages containing PTEs with default attributes. Bug: 264070847 Change-Id: I4a441a20abe84d2405efcfa403908078c10be841 Signed-off-by: Quentin Perret --- arch/arm64/kvm/hyp/nvhe/mem_protect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kvm/hyp/nvhe/mem_protect.c b/arch/arm64/kvm/hyp/nvhe/mem_protect.c index d2686855036c..8880ef93a435 100644 --- a/arch/arm64/kvm/hyp/nvhe/mem_protect.c +++ b/arch/arm64/kvm/hyp/nvhe/mem_protect.c @@ -398,7 +398,7 @@ int host_stage2_unmap_reg_locked(phys_addr_t start, u64 size) hyp_assert_lock_held(&host_mmu.lock); - ret = kvm_pgtable_stage2_unmap(&host_mmu.pgt, start, size); + ret = kvm_pgtable_stage2_reclaim_leaves(&host_mmu.pgt, start, size); if (ret) return ret;