All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/amdgpu/gfx13: remove frame cntl
@ 2026-12-02 16:01 Alex Deucher
  2026-12-02 16:01 ` [PATCH 2/3] drm/amdgpu/gfx11: no need to emit frame cntl on rs64 Alex Deucher
  2026-12-02 16:01 ` [PATCH 3/3] drm/amdgpu/gfx12: drop secure_submission_supported Alex Deucher
  0 siblings, 2 replies; 4+ messages in thread
From: Alex Deucher @ 2026-12-02 16:01 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

Remove emit_frame_cntl function for gfx v13.  TMZ is
only supported via secure queues, not via frames.

v2: drop secure supported flag as well

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c
index c06fa6b9b2991..2d231a24c5c54 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c
@@ -268,7 +268,6 @@ static void gfx_v13_0_select_se_sh(struct amdgpu_device *adev, u32 se_num,
 				   u32 sh_num, u32 instance, int xcc_id);
 static u32 gfx_v13_0_get_wgp_active_bitmap_per_sh(struct amdgpu_device *adev);
 
-static void gfx_v13_0_ring_emit_frame_cntl(struct amdgpu_ring *ring, bool start, bool secure);
 static void gfx_v13_0_ring_emit_wreg(struct amdgpu_ring *ring, uint32_t reg,
 				     uint32_t val);
 static int gfx_v13_0_wait_for_rlc_autoload_complete(struct amdgpu_device *adev);
@@ -4650,16 +4649,6 @@ static int gfx_v13_0_ring_preempt_ib(struct amdgpu_ring *ring)
 	return r;
 }
 
