drm/amdkfd: unregistered svm range not overlap with TTM range
authorPhilip Yang <Philip.Yang@amd.com>
Tue, 12 Oct 2021 03:12:25 +0000 (23:12 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 14 Oct 2021 02:20:13 +0000 (22:20 -0400)
commit43fc10c1875fe6a5035fd4e0379f863c381347c9
tree26f6ac89d8cffacfb4f5c8bec0e03f2d80790b99
parentf23750b5b3d98653b31d4469592935ef6364ad67
drm/amdkfd: unregistered svm range not overlap with TTM range

When creating unregistered new svm range to recover retry fault, avoid
new svm range to overlap with ranges or userptr ranges managed by TTM,
otherwise svm migration will trigger TTM or userptr eviction, to evict
user queues unexpectedly.

Change helper amdgpu_ttm_tt_affect_userptr to return userptr which is
inside the range. Add helper svm_range_check_vm_userptr to scan all
userptr of the vm, and return overlap userptr bo start, last.

Signed-off-by: Philip Yang <Philip.Yang@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_ttm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
drivers/gpu/drm/amd/amdkfd/kfd_svm.c