ANDROID: KVM: arm64: Clear the PTEs which are not refcounted on unmap path

With coalescing we don't refcount default PTE entries. Fix an issue
which clears out non-refcounted PTE entries on the unmap path.

Bug: 279165129
Change-Id: Ie4fdabcc420d54c1338272d38abbe393fc5ce75c
Signed-off-by: Sebastian Ene <sebastianene@google.com>
This commit is contained in:
Sebastian Ene
2023-04-21 14:39:49 +00:00
parent b53185721e
commit 6e8704fc7a

View File

@@ -993,6 +993,8 @@ static int stage2_unmap_walker(u64 addr, u64 end, u32 level, kvm_pte_t *ptep,
*/
if (pte_ops->pte_is_counted_cb(pte, level))
stage2_put_pte(ptep, mmu, addr, level, mm_ops);
else
stage2_clear_pte(ptep, mmu, addr, level);
if (need_flush && mm_ops->dcache_clean_inval_poc)
mm_ops->dcache_clean_inval_poc(kvm_pte_follow(pte, mm_ops),