drm/ttm: Refuse to fault (prime-) imported pages
[deliverable/linux.git] / drivers / gpu / drm / ttm / ttm_bo_vm.c
index cdda784588859637fdb726f2320a45a05a68af39..12d7f53b7c13e441f92cd06f7c86a81e7984aea1 100644 (file)
@@ -132,6 +132,15 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
                return VM_FAULT_NOPAGE;
        }
 
+       /*
+        * Refuse to fault imported pages. This should be handled
+        * (if at all) by redirecting mmap to the exporter.
+        */
+       if (bo->ttm && (bo->ttm->page_flags & TTM_PAGE_FLAG_SG)) {
+               retval = VM_FAULT_SIGBUS;
+               goto out_unlock;
+       }
+
        if (bdev->driver->fault_reserve_notify) {
                ret = bdev->driver->fault_reserve_notify(bo);
                switch (ret) {
This page took 0.024666 seconds and 5 git commands to generate.