All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Hubbard <jhubbard@nvidia.com>
To: Alexandre Courbot <acourbot@nvidia.com>
Cc: "Danilo Krummrich" <dakr@kernel.org>,
	"Joel Fernandes" <joelagnelf@nvidia.com>,
	"Timur Tabi" <ttabi@nvidia.com>,
	"Alistair Popple" <apopple@nvidia.com>,
	"Eliot Courtney" <ecourtney@nvidia.com>,
	"Shashank Sharma" <shashanks@nvidia.com>,
	"Zhi Wang" <zhiw@nvidia.com>, "David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	rust-for-linux@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v9 24/31] gpu: nova-core: Hopper/Blackwell: add FSP Chain of Trust boot
Date: Mon, 30 Mar 2026 15:54:20 -0700	[thread overview]
Message-ID: <07c99095-cf03-4f0d-acf5-6324a6466f43@nvidia.com> (raw)
In-Reply-To: <DHG7OGJPGEMC.295BL05EFV4GN@nvidia.com>

On 3/30/26 8:11 AM, Alexandre Courbot wrote:
> On Thu Mar 26, 2026 at 10:38 AM JST, John Hubbard wrote:
>> Add boot_fmc() which builds and sends the Chain of Trust message to FSP,
>> and FmcBootArgs which bundles the DMA-coherent boot parameters that FSP
>> reads at boot time. The FspFirmware struct fields become pub(crate) and
>> fmc_full changes from DmaObject to KVec<u8> for CPU-side signature
>> extraction.
>>
>> Co-developed-by: Alexandre Courbot <acourbot@nvidia.com>
>> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
>> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
>> ---
>>  drivers/gpu/nova-core/firmware/fsp.rs |   8 +-
>>  drivers/gpu/nova-core/fsp.rs          | 170 +++++++++++++++++++++++++-
>>  drivers/gpu/nova-core/gpu.rs          |   1 -
>>  drivers/gpu/nova-core/mctp.rs         |   7 --
>>  4 files changed, 172 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/gpu/nova-core/firmware/fsp.rs b/drivers/gpu/nova-core/firmware/fsp.rs
>> index 028f651553e0..5bd15b644825 100644
>> --- a/drivers/gpu/nova-core/firmware/fsp.rs
>> +++ b/drivers/gpu/nova-core/firmware/fsp.rs
>> @@ -14,16 +14,16 @@
>>      gpu::Chipset, //
>>  };
>>  
>> -#[expect(unused)]
>> +#[expect(dead_code)]
> 
> Why?

`dead_code` is the specific lint that fires here. `unused` is a lint
group that *contains* `dead_code` plus a dozen others (unused_imports,
unused_variables, unused_mut, etc). Since the only warning is "this
struct is never constructed," `dead_code` names the exact lint.

That said, you're right that this change doesn't belong in this patch.
I've moved it to the introducing commit in v10.

