From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Timur Tabi" <ttabi@nvidia.com>,
"nouveau@lists.freedesktop.org" <nouveau@lists.freedesktop.org>,
"Alexandre Courbot" <acourbot@nvidia.com>,
"dakr@kernel.org" <dakr@kernel.org>,
"lyude@redhat.com" <lyude@redhat.com>,
"Joel Fernandes" <joelagnelf@nvidia.com>,
"John Hubbard" <jhubbard@nvidia.com>,
"rust-for-linux@vger.kernel.org" <rust-for-linux@vger.kernel.org>
Cc: "nouveau-bounces@lists.freedesktop.org"
<nouveau-bounces@lists.freedesktop.org>
Subject: Re: [PATCH 03/11] gpu: nova-core: support header parsing on Turing/GA100
Date: Tue, 25 Nov 2025 08:54:20 +0900 [thread overview]
Message-ID: <DEHBWF3FJFHG.1DO4UJ0RE7SK5@nvidia.com> (raw)
In-Reply-To: <8026f53d6685374bfc086621326e9d7c52009d4c.camel@nvidia.com>
On Tue Nov 25, 2025 at 8:24 AM JST, Timur Tabi wrote:
> On Wed, 2025-11-19 at 16:03 +0900, Alexandre Courbot wrote:
>> If it comes down to "This is how things are pre and post GA102" (and the
>> evidence I have seen to far suggests that unfortunately), then so be it
>> - we at the very least encode this as a method of `Chipset` to avoid
>> hardcoding chipset versions in several places.
>
> I could add this method to Chipset:
>
> pub(crate) fn supports_dma(&self) -> bool {
> *self > Self::GA100
> }
>
> But shouldn't this be added to the HAL instead?
Agreed, that's a better place for that.
>
> There are a few things that are arbitrarily conditional:
>
> 1) whether to use PIO or DMA to transfer firmware images to Falcons
As you said this one could be abstracted in the falcon HAL, by having a
(public) load method that calls back into the (now private) DMA or PIO
methods of `falcon.rs`.
> 2) whether a Generic Bootloader is needed for load FWSEC
I suspect this one is correlated to the FWSEC header version? But maybe
I am just seeing patterns.
> 3) whether a Non-Secure IMEM section exists
This is the one that gives us headaches currently...
> 4) what the name of the signature section in the GSP-RM ELF image is
This one is appropriately dealt with with the match statement in the
code - after all, these ARE dependent on the chipset.
>
> If I'm reading it right, booter.rs currently has no concept of a HAL, which is why I gated on
> Chipset. I agree that doing stuff like
>
> FalconLoadTarget {
> src_start: app0.offset,
> dst_start: if chipset > Chipset::GA100 { 0 } else { app0.offset },
> len: app0.len,
> },
`booter.rs` won't have a HAL because it is not a hardware part. So worst
case, if there is really nothing better, relying on the chipset is
acceptable as this is just how the firmware is designed.
>
> is not ideal. To be honest, it's hard to wrap my head around all of these offsets. I'm convinced
> that most of the confusion is the result of RM developers trying to shoehorn complex firmware images
> into legacy file formats. Just looking at the above:
>
> On Turing, the secure IMEM image is copied from app0.offset in the file to -> app0.offset (256) in
> IMEM.
> On Ampere, the secure IMEM image is copied from app0.offset in the file to -> 0 in IMEM.
>
> Why? Apparently, because on Ampere we copy the Secure image to offset 0 and ignore the Non-Secure
> image. On Turing, we copy the Non-Secure image to offset 0 and copy the Secure image to offset 256.
> It would have been much easier to copy the Secure image to 256 on Ampere also, but that's just not
> what happens.
>
> For some reason, os_code_offset and os_code_size contain the same values on both Turing and Ampere,
> but those values are used only on Turing to hold the Non-Secure section. So the firmware image
> headers say that there's a non-secure IMEM section on Ampere, but it's a lie.
Yup, I was hoping that we could discriminate between the two using the
size of the non-secure image (which I expected to be zero on Ampere+),
but ... no. :')
Now with moving the loading abstraction to the HAL, I guess that would
leave only `booter.rs` as the place where we need to match on the
chipset "because that's the way it is". If that's the case, let's not
spend too much time looking for patterns that don't exist, a comment
explaining the situation will do and we can try and fix this in future
firmware versions.
Thanks for looking into it!
next prev parent reply other threads:[~2025-11-24 23:54 UTC|newest]
Thread overview: 100+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-14 23:30 [PATCH 00/11] gpu: nova-core: add Turing support Timur Tabi
2025-11-14 23:30 ` [PATCH 01/11] gpu: nova-core: rename Imem to ImemSec Timur Tabi
2025-11-17 22:50 ` Lyude Paul
2025-11-14 23:30 ` [PATCH 02/11] gpu: nova-core: add ImemNs section infrastructure Timur Tabi
2025-11-17 23:19 ` Lyude Paul
2025-11-19 1:54 ` Alexandre Courbot
2025-11-19 6:30 ` John Hubbard
2025-11-19 6:55 ` Alexandre Courbot
2025-11-19 19:54 ` Timur Tabi
2025-11-19 20:34 ` Joel Fernandes
2025-11-19 20:45 ` Timur Tabi
2025-11-19 20:54 ` John Hubbard
2025-11-19 20:56 ` Timur Tabi
2025-11-20 1:45 ` Alexandre Courbot
2025-11-24 22:24 ` Timur Tabi
2025-11-14 23:30 ` [PATCH 03/11] gpu: nova-core: support header parsing on Turing/GA100 Timur Tabi
2025-11-17 22:33 ` Joel Fernandes
2025-11-18 0:52 ` Timur Tabi
2025-11-18 1:04 ` Joel Fernandes
2025-11-18 1:06 ` Timur Tabi
2025-11-18 1:15 ` John Hubbard
2025-11-18 1:29 ` John Hubbard
2025-11-18 1:12 ` John Hubbard
2025-11-18 19:42 ` Joel Fernandes
2025-11-19 2:51 ` Alexandre Courbot
2025-11-19 5:16 ` Timur Tabi
2025-11-19 7:03 ` Alexandre Courbot
2025-11-24 23:24 ` Timur Tabi
2025-11-24 23:54 ` Alexandre Courbot [this message]
2025-11-19 7:04 ` John Hubbard
2025-11-19 20:10 ` Joel Fernandes
2025-11-24 23:47 ` Timur Tabi
2025-11-24 23:55 ` John Hubbard
2025-11-25 0:57 ` Alexandre Courbot
2025-11-25 1:02 ` Timur Tabi
2025-11-25 0:05 ` Joel Fernandes
2025-11-14 23:30 ` [PATCH 04/11] gpu: nova-core: add support for Turing/GA100 fwsignature Timur Tabi
2025-11-17 23:20 ` Lyude Paul
2025-11-19 2:59 ` Alexandre Courbot
2025-11-19 5:17 ` Timur Tabi
2025-11-19 7:11 ` Alexandre Courbot
2025-11-19 7:17 ` John Hubbard
2025-11-19 7:34 ` Alexandre Courbot
2025-11-14 23:30 ` [PATCH 05/11] gpu: nova-core: add NV_PFALCON_FALCON_DMATRFCMD::with_falcon_mem() Timur Tabi
2025-11-19 3:04 ` Alexandre Courbot
2025-11-19 6:32 ` John Hubbard
2025-11-14 23:30 ` [PATCH 06/11] gpu: nova-core: add Turing boot registers Timur Tabi
2025-11-17 22:41 ` Joel Fernandes
2025-11-19 2:17 ` Alexandre Courbot
2025-11-19 6:34 ` John Hubbard
2025-11-19 6:47 ` Alexandre Courbot
2025-11-19 6:51 ` John Hubbard
2025-11-19 7:15 ` Alexandre Courbot
2025-11-19 7:24 ` John Hubbard
2025-11-19 19:10 ` Timur Tabi
2025-11-20 1:41 ` Alexandre Courbot
2025-11-14 23:30 ` [PATCH 07/11] gpu: nova-core: move some functions into the HAL Timur Tabi
2025-11-14 23:30 ` [PATCH 08/11] gpu: nova-core: Add basic Turing HAL Timur Tabi
2025-11-18 0:50 ` Joel Fernandes
2025-11-19 3:11 ` Alexandre Courbot
2025-11-14 23:30 ` [PATCH 09/11] gpu: nova-core: add FalconUCodeDescV2 support Timur Tabi
2025-11-17 23:10 ` Joel Fernandes
2025-11-18 13:04 ` Alexandre Courbot
2025-11-18 15:08 ` Timur Tabi
2025-11-18 19:46 ` Joel Fernandes
2025-11-19 1:36 ` Alexandre Courbot
2025-11-18 19:45 ` Joel Fernandes
2025-11-19 6:40 ` John Hubbard
2025-11-25 23:59 ` Timur Tabi
2025-11-26 0:31 ` John Hubbard
2025-11-26 1:05 ` Alexandre Courbot
2025-11-26 1:09 ` John Hubbard
2025-11-26 9:57 ` Miguel Ojeda
2025-12-01 21:11 ` Timur Tabi
2025-11-19 3:27 ` Alexandre Courbot
2025-11-14 23:30 ` [PATCH 10/11] gpu: nova-core: LibosMemoryRegionInitArgument size must be page aligned Timur Tabi
2025-11-19 3:36 ` Alexandre Courbot
2025-12-01 23:25 ` Timur Tabi
2025-12-03 11:54 ` Alexandre Courbot
2025-12-03 12:03 ` Alice Ryhl
2025-12-03 13:39 ` Alexandre Courbot
2025-12-03 18:31 ` Timur Tabi
2025-12-04 14:43 ` Alexandre Courbot
2025-12-04 21:18 ` Timur Tabi
2025-12-04 21:45 ` Timur Tabi
2025-12-05 0:35 ` Alexandre Courbot
2025-12-05 20:22 ` Timur Tabi
2025-12-09 2:53 ` Alexandre Courbot
2025-12-05 23:22 ` Timur Tabi
2025-12-09 2:55 ` Alexandre Courbot
2025-12-03 18:34 ` Miguel Ojeda
2025-12-03 19:17 ` Timur Tabi
2025-11-14 23:30 ` [PATCH 11/11] gpu: nova-core: add PIO support for loading firmware images Timur Tabi
2025-11-17 23:34 ` Joel Fernandes
2025-11-18 13:08 ` Alexandre Courbot
2025-12-01 23:26 ` Timur Tabi
2025-11-19 4:28 ` Alexandre Courbot
2025-11-19 13:49 ` Alexandre Courbot
2025-11-19 7:01 ` Alexandre Courbot
2025-11-19 4:29 ` [PATCH 00/11] gpu: nova-core: add Turing support Alexandre Courbot
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=DEHBWF3FJFHG.1DO4UJ0RE7SK5@nvidia.com \
--to=acourbot@nvidia.com \
--cc=dakr@kernel.org \
--cc=jhubbard@nvidia.com \
--cc=joelagnelf@nvidia.com \
--cc=lyude@redhat.com \
--cc=nouveau-bounces@lists.freedesktop.org \
--cc=nouveau@lists.freedesktop.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=ttabi@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;
as well as URLs for NNTP newsgroup(s).