drm/amdkfd: Remove skiping userptr buffer mapping when mmu notifier marks it as invalid
authorXiaogang Chen <xiaogang.chen@amd.com>
Sat, 29 Oct 2022 00:13:31 +0000 (19:13 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 4 Nov 2022 20:05:54 +0000 (16:05 -0400)
commitfcf00f8d29f2fc6bf00531a1447be28b99073cc3
tree4856ef26756c167b9cc094882576dd832d68c420
parent79b72db63392d35a4dbcd4743b95cb668691f790
drm/amdkfd: Remove skiping userptr buffer mapping when mmu notifier marks it as invalid

mmu notifier does not always hold mm->sem during call back. That causes
a race condition between kfd userprt buffer mapping and mmu notifier
which leds to gpu shadder or SDMA access userptr buffer before it has been
mapped to gpu VM. Always map userptr buffer to avoid that though it may make
some userprt buffers mapped two times.

Suggested-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Xiaogang Chen <xiaogang.chen@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c