Commit 822cab61 authored by Ralph Campbell's avatar Ralph Campbell Committed by Ben Skeggs

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: default avatarRalph Campbell <rcampbell@nvidia.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent b92103b5
...@@ -171,6 +171,11 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, ...@@ -171,6 +171,11 @@ nouveau_svmm_bind(struct drm_device *dev, void *data,
mm = get_task_mm(current); mm = get_task_mm(current);
down_read(&mm->mmap_sem); down_read(&mm->mmap_sem);
if (!cli->svm.svmm) {
up_read(&mm->mmap_sem);
return -EINVAL;
}
for (addr = args->va_start, end = args->va_start + size; addr < end;) { for (addr = args->va_start, end = args->va_start + size; addr < end;) {
struct vm_area_struct *vma; struct vm_area_struct *vma;
unsigned long next; unsigned long next;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment