public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Eliot Courtney <ecourtney@nvidia.com>
To: Danilo Krummrich <dakr@kernel.org>,
	Alice Ryhl <aliceryhl@google.com>,
	Alexandre Courbot <acourbot@nvidia.com>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Miguel Ojeda <ojeda@kernel.org>, Boqun Feng <boqun@kernel.org>,
	Gary Guo <gary@garyguo.net>,
	Björn Roy Baron <bjorn3_gh@protonmail.com>,
	Benno Lossin <lossin@kernel.org>,
	Andreas Hindborg <a.hindborg@kernel.org>,
	Trevor Gross <tmgross@umich.edu>
Cc: Zhi Wang <zhiw@nvidia.com>, John Hubbard <jhubbard@nvidia.com>,
	Alistair Popple <apopple@nvidia.com>,
	Joel Fernandes <joelagnelf@nvidia.com>,
	Timur Tabi <ttabi@nvidia.com>,
	nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	Eliot Courtney <ecourtney@nvidia.com>
Subject: [PATCH v6 5/9] gpu: nova-core: gsp: clarify invariant on command queue
Date: Fri, 06 Mar 2026 16:22:02 +0900	[thread overview]
Message-ID: <20260306-cmdq-continuation-v6-5-cc7b629200ee@nvidia.com> (raw)
In-Reply-To: <20260306-cmdq-continuation-v6-0-cc7b629200ee@nvidia.com>

Clarify why using only the first returned slice from allocate_command
for the message headers is okay.

Tested-by: Zhi Wang <zhiw@nvidia.com>
Signed-off-by: Eliot Courtney <ecourtney@nvidia.com>
---
 drivers/gpu/nova-core/gsp/cmdq.rs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/nova-core/gsp/cmdq.rs b/drivers/gpu/nova-core/gsp/cmdq.rs
index 8b970523d789..806b1e02715e 100644
--- a/drivers/gpu/nova-core/gsp/cmdq.rs
+++ b/drivers/gpu/nova-core/gsp/cmdq.rs
@@ -534,7 +534,9 @@ pub(crate) fn send_command<M>(&mut self, bar: &Bar0, command: M) -> Result
             .gsp_mem
             .allocate_command(command_size, Self::ALLOCATE_TIMEOUT)?;
 
-        // Extract area for the command itself.
+        // Extract area for the command itself. The GSP message header and the command header
+        // together are guaranteed to fit entirely into a single page, so it's ok to only look
+        // at `dst.contents.0` here.
         let (cmd, payload_1) = M::Command::from_bytes_mut_prefix(dst.contents.0).ok_or(EIO)?;
 
         // Fill the header and command in-place.

-- 
2.53.0


  parent reply	other threads:[~2026-03-06  7:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-06  7:21 [PATCH v6 0/9] gpu: nova-core: gsp: add continuation record support Eliot Courtney
2026-03-06  7:21 ` [PATCH v6 1/9] gpu: nova-core: gsp: sort `MsgFunction` variants alphabetically Eliot Courtney
2026-03-08 23:11   ` Claude review: " Claude Code Review Bot
2026-03-06  7:21 ` [PATCH v6 2/9] gpu: nova-core: gsp: add mechanism to wait for space on command queue Eliot Courtney
2026-03-08 23:11   ` Claude review: " Claude Code Review Bot
2026-03-06  7:22 ` [PATCH v6 3/9] rust: add EMSGSIZE error code Eliot Courtney
2026-03-08 23:11   ` Claude review: " Claude Code Review Bot
2026-03-06  7:22 ` [PATCH v6 4/9] gpu: nova-core: gsp: add checking oversized commands Eliot Courtney
2026-03-08 23:11   ` Claude review: " Claude Code Review Bot
2026-03-06  7:22 ` Eliot Courtney [this message]
2026-03-08 23:11   ` Claude review: gpu: nova-core: gsp: clarify invariant on command queue Claude Code Review Bot
2026-03-06  7:22 ` [PATCH v6 6/9] gpu: nova-core: gsp: unconditionally call variable payload handling Eliot Courtney
2026-03-08 23:11   ` Claude review: " Claude Code Review Bot
2026-03-06  7:22 ` [PATCH v6 7/9] gpu: nova-core: gsp: add `size` helper to `CommandToGsp` Eliot Courtney
2026-03-08 23:11   ` Claude review: " Claude Code Review Bot
2026-03-06  7:22 ` [PATCH v6 8/9] gpu: nova-core: gsp: support large RPCs via continuation record Eliot Courtney
2026-03-08 23:11   ` Claude review: " Claude Code Review Bot
2026-03-06  7:22 ` [PATCH v6 9/9] gpu: nova-core: gsp: add tests for continuation records Eliot Courtney
2026-03-08 23:11   ` Claude review: " Claude Code Review Bot
2026-03-08 23:11 ` Claude review: gpu: nova-core: gsp: add continuation record support 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=20260306-cmdq-continuation-v6-5-cc7b629200ee@nvidia.com \
    --to=ecourtney@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=apopple@nvidia.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=jhubbard@nvidia.com \
    --cc=joelagnelf@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tmgross@umich.edu \
    --cc=ttabi@nvidia.com \
    --cc=zhiw@nvidia.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