mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Eliot Courtney" <ecourtney@nvidia.com>
To: "Alexandre Courbot" <acourbot@nvidia.com>,
	"Eliot Courtney" <ecourtney@nvidia.com>
Cc: "Danilo Krummrich" <dakr@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	<nouveau@lists.freedesktop.org>,
	<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
	"dri-devel" <dri-devel-bounces@lists.freedesktop.org>
Subject: Re: [PATCH 3/7] gpu: nova-core: gsp: add checking oversized commands
Date: Wed, 18 Feb 2026 15:50:29 +0900	[thread overview]
Message-ID: <DGHVZCZ3D5DY.35YV1XN6UK2QQ@nvidia.com> (raw)
In-Reply-To: <DGHRKO26RWX3.12AQHBX801G0T@nvidia.com>

On Wed Feb 18, 2026 at 12:23 PM JST, Alexandre Courbot wrote:
>> +/// Maximum size of a single GSP command in bytes.
>> +///
>> +/// A single command can span up to 16 GSP pages.
>> +pub(crate) const MSGQ_MSG_SIZE_MAX: usize = GSP_PAGE_SIZE * 16;
>
> Where does this limitation come from? Is there a value in OpenRM that we
> can add to the bindings as the source of truth?

This is a GSP protocol level limitation. And yes, there's a constant
so I'll add that to the bindings. Thanks!

>
>> +
>>  /// Circular buffer of a [`Msgq`].
>>  ///
>>  /// This area of memory is to be shared between the driver and the GSP to exchange commands or
>> @@ -329,8 +334,11 @@ fn allocate_command(&mut self, size: usize) -> Result<GspCommand<'_>> {
>>      /// # Errors
>>      ///
>>      /// - `ETIMEDOUT` if space does not become available within the timeout.
>> -    /// - `EIO` if the command header is not properly aligned.
>> +    /// - `EIO` if the command header is not properly aligned or sizing is impossible.
>
> `sizing is impossible` should be its own error - probably `EMSGSIZE`
> (which would need to be added to `kernel/error.rs` in its own patch).
> Also the wording sounds a bit confusing to me, why not say "if the
> command is larger than `MSGQ_MSG_SIZE_MAX`"?

Do you mean in its own patch in this series, or sent as a separate patch
to a different tree (e.g. rfl)?

Tangential but I feel like some of the errors in this file are a bit
odd, like the existing EIO if the command doesn't fit (which it always
should). WDYT?

  reply	other threads:[~2026-02-18  6:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-12  6:28 [PATCH 0/7] gpu: nova-core: gsp: add continuation record support Eliot Courtney
2026-02-12  6:28 ` [PATCH 1/7] gpu: nova-core: gsp: sort MsgFunction variants alphabetically Eliot Courtney
2026-02-12  6:28 ` [PATCH 2/7] gpu: nova-core: gsp: add mechanism to wait for space on command queue Eliot Courtney
2026-02-18  3:13   ` Alexandre Courbot
2026-02-18  4:05     ` Eliot Courtney
2026-02-18  7:20       ` Alexandre Courbot
2026-02-12  6:28 ` [PATCH 3/7] gpu: nova-core: gsp: add checking oversized commands Eliot Courtney
2026-02-18  3:23   ` Alexandre Courbot
2026-02-18  6:50     ` Eliot Courtney [this message]
2026-02-18  7:25       ` Alexandre Courbot
2026-02-12  6:28 ` [PATCH 4/7] gpu: nova-core: gsp: clarify invariant on command queue Eliot Courtney
2026-02-12  6:28 ` [PATCH 5/7] gpu: nova-core: gsp: unconditionally call variable payload handling Eliot Courtney
2026-02-12  6:28 ` [PATCH 6/7] gpu: nova-core: gsp: support large RPCs via continuation record Eliot Courtney
2026-02-18  7:16   ` Alexandre Courbot
2026-02-18  9:00     ` Eliot Courtney
2026-02-18 11:49       ` Alexandre Courbot
2026-02-12  6:28 ` [PATCH 7/7] gpu: nova-core: gsp: add tests for WrappingCommand Eliot Courtney
2026-02-17 18:18 ` [PATCH 0/7] gpu: nova-core: gsp: add continuation record support John Hubbard

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=DGHVZCZ3D5DY.35YV1XN6UK2QQ@nvidia.com \
    --to=ecourtney@nvidia.com \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel-bounces@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nouveau@lists.freedesktop.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

all inboxes | Powered by JetHome®