]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
arch/powerpc/kvm/book3s: Use vma_lookup() in kvmppc_hv_setup_htab_rma()
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 8 Apr 2021 17:25:21 +0000 (13:25 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 6 May 2021 17:25:45 +0000 (13:25 -0400)
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.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
arch/powerpc/kvm/book3s_hv.c

index 28a80d240b7643b974c9a55b8bfb24632710b560..a3a4b2179350911fb8d856f7e3e00460c857d973 100644 (file)
@@ -4759,8 +4759,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);