From 3f5ffbd827db867581cbb84c0bd68eb91e68ea44 Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Fri, 25 Mar 2022 11:31:35 +0000 Subject: [PATCH] ANDROID: KVM: arm64: Drop FOLL_FORCE when pinning guest memory pages Passing FOLL_FORCE when pinning guest memory pages was intended to allow the VMM to map guest memory as PROT_NONE without prohibiting access from the guest. As it turns out, crosvm doesn't implement this, and since the host kernel will inject a signal into the VMM on a bad access irrespective of the stage-1 permissions, we can drop the FOLL_FORCE flag altogether. Bug: 226564150 Signed-off-by: Will Deacon Change-Id: If21091b6adf3dbe4155c5c840753c912d283b159 --- arch/arm64/kvm/mmu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c index 30d2a349786f..fc39dfc04fca 100644 --- a/arch/arm64/kvm/mmu.c +++ b/arch/arm64/kvm/mmu.c @@ -1163,10 +1163,7 @@ static int pkvm_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, unsigned long hva) { struct mm_struct *mm = current->mm; - unsigned int flags = FOLL_FORCE | - FOLL_HWPOISON | - FOLL_LONGTERM | - FOLL_WRITE; + unsigned int flags = FOLL_HWPOISON | FOLL_LONGTERM | FOLL_WRITE; struct kvm_pinned_page *ppage; struct kvm *kvm = vcpu->kvm; struct page *page;