RISC-V: KVM: use vma_lookup() instead of find_vma_intersection()
authorBo Liu <liubo03@inspur.com>
Wed, 7 Dec 2022 03:46:11 +0000 (09:16 +0530)
committerAnup Patel <anup@brainfault.org>
Wed, 7 Dec 2022 03:46:11 +0000 (09:16 +0530)
vma_lookup() finds the vma of a specific address with a cleaner
interface and is more readable.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/kvm/mmu.c

index 3620eca..5942d10 100644 (file)
@@ -632,7 +632,7 @@ int kvm_riscv_gstage_map(struct kvm_vcpu *vcpu,
 
        mmap_read_lock(current->mm);
 
-       vma = find_vma_intersection(current->mm, hva, hva + 1);
+       vma = vma_lookup(current->mm, hva);
        if (unlikely(!vma)) {
                kvm_err("Failed to find VMA for hva 0x%lx\n", hva);
                mmap_read_unlock(current->mm);