[PATCH] drm/amdgpu: check ring type for secure IBs

Andrey Grodzovsky Andrey.Grodzovsky at amd.com
Thu Apr 23 23:00:24 UTC 2020


Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky at amd.com>

Andrey

On 4/23/20 4:47 PM, Alex Deucher wrote:
> We don't support secure operation on compute rings at the
> moment so reject them.
>
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> index ec2c5e164cd3..b91853fd66d3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> @@ -161,6 +161,12 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
>   		return -EINVAL;
>   	}
>   
> +	if ((ib->flags & AMDGPU_IB_FLAGS_SECURE) &&
> +	    (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE)) {
> +		dev_err(adev->dev, "secure submissions not supported on compute rings\n");
> +		return -EINVAL;
> +	}
> +
>   	alloc_size = ring->funcs->emit_frame_size + num_ibs *
>   		ring->funcs->emit_ib_size;
>   


More information about the amd-gfx mailing list