Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/3] lib/meson.build: Add AMDGPU_USERQ_ENABLED check for user queues
@ 2025-04-09  7:50 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
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jesse.zhang@amd.com @ 2025-04-09  7:50 UTC (permalink / raw)
  To: igt-dev
  Cc: Vitaly Prosyak, Alex Deucher, Christian Koenig, sukhatri,
	prike.liang, Jesse.zhang@amd.com

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

Detect whether libdrm provides amdgpu_create_userqueue() and define
AMDGPU_USERQ_ENABLED if available. This enables user queue support
when building against newer libdrm while maintaining compatibility
with older versions that lack this function.

Signed-off-by: Jesse.Zhang <Jesse.zhang@amd.com>
---
 lib/meson.build | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/meson.build b/lib/meson.build
index d7bb72c57..8517cd540 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -172,6 +172,11 @@ if libdrm_amdgpu.found()
 		lib_sources +=[ 'amdgpu/amd_dispatch.c',]
 	else
 		warning('libdrm <= 2.4.99 found, amdgpu_cs_query_reset_state2 not applicable')
+	endif
+
+	if cc.has_function('amdgpu_create_userqueue', dependencies: libdrm_amdgpu)
+		add_project_arguments('-DAMDGPU_USERQ_ENABLED=1', language: 'c')
+		#conf.set('AMDGPU_USERQ_ENABLED', 1)
 	endif	
 endif
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH i-g-t 2/3] tests/amdgpu: Add secure UMQ tests for GFX and compute
  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 ` Jesse.zhang@amd.com
  2025-04-09  7:50 ` [PATCH i-g-t 3/3] lib/amdgpu: Add encrypted flag for secure user queues Jesse.zhang@amd.com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jesse.zhang@amd.com @ 2025-04-09  7:50 UTC (permalink / raw)
  To: igt-dev
  Cc: Vitaly Prosyak, Alex Deucher, Christian Koenig, sukhatri,
	prike.liang, Jesse.zhang@amd.com

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

Add new subtests for secure user-mode queue (UMQ) validation:
- gfx-write-linear-helper-secure-umq
- compute-write-linear-helper-secure-umq

Signed-off-by: Jesse.Zhang <Jesse.zhang@amd.com>
---
 tests/amdgpu/amd_security.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tests/amdgpu/amd_security.c b/tests/amdgpu/amd_security.c
index 19baaaea0..737e6201a 100644
--- a/tests/amdgpu/amd_security.c
+++ b/tests/amdgpu/amd_security.c
@@ -354,6 +354,18 @@ igt_main
 	amdgpu_secure_bounce(device, fd, &sdma_info, get_ip_block(device,
 			AMDGPU_HW_IP_DMA), is_secure);
 
+#ifdef AMDGPU_USERQ_ENABLED
+	igt_describe("amdgpu gfx command submission write linear helper");
+	igt_subtest("gfx-write-linear-helper-secure-umq")
+	 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_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);
+#endif
+
 	igt_fixture {
 		amdgpu_device_deinitialize(device);
 		drm_close_driver(fd);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH i-g-t 3/3] lib/amdgpu: Add encrypted flag for secure user queues
  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
  2025-04-09  7:55 ` [PATCH i-g-t 1/3] lib/meson.build: Add AMDGPU_USERQ_ENABLED check for " 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
  3 siblings, 0 replies; 5+ messages in thread
From: Jesse.zhang@amd.com @ 2025-04-09  7:50 UTC (permalink / raw)
  To: igt-dev
  Cc: Vitaly Prosyak, Alex Deucher, Christian Koenig, sukhatri,
	prike.liang, 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH i-g-t 1/3] lib/meson.build: Add AMDGPU_USERQ_ENABLED check for user queues
  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 ` [PATCH i-g-t 3/3] lib/amdgpu: Add encrypted flag for secure user queues Jesse.zhang@amd.com
@ 2025-04-09  7:55 ` 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
  3 siblings, 0 replies; 5+ messages in thread
From: Zhang, Jesse(Jie) @ 2025-04-09  7:55 UTC (permalink / raw)
  To: Zhang, Jesse(Jie), igt-dev@lists.freedesktop.org
  Cc: Prosyak, Vitaly, Deucher, Alexander, Koenig, Christian,
	Khatri, Sunil, Liang, Prike

[AMD Official Use Only - AMD Internal Distribution Only]

Please ignore these series,   will update new versions.

-----Original Message-----
From: Jesse.zhang@amd.com <jesse.zhang@amd.com>
Sent: Wednesday, April 9, 2025 3:50 PM
To: igt-dev@lists.freedesktop.org
Cc: Prosyak, Vitaly <Vitaly.Prosyak@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>; Khatri, Sunil <Sunil.Khatri@amd.com>; Liang, Prike <Prike.Liang@amd.com>; Zhang, Jesse(Jie) <Jesse.Zhang@amd.com>
Subject: [PATCH i-g-t 1/3] lib/meson.build: Add AMDGPU_USERQ_ENABLED check for user queues

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

Detect whether libdrm provides amdgpu_create_userqueue() and define AMDGPU_USERQ_ENABLED if available. This enables user queue support when building against newer libdrm while maintaining compatibility with older versions that lack this function.

Signed-off-by: Jesse.Zhang <Jesse.zhang@amd.com>
---
 lib/meson.build | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/meson.build b/lib/meson.build index d7bb72c57..8517cd540 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -172,6 +172,11 @@ if libdrm_amdgpu.found()
                lib_sources +=[ 'amdgpu/amd_dispatch.c',]
        else
                warning('libdrm <= 2.4.99 found, amdgpu_cs_query_reset_state2 not applicable')
+       endif
+
+       if cc.has_function('amdgpu_create_userqueue', dependencies: libdrm_amdgpu)
+               add_project_arguments('-DAMDGPU_USERQ_ENABLED=1', language: 'c')
+               #conf.set('AMDGPU_USERQ_ENABLED', 1)
        endif
 endif

--
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* ✗ 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)
  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
                   ` (2 preceding siblings ...)
  2025-04-09  7:55 ` [PATCH i-g-t 1/3] lib/meson.build: Add AMDGPU_USERQ_ENABLED check for " Zhang, Jesse(Jie)
@ 2025-04-09  9:10 ` Patchwork
  3 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2025-04-09  9:10 UTC (permalink / raw)
  To: Jesse.zhang@amd.com; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/3] lib/meson.build: Add AMDGPU_USERQ_ENABLED check for user queues (rev2)
URL   : https://patchwork.freedesktop.org/series/147449/
State : failure

== Summary ==

Applying: lib/meson.build: Add AMDGPU_USERQ_ENABLED check for user queues
Patch failed at 0001 lib/meson.build: Add AMDGPU_USERQ_ENABLED check for user queues
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-09  9:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH i-g-t 3/3] lib/amdgpu: Add encrypted flag for secure user queues Jesse.zhang@amd.com
2025-04-09  7:55 ` [PATCH i-g-t 1/3] lib/meson.build: Add AMDGPU_USERQ_ENABLED check for " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox