Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

amdkfd: process USERPTR allocation only on the primary kfd process

The lifecycle of the primary kfd process is tied to
the user space program, all secondary kfd process
would be destroyed when fd close. Thus only the primary
kfd process should process USERPTR memory allocation.

Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Zhu Lingshan and committed by
Alex Deucher
1707d576 26fc46d7

+6
+6
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
··· 1062 1062 if (args->size == 0) 1063 1063 return -EINVAL; 1064 1064 1065 + if (p->context_id != KFD_CONTEXT_ID_PRIMARY && (flags & KFD_IOC_ALLOC_MEM_FLAGS_USERPTR)) { 1066 + pr_debug("USERPTR is not supported on non-primary kfd_process\n"); 1067 + 1068 + return -EOPNOTSUPP; 1069 + } 1070 + 1065 1071 #if IS_ENABLED(CONFIG_HSA_AMD_SVM) 1066 1072 /* Flush pending deferred work to avoid racing with deferred actions 1067 1073 * from previous memory map changes (e.g. munmap).