summaryrefslogtreecommitdiff
path: root/arch/arm64/kvm/mmu.c
diff options
context:
space:
mode:
authorOliver Upton <oliver.upton@linux.dev>2022-12-02 18:51:52 +0000
committerOliver Upton <oliver.upton@linux.dev>2023-01-12 21:09:20 +0000
commitddcadb297ce5cc1cec0b0882d8b750e5e06fc9f4 (patch)
treeb753ae0cfa880cbbe16aaa130debe6258d1ec90c /arch/arm64/kvm/mmu.c
parent9a7ad19ac804df56d3a150bcbe8f467a63821625 (diff)
downloadlinux-ddcadb297ce5cc1cec0b0882d8b750e5e06fc9f4.tar.gz
linux-ddcadb297ce5cc1cec0b0882d8b750e5e06fc9f4.tar.bz2
linux-ddcadb297ce5cc1cec0b0882d8b750e5e06fc9f4.zip
KVM: arm64: Ignore EAGAIN for walks outside of a fault
The page table walkers are invoked outside fault handling paths, such as write protecting a range of memory. EAGAIN is generally used by the walkers to retry execution due to races on a particular PTE, like taking an access fault on a PTE being invalidated from another thread. This early return behavior is undesirable for walkers that operate outside a fault handler. Suppress EAGAIN and continue the walk if operating outside a fault handler. Link: https://lore.kernel.org/r/20221202185156.696189-3-oliver.upton@linux.dev Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Diffstat (limited to 'arch/arm64/kvm/mmu.c')
-rw-r--r--arch/arm64/kvm/mmu.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
index 3ddee4137912..edfbe85f8f8a 100644
--- a/arch/arm64/kvm/mmu.c
+++ b/arch/arm64/kvm/mmu.c
@@ -1381,7 +1381,9 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
else
ret = kvm_pgtable_stage2_map(pgt, fault_ipa, vma_pagesize,
__pfn_to_phys(pfn), prot,
- memcache, KVM_PGTABLE_WALK_SHARED);
+ memcache,
+ KVM_PGTABLE_WALK_HANDLE_FAULT |
+ KVM_PGTABLE_WALK_SHARED);
/* Mark the page dirty only if the fault is handled successfully */
if (writable && !ret) {