Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Jesse.zhang@amd.com" <jesse.zhang@amd.com>
To: <igt-dev@lists.freedesktop.org>
Cc: Vitaly Prosyak <vitaly.prosyak@amd.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Christian Koenig <christian.koenig@amd.com>, <sukhatri@amd.com>,
	<prike.liang@amd.com>,
	"Jesse.zhang@amd.com" <Jesse.zhang@amd.com>
Subject: [PATCH i-g-t 3/3] lib/amdgpu: Add encrypted flag for secure user queues
Date: Wed, 9 Apr 2025 15:50:30 +0800	[thread overview]
Message-ID: <20250409075030.2501714-3-jesse.zhang@amd.com> (raw)
In-Reply-To: <20250409075030.2501714-1-jesse.zhang@amd.com>

From: "Jesse.zhang@amd.com" <Jesse.zhang@amd.com>

When creating secure user queues, set the
AMDGPU_GEM_CREATE_ENCRYPTED flag for the GTT allocation if the
queue context is marked as secure. This ensures proper memory
protection for secure command submissions through user queues.

Signed-off-by: Jesse.Zhang <Jesse.zhang@amd.com>
---
 lib/amdgpu/amd_user_queue.c |  2 ++
 tests/amdgpu/amd_security.c | 10 +++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/lib/amdgpu/amd_user_queue.c b/lib/amdgpu/amd_user_queue.c
index 361f5acc6..0cdd0c4f9 100644
--- a/lib/amdgpu/amd_user_queue.c
+++ b/lib/amdgpu/amd_user_queue.c
@@ -281,6 +281,8 @@ void amdgpu_user_queue_create(amdgpu_device_handle device_handle, struct amdgpu_
 		return;
 	}
 
+	if (ctxt->secure)
+		gtt_flags |= AMDGPU_GEM_CREATE_ENCRYPTED;
 	r = amdgpu_query_uq_fw_area_info(device_handle, AMD_IP_GFX, 0, &ctxt->info);
 	igt_assert_eq(r, 0);
 
diff --git a/tests/amdgpu/amd_security.c b/tests/amdgpu/amd_security.c
index 737e6201a..1c880c11f 100644
--- a/tests/amdgpu/amd_security.c
+++ b/tests/amdgpu/amd_security.c
@@ -355,15 +355,15 @@ igt_main
 			AMDGPU_HW_IP_DMA), is_secure);
 
 #ifdef AMDGPU_USERQ_ENABLED
-	igt_describe("amdgpu gfx command submission write linear helper");
+	igt_describe("amdgpu gfx command submission write linear helper with user queue");
 	igt_subtest("gfx-write-linear-helper-secure-umq")
-	 amdgpu_command_submission_write_linear_helper(device,
+	amdgpu_command_submission_write_linear_helper(device,
 			get_ip_block(device, AMDGPU_HW_IP_GFX), is_secure, true);
 
-	igt_describe("amdgpu compute command submission write linear helper");
+	igt_describe("amdgpu compute command submission write linear helper with user queue");
 	igt_subtest("compute-write-linear-helper-secure-umq")
-	 amdgpu_command_submission_write_linear_helper(device,
-			get_ip_block(device, AMDGPU_HW_IP_GFX), is_secure, true);
+	amdgpu_command_submission_write_linear_helper(device,
+			get_ip_block(device, AMDGPU_HW_IP_COMPUTE), is_secure, true);
 #endif
 
 	igt_fixture {
-- 
2.25.1


  parent reply	other threads:[~2025-04-09  7:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09  7:50 [PATCH i-g-t 1/3] lib/meson.build: Add AMDGPU_USERQ_ENABLED check for user queues Jesse.zhang@amd.com
2025-04-09  7:50 ` [PATCH i-g-t 2/3] tests/amdgpu: Add secure UMQ tests for GFX and compute Jesse.zhang@amd.com
2025-04-09  7:50 ` Jesse.zhang@amd.com [this message]
2025-04-09  7:55 ` [PATCH i-g-t 1/3] lib/meson.build: Add AMDGPU_USERQ_ENABLED check for user queues Zhang, Jesse(Jie)
2025-04-09  9:10 ` ✗ Fi.CI.BUILD: failure for series starting with [i-g-t,1/3] lib/meson.build: Add AMDGPU_USERQ_ENABLED check for user queues (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250409075030.2501714-3-jesse.zhang@amd.com \
    --to=jesse.zhang@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=prike.liang@amd.com \
    --cc=sukhatri@amd.com \
    --cc=vitaly.prosyak@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox