[PATCH 13/13] drm/amdgpu/userq: enable support for secure queues
Khatri, Sunil
sukhatri at amd.com
Fri Apr 11 17:19:44 UTC 2025
Reviewed-by: Sunil Khatri <sunil.khatri at amd.com>
On 4/11/2025 12:24 AM, Alex Deucher wrote:
> Enable users to create secure GFX/compute queues.
>
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c
> index b8b13b6ab4631..cd279f8164158 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c
> @@ -303,6 +303,14 @@ amdgpu_userqueue_create(struct drm_file *filp, union drm_amdgpu_userq *args)
> if (r)
> return r;
>
> + if ((args->in.flags & AMDGPU_USERQ_CREATE_FLAGS_QUEUE_SECURE) &&
> + (args->in.ip_type != AMDGPU_HW_IP_GFX) &&
> + (args->in.ip_type != AMDGPU_HW_IP_COMPUTE) &&
> + !amdgpu_is_tmz(adev)) {
> + drm_err(adev_to_drm(adev), "Secure only supported on GFX/Compute queues\n");
> + return -EINVAL;
> + }
> +
> /*
> * There could be a situation that we are creating a new queue while
> * the other queues under this UQ_mgr are suspended. So if there is any
> @@ -401,7 +409,8 @@ int amdgpu_userq_ioctl(struct drm_device *dev, void *data,
>
> switch (args->in.op) {
> case AMDGPU_USERQ_OP_CREATE:
> - if (args->in.flags & ~AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_MASK)
> + if (args->in.flags & ~(AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_MASK |
> + AMDGPU_USERQ_CREATE_FLAGS_QUEUE_SECURE))
> return -EINVAL;
> r = amdgpu_userqueue_create(filp, args);
> if (r)
More information about the amd-gfx
mailing list