From: Quan Zhou Date: Tue, 17 Jun 2025 13:04:23 +0000 (+0800) Subject: RISC-V: KVM: Use find_vma_intersection() to search for intersecting VMAs X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fce11b667022766087db8b47deb757fd3c9e8863;p=thirdparty%2Flinux.git RISC-V: KVM: Use find_vma_intersection() to search for intersecting VMAs There is already a helper function find_vma_intersection() in KVM for searching intersecting VMAs, use it directly. Signed-off-by: Quan Zhou Reviewed-by: Anup Patel Link: https://lore.kernel.org/r/230d6c8c8b8dd83081fcfd8d83a4d17c8245fa2f.1731552790.git.zhouquan@iscas.ac.cn Signed-off-by: Anup Patel --- diff --git a/arch/riscv/kvm/mmu.c b/arch/riscv/kvm/mmu.c index 9f7dcd8cd7415..5465567df5a75 100644 --- a/arch/riscv/kvm/mmu.c +++ b/arch/riscv/kvm/mmu.c @@ -205,10 +205,11 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, * +--------------------------------------------+ */ do { - struct vm_area_struct *vma = find_vma(current->mm, hva); + struct vm_area_struct *vma; hva_t vm_start, vm_end; - if (!vma || vma->vm_start >= reg_end) + vma = find_vma_intersection(current->mm, hva, reg_end); + if (!vma) break; /*