From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2045.outbound.protection.outlook.com [40.107.94.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id ACD5A10E954 for ; Thu, 11 Jan 2024 19:25:59 +0000 (UTC) From: To: Subject: [PATCH 1/2] lib/amdgpu: add secure flag to sdma packet Date: Thu, 11 Jan 2024 14:25:52 -0500 Message-ID: <20240111192553.113902-1-vitaly.prosyak@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , Christian Koenig Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: From: Vitaly Prosyak 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 Cc: Alex Deucher Cc: Christian Koenig Cc: Kamil Konieczny Signed-off-by: Vitaly Prosyak Reviewed-by: Jesse Zhang --- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org From: Subject: [PATCH 1/2] lib/amdgpu: add secure flag to sdma packet Date: Thu, 11 Jan 2024 14:25:52 -0500 Message-ID: <20240111192553.113902-1-vitaly.prosyak@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: To: igt-dev@lists.freedesktop.org Cc: Alex Deucher , Christian Koenig Message-ID: <20240111192552.z7abfb5hywTguxn3jTNXOZQmWUYhxRTcK2O1ENOWlJQ@z> From: Vitaly Prosyak 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 Cc: Alex Deucher Cc: Christian Koenig Cc: Kamil Konieczny Signed-off-by: Vitaly Prosyak Reviewed-by: Jesse Zhang --- 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