[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e2405c51-bdf5-4f18-97ce-8b42eacf1cc4@nvidia.com>
Date: Thu, 28 Aug 2025 17:26:14 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Alexandre Courbot <acourbot@...dia.com>, Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>, Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>, Björn Roy Baron
<bjorn3_gh@...tonmail.com>, Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>, Danilo Krummrich <dakr@...nel.org>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>
Cc: Alistair Popple <apopple@...dia.com>,
Joel Fernandes <joelagnelf@...dia.com>, Timur Tabi <ttabi@...dia.com>,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
nouveau@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH v2 3/8] gpu: nova-core: firmware: process Booter and patch
its signature
On 8/28/25 12:19 AM, Alexandre Courbot wrote:
> On Wed Aug 27, 2025 at 11:29 AM JST, John Hubbard wrote:
>> On 8/25/25 9:07 PM, Alexandre Courbot wrote:
>> ...
>>> + let ucode_signed = {
>>
>> This ucode_signed variable is misnamed...
>>
>>> + let mut signatures = hs_fw.signatures_iter()?.peekable();
>>> +
>>> + if signatures.peek().is_none() {
>>> + // If there are no signatures, then the firmware is unsigned.
>>> + ucode.no_patch_signature()
>>
>> ...as we can see here. :)
>
> Technically it is of type `FirmwareDmaObject<Signed>` even if we take to
> last branch. The name is to confirm that we have taken care of the
> signature step (even if it is unneeded). Not sure what would be a better
> name for this.
So the <Signed> parameter naming is also awkward, because it refers
to non-signed firmware too, I see. So we need to rename both.
Ideas:
a) ucode_maybe_signed, FirmwareDmaObject<MaybeSigned>
b) ucode_validated, FirmwareDmaObject<Validated>
...
>> Could we do something a little more obvious instead? Sort of like this:
>>
>> impl BooterFirmware {
>> pub(crate) fn dma_object(&self) -> &DmaObject {
>> &self.ucode.0
>> }
>> }
>
> `Deref<Target = DmaObject>` is a requirement of `FalconFirmware`. That
> being said, we could turn that into a `dma_object` method of
> `FalconFirmware`, which might be a bit clearer about the intent...
That does seem clearer to me.
thanks,
--
John Hubbard
Powered by blists - more mailing lists