> 
>>  pub(crate) struct FspFirmware {
>>      /// FMC firmware image data (only the "image" ELF section).
>> -    fmc_image: DmaObject,
>> -    /// Full FMC ELF (for signature extraction.
>> +    pub(crate) fmc_image: DmaObject,
>> +    /// Full FMC ELF for signature extraction.
>>      pub(crate) fmc_elf: Firmware,
> 
> Let's make the comment for `fmc_elf` correct since its introduction
> instead of fixing it here?

Agreed, done in v10. The introducing commit now has the correct
comment from the start.

> 
>>  }
>>  
>>  impl FspFirmware {
>> -    #[expect(unused)]
>> +    #[expect(dead_code)]
> 
> Same here, I don't see the point. If it's not unused anymore, let's
> remove the `expect` entirely. If it is, let's keep the more accurate
> `unused`.

One small correction: `unused` is actually the *less* specific choice.
It is a lint group containing dead_code, unused_imports,
unused_variables, and about a dozen others. `dead_code` is the single
lint that actually fires on an unreferenced struct or function.
#[expect(...)] is meant to name the expected warning, so using the
specific lint is more precise.

But you're right that this change belonged in the introducing commit,
not here. Fixed in v10: the introducing commit uses
#[expect(dead_code)] from the start, and this patch only changes
fmc_image to pub(crate).

> 
> Btw, this is the kind of stuff you'd normally catch by looking at the
> diff before sending it. I shouldn't have to do this.

I actually spend lots of time fooling around with dead_code and
unused, trying to get it just right. There are a lot of patches that
add and remove these.

In this case, after the dust settled after applying the v8 review
feedback, I did notice this unused-->dead_code diff that we
are discussing, but I just let it go, because it's only a couple
of lines that end up getting vaporized by the end of the series
anyway, and I was anxious to get all the other things (especially
Gary/Sashiko's big discovery about the two Blackwell arches)
posted.


thanks,
-- 
John Hubbard


  reply	other threads:[~2026-03-30 22:54 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-26  1:38 [PATCH v9 00/31] gpu: nova-core: firmware: Hopper/Blackwell support John Hubbard
2026-03-26  1:38 ` [PATCH v9 01/31] gpu: nova-core: Hopper/Blackwell: basic GPU identification John Hubbard
2026-03-26  1:38 ` [PATCH v9 02/31] gpu: nova-core: factor .fwsignature* selection into a new find_gsp_sigs_section() John Hubbard
2026-03-30 14:29   ` Alexandre Courbot
2026-03-30 17:51     ` John Hubbard
2026-03-26  1:38 ` [PATCH v9 03/31] gpu: nova-core: use GPU Architecture to simplify HAL selections John Hubbard
2026-03-26  1:38 ` [PATCH v9 04/31] gpu: nova-core: add Copy/Clone to Spec and Revision, add chipset() accessor John Hubbard
2026-03-26  1:38 ` [PATCH v9 05/31] gpu: nova-core: set DMA mask width based on GPU architecture John Hubbard
2026-03-30 14:32   ` Alexandre Courbot
2026-03-30 21:31     ` John Hubbard
2026-03-26  1:38 ` [PATCH v9 06/31] gpu: nova-core: Hopper/Blackwell: skip GFW boot waiting John Hubbard
2026-03-30 14:52   ` Alexandre Courbot
2026-03-30 15:20     ` Gary Guo
2026-03-30 18:33     ` Joel Fernandes
2026-03-30 19:15       ` John Hubbard
2026-03-31  0:18       ` Alexandre Courbot
2026-03-31 16:17         ` Joel Fernandes
2026-03-26  1:38 ` [PATCH v9 07/31] gpu: nova-core: move firmware image parsing code to firmware.rs John Hubbard
2026-03-26  1:38 ` [PATCH v9 08/31] gpu: nova-core: factor out an elf_str() function John Hubbard
2026-03-26  1:38 ` [PATCH v9 09/31] gpu: nova-core: don't assume 64-bit firmware images John Hubbard
2026-03-26  1:38 ` [PATCH v9 10/31] gpu: nova-core: add support for 32-bit " John Hubbard
2026-03-26  1:38 ` [PATCH v9 11/31] gpu: nova-core: add auto-detection of 32-bit, 64-bit " John Hubbard
2026-03-26  1:38 ` [PATCH v9 12/31] gpu: nova-core: Hopper/Blackwell: add FMC firmware image, in support of FSP John Hubbard
2026-03-26  1:38 ` [PATCH v9 13/31] gpu: nova-core: Hopper/Blackwell: add FSP falcon engine stub John Hubbard
2026-03-26  1:38 ` [PATCH v9 14/31] gpu: nova-core: Hopper/Blackwell: add FSP falcon EMEM operations John Hubbard
2026-03-26  1:38 ` [PATCH v9 15/31] gpu: nova-core: Hopper/Blackwell: add FSP message infrastructure John Hubbard
2026-03-26  1:38 ` [PATCH v9 16/31] rust: ptr: add const_align_up() John Hubbard
2026-03-27  9:33   ` Miguel Ojeda
2026-03-30 21:41     ` John Hubbard
2026-03-31  0:03       ` Miguel Ojeda
2026-03-31  2:23         ` Alexandre Courbot
2026-03-31 10:26           ` Miguel Ojeda
2026-03-31  2:21   ` Alexandre Courbot
2026-03-31  2:36     ` John Hubbard
2026-03-31 10:24       ` Miguel Ojeda
2026-03-31 11:53         ` Danilo Krummrich
2026-04-03 10:01           ` Miguel Ojeda
2026-04-03 10:02   ` Miguel Ojeda
2026-03-26  1:38 ` [PATCH v9 17/31] gpu: nova-core: Hopper/Blackwell: calculate reserved FB heap size John Hubbard
2026-04-08  1:52   ` Alexandre Courbot
2026-04-08  3:05     ` John Hubbard
2026-03-26  1:38 ` [PATCH v9 18/31] gpu: nova-core: add MCTP/NVDM protocol types for firmware communication John Hubbard
2026-03-26  1:38 ` [PATCH v9 19/31] gpu: nova-core: Hopper/Blackwell: add FSP secure boot completion waiting John Hubbard
2026-04-08  1:52   ` Alexandre Courbot
2026-04-08  2:59     ` John Hubbard
2026-03-26  1:38 ` [PATCH v9 20/31] gpu: nova-core: Hopper/Blackwell: add FMC signature extraction John Hubbard
2026-03-26  1:38 ` [PATCH v9 21/31] gpu: nova-core: Hopper/Blackwell: add FSP send/receive messaging John Hubbard
2026-04-08  1:53   ` Alexandre Courbot
2026-03-26  1:38 ` [PATCH v9 22/31] gpu: nova-core: Hopper/Blackwell: add FspCotVersion type John Hubbard
2026-03-26  1:38 ` [PATCH v9 23/31] gpu: nova-core: Hopper/Blackwell: larger non-WPR heap John Hubbard
2026-03-26  1:38 ` [PATCH v9 24/31] gpu: nova-core: Hopper/Blackwell: add FSP Chain of Trust boot John Hubbard
2026-03-30 15:11   ` Alexandre Courbot
2026-03-30 22:54     ` John Hubbard [this message]
2026-04-08  3:00   ` Alexandre Courbot
2026-04-08  3:02     ` John Hubbard
2026-03-26  1:38 ` [PATCH v9 25/31] gpu: nova-core: Blackwell: use correct sysmem flush registers John Hubbard
2026-03-26  1:38 ` [PATCH v9 26/31] gpu: nova-core: make WPR heap sizing fallible John Hubbard
2026-04-08  1:53   ` Alexandre Courbot
2026-04-08  2:57     ` John Hubbard
2026-04-30  1:42     ` Alexandre Courbot
2026-03-26  1:38 ` [PATCH v9 27/31] gpu: nova-core: Hopper/Blackwell: larger WPR2 (GSP) heap John Hubbard
2026-03-26  1:38 ` [PATCH v9 28/31] gpu: nova-core: refactor SEC2 booter loading into BooterFirmware::run() John Hubbard
2026-03-26  1:39 ` [PATCH v9 29/31] gpu: nova-core: Hopper/Blackwell: add GSP lockdown release polling John Hubbard
2026-03-26  1:39 ` [PATCH v9 30/31] gpu: nova-core: Hopper/Blackwell: new location for PCI config mirror John Hubbard
2026-04-08  1:55   ` Alexandre Courbot
2026-04-08  2:52     ` John Hubbard
2026-03-26  1:39 ` [PATCH v9 31/31] gpu: nova-core: Hopper/Blackwell: integrate FSP boot path into boot() John Hubbard
2026-03-30  5:10 ` [PATCH v9 00/31] gpu: nova-core: firmware: Hopper/Blackwell support Alexandre Courbot
2026-03-30 22:47   ` John Hubbard
2026-04-08  1:51 ` Alexandre Courbot
2026-04-08  3:01   ` 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=07c99095-cf03-4f0d-acf5-6324a6466f43@nvidia.com \
    --to=jhubbard@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=apopple@nvidia.com \
    --cc=bhelgaas@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=ecourtney@nvidia.com \
    --cc=gary@garyguo.net \
    --cc=joelagnelf@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=shashanks@nvidia.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.