Skip to content
Commit fa5239f2 authored by Felix Kuehling's avatar Felix Kuehling Committed by Christian König
Browse files

drm/amdgpu: workaround failed COW checks for Thunk VMAs

KFD Thunk maps invisible VRAM BOs with PROT_NONE, MAP_PRIVATE.
is_cow_mapping returns true for these mappings, which causes mmap to fail
in ttm_bo_mmap_obj.

As a workaround, clear VM_MAYWRITE for PROT_NONE-COW mappings. This
should prevent the mapping from ever becoming writable and makes
is_cow_mapping(vm_flags) false.

Fixes: f91142c6

 ("drm/ttm: nuke VM_MIXEDMAP on BO mappings v3")
Suggested-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Tested-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210715190537.585456-1-Felix.Kuehling@amd.com
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
parent 32a19de2
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