aboutsummaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2020-04-16 11:59:06 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-05-15 12:26:14 -0400
commit5b494aea13fe9ec67365510c0d75835428cbb303 (patch)
tree9ed6d43f8a7c0fde6c9292ccc100271c522e4028 /virt
parentdd03bcaad0b1a62c8ea6297e6f2a5993c1c5cd30 (diff)
KVM: No need to retry for hva_to_pfn_remapped()
hva_to_pfn_remapped() calls fixup_user_fault(), which has already handled the retry gracefully. Even if "unlocked" is set to true, it means that we've got a VM_FAULT_RETRY inside fixup_user_fault(), however the page fault has already retried and we should have the pfn set correctly. No need to do that again. Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20200416155906.267462-1-peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/kvm_main.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index e12317f32c5e..bef3d8d40685 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1831,8 +1831,6 @@ static int hva_to_pfn_remapped(struct vm_area_struct *vma,
r = fixup_user_fault(current, current->mm, addr,
(write_fault ? FAULT_FLAG_WRITE : 0),
&unlocked);
- if (unlocked)
- return -EAGAIN;
if (r)
return r;
@@ -1903,15 +1901,12 @@ static kvm_pfn_t hva_to_pfn(unsigned long addr, bool atomic, bool *async,
goto exit;
}
-retry:
vma = find_vma_intersection(current->mm, addr, addr + 1);
if (vma == NULL)
pfn = KVM_PFN_ERR_FAULT;
else if (vma->vm_flags & (VM_IO | VM_PFNMAP)) {
r = hva_to_pfn_remapped(vma, addr, async, write_fault, writable, &pfn);
- if (r == -EAGAIN)
- goto retry;
if (r < 0)
pfn = KVM_PFN_ERR_FAULT;
} else {

Privacy Policy