]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/amdkfd: avoid conflicting address mappings
authorAlex Sierra <alex.sierra@amd.com>
Mon, 7 Jun 2021 18:14:50 +0000 (13:14 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 1 Sep 2021 20:55:12 +0000 (16:55 -0400)
commit2028269f80500b40a5c1495e59ac9a70dd7a711c
tree21783b13b5996e2de78efa9ac934c5cf6658e3f4
parentc689d66f5f40dcd3241a3d0787d28359557c2272
drm/amdkfd: avoid conflicting address mappings

[Why]
Avoid conflict with address ranges mapped by SVM
mechanism that try to be allocated again through
ioctl_alloc in the same process. And viceversa.

[How]
For ioctl_alloc_memory_of_gpu allocations
Check if the address range passed into ioctl memory
alloc does not exist already in the kfd_process
svms->objects interval tree.

For SVM allocations
Look for the address range into the interval tree VA from
the VM inside of each pdds used in a kfd_process.

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
drivers/gpu/drm/amd/amdkfd/kfd_svm.c