[PATCH 1/2] lib/amdgpu: add secure flag to sdma packet

vitaly.prosyak at amd.com vitaly.prosyak at amd.com
Thu Jan 11 19:25:52 UTC 2024


From: Vitaly Prosyak <vitaly.prosyak at amd.com>

The change is required to handle the security flag for
trusted memory zone copy operation(TMZ feature).
Previously the security test was its own hardcoded version,
now we are allowed to use ASIC -the dependent version function
to create the SDMA packet.

v2 : added description to commit message (Kamil)

Cc: Jesse Zhang <jesse.zhang at amd.com>
Cc: Alex Deucher <alexander.deucher at amd.com>
Cc: Christian Koenig <christian.koenig at amd.com>
Cc: Kamil Konieczny <kamil.konieczny at linux.intel.com>

Signed-off-by: Vitaly Prosyak <vitaly.prosyak at amd.com>
Reviewed-by: Jesse Zhang <jesse.zhang at amd.com>
---
 lib/amdgpu/amd_ip_blocks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/amdgpu/amd_ip_blocks.c b/lib/amdgpu/amd_ip_blocks.c
index 1adea6987..a7ccfa38b 100644
--- a/lib/amdgpu/amd_ip_blocks.c
+++ b/lib/amdgpu/amd_ip_blocks.c
@@ -139,7 +139,7 @@ sdma_ring_copy_linear(const struct amdgpu_ip_funcs *func,
 	} else {
 		context->pm4[i++] = SDMA_PACKET(SDMA_OPCODE_COPY,
 				       SDMA_COPY_SUB_OPCODE_LINEAR,
-				       0);
+					context->secure ? 0x4 : 0);
 		if (func->family_id >= AMDGPU_FAMILY_AI)
 			context->pm4[i++] = context->write_length - 1;
 		else
-- 
2.25.1



More information about the igt-dev mailing list