svm ioctl should only be processed on the primary
kfd process because only the lifecycle of the
primary kfd process is tied to the user space
applicaiton.
Another reason is in virtualization the hypervisor owns
the primary kfd process as a privileged one.
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>
struct kfd_ioctl_svm_args *args = data;
int r = 0;
+ if (p->context_id != KFD_CONTEXT_ID_PRIMARY) {
+ pr_debug("SVM ioctl not supported on non-primary kfd process\n");
+
+ return -EOPNOTSUPP;
+ }
+
pr_debug("start 0x%llx size 0x%llx op 0x%x nattr 0x%x\n",
args->start_addr, args->size, args->op, args->nattr);