aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiam Howlett <[email protected]>2021-06-28 19:39:05 -0700
committerLinus Torvalds <[email protected]>2021-06-29 10:53:51 -0700
commit900c83f88af06bf0466c28bdde8a2c011b855e44 (patch)
treeae927bbf43d080c52afbda795be389d05dc34d5b
parent27a14d287e16c308040508be9f0cb28bc935bd0e (diff)
arch/powerpc/kvm/book3s: use vma_lookup() in kvmppc_hv_setup_htab_rma()
Using vma_lookup() removes the requirement to check if the address is within the returned vma. The code is easier to understand and more compact. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Liam R. Howlett <[email protected]> Reviewed-by: Laurent Dufour <[email protected]> Acked-by: David Hildenbrand <[email protected]> Acked-by: Davidlohr Bueso <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--arch/powerpc/kvm/book3s_hv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index bc0813644666..fb83c84d116a 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -4758,8 +4758,8 @@ static int kvmppc_hv_setup_htab_rma(struct kvm_vcpu *vcpu)
/* Look up the VMA for the start of this memory slot */
hva = memslot->userspace_addr;
mmap_read_lock(kvm->mm);
- vma = find_vma(kvm->mm, hva);
- if (!vma || vma->vm_start > hva || (vma->vm_flags & VM_IO))
+ vma = vma_lookup(kvm->mm, hva);
+ if (!vma || (vma->vm_flags & VM_IO))
goto up_out;
psize = vma_kernel_pagesize(vma);