-static void gfx_v13_0_ring_emit_frame_cntl(struct amdgpu_ring *ring,
-					   bool start,
-					   bool secure)
-{
-	uint32_t v = secure ? FRAME_TMZ : 0;
-
-	amdgpu_ring_write(ring, PACKET3(PACKET3_FRAME_CONTROL, 0));
-	amdgpu_ring_write(ring, v | FRAME_CMD(start ? 0 : 1));
-}
-
 static void gfx_v13_0_ring_emit_rreg(struct amdgpu_ring *ring, uint32_t reg,
 				     uint32_t reg_val_offs)
 {
@@ -5504,7 +5493,6 @@ static const struct amdgpu_ring_funcs gfx_v13_0_ring_funcs_gfx = {
 	.align_mask = 0xff,
 	.nop = PACKET3(PACKET3_NOP, 0x3FFF),
 	.support_64bit_ptrs = true,
-	.secure_submission_supported = true,
 	.get_rptr = gfx_v13_0_ring_get_rptr_gfx,
 	.get_wptr = gfx_v13_0_ring_get_wptr_gfx,
 	.set_wptr = gfx_v13_0_ring_set_wptr_gfx,
@@ -5538,7 +5526,6 @@ static const struct amdgpu_ring_funcs gfx_v13_0_ring_funcs_gfx = {
 	.emit_cntxcntl = gfx_v13_0_ring_emit_cntxcntl,
 	.init_cond_exec = gfx_v13_0_ring_emit_init_cond_exec,
 	.preempt_ib = gfx_v13_0_ring_preempt_ib,
-	.emit_frame_cntl = gfx_v13_0_ring_emit_frame_cntl,
 	.emit_wreg = gfx_v13_0_ring_emit_wreg,
 	.emit_reg_wait = gfx_v13_0_ring_emit_reg_wait,
 	.emit_reg_write_reg_wait = gfx_v13_0_ring_emit_reg_write_reg_wait,
-- 
2.56.1


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

* [PATCH 2/3] drm/amdgpu/gfx11: no need to emit frame cntl on rs64
  2026-12-02 16:01 [PATCH 1/3] drm/amdgpu/gfx13: remove frame cntl Alex Deucher
@ 2026-12-02 16:01 ` Alex Deucher
  2026-12-02 16:22   ` sashiko-bot
  2026-12-02 16:01 ` [PATCH 3/3] drm/amdgpu/gfx12: drop secure_submission_supported Alex Deucher
  1 sibling, 1 reply; 4+ messages in thread
From: Alex Deucher @ 2026-12-02 16:01 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

TMZ is only supported via secure queues on RS64, not via frames
so no need to emit frame control when RS64 is enabled.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
index ab55789b51059..cc605ce2874a2 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
@@ -6299,6 +6299,9 @@ static void gfx_v11_0_ring_emit_frame_cntl(struct amdgpu_ring *ring, bool start,
 {
 	uint32_t v = secure ? FRAME_TMZ : 0;
 
+	if (ring->adev->gfx.rs64_enable)
+		return;
+
 	amdgpu_ring_write(ring, PACKET3(PACKET3_FRAME_CONTROL, 0));
 	amdgpu_ring_write(ring, v | FRAME_CMD(start ? 0 : 1));
 }
-- 
2.56.1


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

* [PATCH 3/3] drm/amdgpu/gfx12: drop secure_submission_supported
  2026-12-02 16:01 [PATCH 1/3] drm/amdgpu/gfx13: remove frame cntl Alex Deucher
  2026-12-02 16:01 ` [PATCH 2/3] drm/amdgpu/gfx11: no need to emit frame cntl on rs64 Alex Deucher
@ 2026-12-02 16:01 ` Alex Deucher
  1 sibling, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2026-12-02 16:01 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

gfx12 doesn't support TMZ on a per frame basis, only
on dedicated secure queues.  Drop the flag.  TMZ is
not enabled on gfx12 anyway.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
index c2e9324f0b756..ad50eb5204e84 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
@@ -5363,7 +5363,6 @@ static const struct amdgpu_ring_funcs gfx_v12_0_ring_funcs_gfx = {
 	.align_mask = 0xff,
 	.nop = PACKET3(PACKET3_NOP, 0x3FFF),
 	.support_64bit_ptrs = true,
-	.secure_submission_supported = true,
 	.get_rptr = gfx_v12_0_ring_get_rptr_gfx,
 	.get_wptr = gfx_v12_0_ring_get_wptr_gfx,
 	.set_wptr = gfx_v12_0_ring_set_wptr_gfx,
-- 
2.56.1


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

* Re: [PATCH 2/3] drm/amdgpu/gfx11: no need to emit frame cntl on rs64
  2026-12-02 16:01 ` [PATCH 2/3] drm/amdgpu/gfx11: no need to emit frame cntl on rs64 Alex Deucher
@ 2026-12-02 16:22   ` sashiko-bot
  0 siblings, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-12-02 16:22 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/amdgpu/gfx11: silent non-secure IBs via
  gfx_v11_0_ring_emit_frame_cntl()
--

commit ee944d0f3fffd1edd62ed6604c3a281717f44cdb
Author: Alex Deucher <alexander.deucher@amd.com>

drm/amdgpu/gfx11: no need to emit frame cntl on rs64

This commit skips emitting PACKET3_FRAME_CONTROL packets in
gfx_v11_0_ring_emit_frame_cntl() when RS64 CP firmware is enabled.

> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> index 570f0f3a2ea5e..32dd329456d45 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> @@ -6264,6 +6264,9 @@ static void gfx_v11_0_ring_emit_frame_cntl(struct amdgpu_ring *ring, bool start,
>  {
>  	uint32_t v = secure ? FRAME_TMZ : 0;
>  
> +	if (ring->adev->gfx.rs64_enable)
> +		return;
> +
>  	amdgpu_ring_write(ring, PACKET3(PACKET3_FRAME_CONTROL, 0));
>  	amdgpu_ring_write(ring, v | FRAME_CMD(start ? 0 : 1));
>  }

[Severity: Medium]
Does returning early here allow AMDGPU_IB_FLAGS_SECURE submissions to
execute silently in non-secure mode on the kernel GFX ring when
rs64_enable is true?

gfx_v11_0_ring_funcs_gfx still sets .secure_submission_supported = true,
so amdgpu_ib_schedule() accepts AMDGPU_IB_FLAGS_SECURE IBs instead of
rejecting them with -EINVAL.  Because the kernel GFX queue is initialized
with prop->tmz_queue = false and this function now skips emitting
FRAME_TMZ, those IBs run without TMZ protection.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261202160158.1103416-1-alexander.deucher@amd.com?part=2

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

end of thread, other threads:[~2026-12-02 16:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 16:01 [PATCH 1/3] drm/amdgpu/gfx13: remove frame cntl Alex Deucher
2026-12-02 16:01 ` [PATCH 2/3] drm/amdgpu/gfx11: no need to emit frame cntl on rs64 Alex Deucher
2026-12-02 16:22   ` sashiko-bot
2026-12-02 16:01 ` [PATCH 3/3] drm/amdgpu/gfx12: drop secure_submission_supported Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.