summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2020-04-23 16:45:10 -0400
committerAlex Deucher <alexander.deucher@amd.com>2020-04-28 16:20:30 -0400
commitb33f9d70b36889abafec3b638925640ac7c7fe12 (patch)
treeadcae3c2502d3945f7b862785ea4055e7b597bd5
parentb717fa5cb1a1aae9ea744a3b61e9d9aa1d258c9c (diff)
downloadlinux-stable-b33f9d70b36889abafec3b638925640ac7c7fe12.tar.gz
linux-stable-b33f9d70b36889abafec3b638925640ac7c7fe12.tar.bz2
linux-stable-b33f9d70b36889abafec3b638925640ac7c7fe12.zip
drm/amdgpu: check ring type for secure IBs
We don't support secure operation on compute rings at the moment so reject them. Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com> Reviewed-by: Aaron Liu <aaron.liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
index 24ae9f6c4255..aebbbb573884 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
@@ -162,6 +162,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;