Skip to content

Commit fce11b6

Browse files
zcxGGmuavpatel
authored andcommitted
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 <zhouquan@iscas.ac.cn> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/230d6c8c8b8dd83081fcfd8d83a4d17c8245fa2f.1731552790.git.zhouquan@iscas.ac.cn Signed-off-by: Anup Patel <anup@brainfault.org>
1 parent 3b7270c commit fce11b6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

arch/riscv/kvm/mmu.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,11 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
205205
* +--------------------------------------------+
206206
*/
207207
do {
208-
struct vm_area_struct *vma = find_vma(current->mm, hva);
208+
struct vm_area_struct *vma;
209209
hva_t vm_start, vm_end;
210210

211-
if (!vma || vma->vm_start >= reg_end)
211+
vma = find_vma_intersection(current->mm, hva, reg_end);
212+
if (!vma)
212213
break;
213214

214215
/*

0 commit comments

Comments
 (0)