Skip to content

Commit b92103b

Browse files
Ralph CampbellBen Skeggs
authored andcommitted
drm/nouveau/svm: fix vma range check for migration
find_vma_intersection(mm, start, end) only guarantees that end is greater than or equal to vma->vm_start but doesn't guarantee that start is greater than or equal to vma->vm_start. The calculation for the intersecting range in nouveau_svmm_bind() isn't accounting for this and can call migrate_vma_setup() with a starting address less than vma->vm_start. This results in migrate_vma_setup() returning -EINVAL for the range instead of nouveau skipping that part of the range and migrating the rest. Signed-off-by: Ralph Campbell <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
1 parent e18c6e8 commit b92103b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/nouveau/nouveau_svm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ nouveau_svmm_bind(struct drm_device *dev, void *data,
179179
if (!vma)
180180
break;
181181

182+
addr = max(addr, vma->vm_start);
182183
next = min(vma->vm_end, end);
183184
/* This is a best effort so we ignore errors */
184185
nouveau_dmem_migrate_vma(cli->drm, vma, addr, next);

0 commit comments

Comments
 (0)