From: Runyu Xiao <runyu.xiao@seu.edu.cn>
To: alexander.deucher@amd.com, christian.koenig@amd.com
Cc: airlied@gmail.com, simona@ffwll.ch, kenneth.feng@amd.com,
kevinyang.wang@amd.com, amd-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
jianhao.xu@seu.edu.cn, runyu.xiao@seu.edu.cn
Subject: [PATCH 0/2] drm/amdgpu: fix MES queue init wptr reset on atomic64 carriers
Date: Tue, 2 Jun 2026 13:03:52 +0800 [thread overview]
Message-ID: <20260602050354.2237095-1-runyu.xiao@seu.edu.cn> (raw)
This series fixes two MES queue-init reset paths that still clear
ring->wptr_cpu_addr with a plain 32-bit store even though the same
carrier is accessed with atomic64_set()/atomic64_read() and
support_64bit_ptrs is enabled.
This is not just a missing atomic annotation. The write pointer carrier
is used as a shared 64-bit value, so a plain *ring->wptr_cpu_addr = 0
only clears the low 32 bits. A later atomic64_read() can then observe
stale high 32 bits instead of a real zeroed reset state.
Use atomic64_set((atomic64_t *)ring->wptr_cpu_addr, 0) in both reset
paths so the full 64-bit MES wptr is cleared with the same access
family as the existing readers and writers.
This issue was first flagged by our static analysis tool while scanning
for 64-bit atomic write pointer carriers mixed with plain reset stores,
then manually audited on Linux v6.18.21.
It was further confirmed with a QEMU no-device stand-in that preserved
the same access contract: atomic64_set() write, plain low-32 reset, and
atomic64_read() readback. In that stand-in, a buggy reset turned
0x12345678abcdeff0 into 0x1234567800000000, while replacing the reset
with atomic64_set(..., 0) read back 0x0.
Build-tested by compiling mes_v11_0.o and mes_v12_0.o.
No AMDGPU hardware was available for end-to-end runtime testing.
Runyu Xiao (2):
drm/amdgpu/mes11: fix queue init wptr reset
drm/amdgpu/mes12: fix queue init wptr reset
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 2 +-
drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--
2.34.1
next reply other threads:[~2026-06-02 5:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-02 5:03 Runyu Xiao [this message]
2026-06-02 5:03 ` [PATCH 1/2] drm/amdgpu/mes11: fix queue init wptr reset Runyu Xiao
2026-06-02 9:49 ` Christian König
2026-06-02 10:53 ` 肖润宇
2026-06-02 11:19 ` Christian König
2026-06-02 12:03 ` Runyu Xiao
2026-06-03 9:00 ` Runyu Xiao
2026-06-04 3:17 ` Claude review: " Claude Code Review Bot
2026-06-02 5:03 ` [PATCH 2/2] drm/amdgpu/mes12: " Runyu Xiao
2026-06-04 3:17 ` Claude review: " Claude Code Review Bot
2026-06-04 3:17 ` Claude review: drm/amdgpu: fix MES queue init wptr reset on atomic64 carriers Claude Code Review Bot
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=20260602050354.2237095-1-runyu.xiao@seu.edu.cn \
--to=runyu.xiao@seu.edu.cn \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jianhao.xu@seu.edu.cn \
--cc=kenneth.feng@amd.com \
--cc=kevinyang.wang@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=simona@ffwll.ch \
/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