]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu: check ring type for secure IBs
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 23 Apr 2020 20:45:10 +0000 (16:45 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 28 Apr 2020 20:20:30 +0000 (16:20 -0400)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c

index 24ae9f6c4255c66a920cb77de14cde1f00921e28..aebbbb573884c315398e7231ceef8f86f9ba3a18 100644 (file)
@@ -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;