lkml.org 
[lkml]   [2021]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 06/94] arch/powerpc/kvm/book3s: Use vma_lookup() in kvmppc_hv_setup_htab_rma()
    Date
    Using vma_lookup() removes the requirement to check if the address is
    within the returned vma.

    Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
    ---
    arch/powerpc/kvm/book3s_hv.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
    index 4a532410e128..89a942e652e5 100644
    --- a/arch/powerpc/kvm/book3s_hv.c
    +++ b/arch/powerpc/kvm/book3s_hv.c
    @@ -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);
    --
    2.30.2
    \
     
     \ /
      Last update: 2021-04-28 17:39    [W:2.797 / U:2.516 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site