--- a/lib/test_hmm.c~lib-test_hmm-use-vma_lookup-in-dmirror_migrate +++ a/lib/test_hmm.c @@ -686,9 +686,8 @@ static int dmirror_migrate(struct dmirro mmap_read_lock(mm); for (addr = start; addr < end; addr = next) { - vma = find_vma(mm, addr); - if (!vma || addr < vma->vm_start || - !(vma->vm_flags & VM_READ)) { + vma = vma_lookup(mm, addr); + if (!vma || !(vma->vm_flags & VM_READ)) { ret = -EINVAL; goto out; }