OSDN Git Service

drm/amdkfd: Prevent user space using both svm and kfd api to register same user buffer
authorXiaogang Chen <xiaogang.chen@amd.com>
Wed, 8 Feb 2023 23:10:59 +0000 (17:10 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 14 Feb 2023 20:47:09 +0000 (15:47 -0500)
commit677033b5c903e056d27bd58eccb48c79d92008a8
tree86b5a6fe2eba03587089ad16ebe861c54b2113f9
parentbe9f1daad7b4064474a6e5dd03c55b882c9cf928
drm/amdkfd: Prevent user space using both svm and kfd api to register same user buffer

When xnack is on user space can use svm page restore to set a vm range without
setup it first, then use regular api to register. Currently kfd api and svm are
not interoperable. We already have check on that, but for user buffer the mapping
address is not same as buffer cpu virtual address. Add checking on that to
avoid error propagate to hmm.

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/amdkfd/kfd_chardev.c