drm/amdgpu: fix potential VM faults
authorChristian König <christian.koenig@amd.com>
Thu, 19 Sep 2019 08:38:57 +0000 (10:38 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 Oct 2019 19:50:18 +0000 (15:50 -0400)
When we allocate new page tables under memory
pressure we should not evict old ones.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

index f10b6175e20cfe79d5d32ab1bf2b87cd69c42a8b..b8e5076e5e30d4466626d465855a23507334d398 100644 (file)
@@ -517,7 +517,8 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
                .interruptible = (bp->type != ttm_bo_type_kernel),
                .no_wait_gpu = bp->no_wait_gpu,
                .resv = bp->resv,
-               .flags = TTM_OPT_FLAG_ALLOW_RES_EVICT
+               .flags = bp->type != ttm_bo_type_kernel ?
+                       TTM_OPT_FLAG_ALLOW_RES_EVICT : 0
        };
        struct amdgpu_bo *bo;
        unsigned long page_align, size = bp->size;