Skip to content

Commit 822cab6

Browse files
Ralph CampbellBen Skeggs
authored andcommitted
drm/nouveau/svm: check for SVM initialized before migrating
When migrating system memory to GPU memory, check that SVM has been enabled. Even though most errors can be ignored since migration is a performance optimization, return an error because this is a violation of the API. Signed-off-by: Ralph Campbell <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
1 parent b92103b commit 822cab6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/gpu/drm/nouveau/nouveau_svm.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ nouveau_svmm_bind(struct drm_device *dev, void *data,
171171
mm = get_task_mm(current);
172172
down_read(&mm->mmap_sem);
173173

174+
if (!cli->svm.svmm) {
175+
up_read(&mm->mmap_sem);
176+
return -EINVAL;
177+
}
178+
174179
for (addr = args->va_start, end = args->va_start + size; addr < end;) {
175180
struct vm_area_struct *vma;
176181
unsigned long next;

0 commit comments

Comments
 (0)