NVIDIA GPU driver infrastructure
 help / color / mirror / Atom feed
From: John Hubbard <jhubbard@nvidia.com>
To: Timur Tabi <ttabi@nvidia.com>, Alexandre Courbot <acourbot@nvidia.com>
Cc: Zhi Wang <zhiw@nvidia.com>, "gary@garyguo.net" <gary@garyguo.net>,
	"rust-for-linux@vger.kernel.org" <rust-for-linux@vger.kernel.org>,
	"nova-gpu@lists.linux.dev" <nova-gpu@lists.linux.dev>,
	Eliot Courtney <ecourtney@nvidia.com>,
	"russ.weight@linux.dev" <russ.weight@linux.dev>,
	"mcgrof@kernel.org" <mcgrof@kernel.org>,
	"dakr@kernel.org" <dakr@kernel.org>,
	"ojeda@kernel.org" <ojeda@kernel.org>,
	"driver-core@lists.linux.dev" <driver-core@lists.linux.dev>
Subject: Re: [PATCH v5 3/8] gpu: nova-core: add TLV parser for firmware files
Date: Wed, 29 Jul 2026 13:09:07 -0700	[thread overview]
Message-ID: <45a43838-0468-4690-b692-38500f4046e6@nvidia.com> (raw)
In-Reply-To: <ba791aaea02d5caf9254278e170b9deae5305e6b.camel@nvidia.com>

On 7/29/26 9:37 AM, Timur Tabi wrote:
> On Mon, 2026-07-27 at 20:31 +0900, Alexandre Courbot wrote:
...
>>> +``NSIG`` (u32) - ``num_sigs``
>>> +    Number of signatures included in the ``SIGN`` tag.  A value of 0 indicates
>>> +    unsigned firmware and that there is no ``SIGN`` tag.
>>
>> In patch 4 `booter.rs` says "Booter is always signed", which contradicts
>> this definition. We had a non-signed path in the original code; why not
>> preserve it? The current firmware files do not make use of it, but the
>> point of specifying things here is to make the code future-proof in case
>> we introduce or enable unsigned firmwares in the future; so let's make
>> the code religiously follow the spec.
> 
> Well, booter (both load and unload) always is signed.  The script even enforces that.  The
> current unsigned code in booter.rs has never been exercised, so we can't really say it's
> correct.
> 
> I can change the documentation here to not mention NSIG==0 as a possibility.  When I wrote this
> text, I hadn't noticed that NSIG is never 0.

Yes, that is what I'd recommend here, too.

> 
> We are never going to introduce unsigned booter firmware.  For one thing, Hopper and later have
> already replaced booter with fmc, so this code is already legacy.

++1, this is not ever going to change.

> 
> If it turns out that some future version of GSP-RM does add an unsigned booter, we would need to
> change the script and probably do more than just call no_patch_signature().

Very true. And IMHO it is wildly unlikely that we would end up with any
sort of unsigned booter thing. So it's best to just remove all mention of it.

...
>>> +        // To make sure the value actually is a string, ensure it's all ASCII.
>>> +        if !bytes.is_ascii() {
>>> +            return Err(EINVAL);
>>> +        }
>>
>> The spec also says that NULL characters are invalid; we should test for
>> `|| bytes.contains(&0)` as well here.
> 
> Hmmm... I wonder if I should expand the definition to exclude all characters less than ASCII 32?
> 
> I was debating is_ascii_graphic() but that also excludes blank spaces.  There is value in
> insisting that the tag is clearly printable.
> 
> Thoughts?

Agree that there is value in enforcing printable tags. We could
something like this if we want to allow spaces:

   bytes.iter().all(|b| b.is_ascii_graphic() || *b == b' ')

...but is there really-truly a need to support spaces? (I haven't checked
on that, but it surprises me at first.)


thanks,
-- 
John Hubbard


  reply	other threads:[~2026-07-29 20:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-10 23:04 [PATCH v5 0/8] Transition Nova Core to TLV firmare images Timur Tabi
2026-07-10 23:04 ` [PATCH v5 1/8] rust: alloc: add Vec::zeroed method Timur Tabi
2026-07-11 13:25   ` Miguel Ojeda
2026-07-13  2:21     ` Timur Tabi
2026-07-27  8:06   ` Alexandre Courbot
2026-07-10 23:04 ` [PATCH v5 2/8] rust: firmware: add request_into_buf() Timur Tabi
2026-07-27  8:06   ` Alexandre Courbot
2026-07-27 10:38   ` Alexandre Courbot
2026-07-10 23:04 ` [PATCH v5 3/8] gpu: nova-core: add TLV parser for firmware files Timur Tabi
2026-07-27 11:31   ` Alexandre Courbot
2026-07-29 16:37     ` Timur Tabi
2026-07-29 20:09       ` John Hubbard [this message]
2026-07-29 23:02         ` Timur Tabi
2026-07-10 23:04 ` [PATCH v5 4/8] gpu: nova-core: transition booter_load to TLV images Timur Tabi
2026-07-10 23:04 ` [PATCH v5 5/8] gpu: nova-core: transition gsp " Timur Tabi
2026-07-27 11:29   ` Alexandre Courbot
2026-07-10 23:04 ` [PATCH v5 6/8] gpu: nova-core: transition gen_bootloader " Timur Tabi
2026-07-10 23:04 ` [PATCH v5 7/8] gpu: nova-core: transition fsp " Timur Tabi
2026-07-10 23:04 ` [PATCH v5 8/8] gpu: nova-core: update firmware module info for " Timur Tabi
2026-07-27  8:06   ` Alexandre Courbot
2026-07-28 21:54     ` Timur Tabi

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=45a43838-0468-4690-b692-38500f4046e6@nvidia.com \
    --to=jhubbard@nvidia.com \
    --cc=acourbot@nvidia.com \
    --cc=dakr@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=ecourtney@nvidia.com \
    --cc=gary@garyguo.net \
    --cc=mcgrof@kernel.org \
    --cc=nova-gpu@lists.linux.dev \
    --cc=ojeda@kernel.org \
    --cc=russ.weight@linux.dev \
    --cc=rust-for-linux@vger.kernel.org \
    --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