From: "Eliot Courtney" <ecourtney@nvidia.com>
To: "Alexandre Courbot" <acourbot@nvidia.com>,
"Danilo Krummrich" <dakr@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>
Cc: "John Hubbard" <jhubbard@nvidia.com>,
"Alistair Popple" <apopple@nvidia.com>,
"Joel Fernandes" <joelagnelf@nvidia.com>,
"Timur Tabi" <ttabi@nvidia.com>, "Edwin Peer" <epeer@nvidia.com>,
"Eliot Courtney" <ecourtney@nvidia.com>,
<nouveau@lists.freedesktop.org>, <rust-for-linux@vger.kernel.org>,
<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
"dri-devel" <dri-devel-bounces@lists.freedesktop.org>
Subject: Re: [PATCH v11 12/12] gpu: nova-core: use the Generic Bootloader to boot FWSEC on Turing
Date: Mon, 09 Mar 2026 14:07:24 +0900 [thread overview]
Message-ID: <DGXZORYY7PZD.1XU3HNHXCKBM5@nvidia.com> (raw)
In-Reply-To: <20260306-turing_prep-v11-12-8f0042c5d026@nvidia.com>
On Fri Mar 6, 2026 at 1:52 PM JST, Alexandre Courbot wrote:
> +/// Descriptor used by RM to figure out the requirements of the boot loader.
> +///
> +/// Most of its fields appear to be legacy and carry incorrect values, so they are left unused.
> +#[repr(C)]
> +#[derive(Debug, Clone)]
> +struct BootloaderDesc {
> + /// Starting tag of bootloader.
> + start_tag: u32,
> + /// DMEM load offset - unused here as we always load at offset `0`.
> + _dmem_load_off: u32,
> + /// Offset of code section in the image. Unused as there is only one section in the bootloader
> + /// binary.
> + _code_off: u32,
I still think it would be slightly better to use this value, I posted
some more context here:
https://lore.kernel.org/all/DGXZCHSH4JPB.1ZZW2B72MHCMT@nvidia.com/
> + // `BootloaderDmemDescV2` expects the source to be a mirror image of the destination
> + // and uses the same offset parameter for both.
> + //
> + // Thus, the start of the source object needs to be padded with the difference betwen
> + // the destination and source offsets.
> + //
> + // In practice, this is expected to always be zero but is required for code
> + // correctness.
> + let (align_padding, firmware_dma) = {
> + let align_padding = {
> + let imem_sec = firmware.imem_sec_load_params();
> +
> + imem_sec
> + .dst_start
> + .checked_sub(imem_sec.src_start)
> + .map(usize::from_safe_cast)
> + .ok_or(EOVERFLOW)?
> + };
> +
> + let mut firmware_obj = KVVec::new();
> + firmware_obj.extend_with(align_padding, 0u8, GFP_KERNEL)?;
> + firmware_obj.extend_from_slice(firmware.ucode.0.as_slice(), GFP_KERNEL)?;
> +
> + (
> + align_padding,
> + DmaObject::from_data(dev, firmware_obj.as_slice())?,
> + )
> + };
> +
> + let dmem_desc = {
> + // Bootloader payload is in non-coherent system memory.
> + const FALCON_DMAIDX_PHYS_SYS_NCOH: u32 = 4;
> +
> + let imem_sec = firmware.imem_sec_load_params();
> + let imem_ns = firmware.imem_ns_load_params().ok_or(EINVAL)?;
> + let dmem = firmware.dmem_load_params();
> +
> + // The bootloader does not have a data destination offset field and copies the data at
> + // the start of DMEM, so it can only be used if the destination offset of the firmware
> + // is 0.
> + if dmem.dst_start != 0 {
> + return Err(EINVAL);
> + }
> +
> + BootloaderDmemDescV2 {
> + reserved: [0; 4],
> + signature: [0; 4],
> + ctx_dma: FALCON_DMAIDX_PHYS_SYS_NCOH,
> + code_dma_base: firmware_dma.dma_handle(),
> + // `dst_start` is also valid as the source offset since the firmware DMA object is
> + // a mirror image of the target IMEM layout.
> + non_sec_code_off: imem_ns.dst_start,
> + non_sec_code_size: imem_ns.len,
> + // `dst_start` is also valid as the source offset since the firmware DMA object is
> + // a mirror image of the target IMEM layout.
> + sec_code_off: imem_sec.dst_start,
nit: it's incorrect to use `src_start` but the comment implies that it
would also be ok to use `src_start` "is also valid". IIUC we create the padded
firmware above (good catch on finding that!) and that uses `src_start`,
then since the falcon expects the same layout between the source
constructed image and the destination in its memory, it uses these
*_off values doubly to compute the source and destination addresses.
The aligning above is a way to make sure that `dst_start` can properly
perform this double duty. Some comment explaining this might be useful,
IMO.
Apart from that,
Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
next prev parent reply other threads:[~2026-03-09 5:07 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-06 4:52 [PATCH v11 00/12] gpu: nova-core: add Turing support Alexandre Courbot
2026-03-06 4:52 ` [PATCH v11 01/12] gpu: nova-core: create falcon firmware DMA objects lazily Alexandre Courbot
2026-03-06 4:52 ` [PATCH v11 02/12] gpu: nova-core: falcon: add constant for memory block alignment Alexandre Courbot
2026-03-06 4:52 ` [PATCH v11 03/12] gpu: nova-core: falcon: rename load parameters to reflect DMA dependency Alexandre Courbot
2026-03-06 6:23 ` Eliot Courtney
2026-03-06 4:52 ` [PATCH v11 04/12] gpu: nova-core: falcon: remove FalconFirmware's dependency on FalconDmaLoadable Alexandre Courbot
2026-03-06 4:52 ` [PATCH v11 05/12] gpu: nova-core: move brom_params and boot_addr to FalconFirmware Alexandre Courbot
2026-03-06 4:52 ` [PATCH v11 06/12] gpu: nova-core: add PIO support for loading firmware images Alexandre Courbot
2026-03-06 4:52 ` [PATCH v11 07/12] gpu: nova-core: falcon: remove unwarranted safety check in dma_load Alexandre Courbot
2026-03-06 4:52 ` [PATCH v11 08/12] gpu: nova-core: firmware: add comments to justify v3 header values Alexandre Courbot
2026-03-09 4:54 ` Eliot Courtney
2026-03-06 4:52 ` [PATCH v11 09/12] gpu: nova-core: firmware: fix and explain v2 header offsets computations Alexandre Courbot
2026-03-09 4:55 ` Eliot Courtney
2026-03-09 12:10 ` Gary Guo
2026-03-10 1:49 ` Alexandre Courbot
2026-03-06 4:52 ` [PATCH v11 10/12] gpu: nova-core: make Chipset::arch() const Alexandre Courbot
2026-03-06 4:52 ` [PATCH v11 11/12] gpu: nova-core: add gen_bootloader firmware to ModInfoBuilder Alexandre Courbot
2026-03-06 4:52 ` [PATCH v11 12/12] gpu: nova-core: use the Generic Bootloader to boot FWSEC on Turing Alexandre Courbot
2026-03-09 5:07 ` Eliot Courtney [this message]
2026-03-09 1:52 ` [PATCH v11 00/12] gpu: nova-core: add Turing support Alexandre Courbot
2026-03-09 2:06 ` John Hubbard
2026-03-09 2:20 ` Alexandre Courbot
2026-03-09 19:48 ` Ewan Chorynski
2026-03-09 20:04 ` John Hubbard
2026-03-09 20:18 ` Timur Tabi
2026-03-09 20:29 ` John Hubbard
2026-03-09 20:39 ` Timur Tabi
2026-03-09 21:00 ` Ewan Chorynski
2026-03-09 21:05 ` Timur Tabi
2026-03-09 21:16 ` Ewan Chorynski
2026-03-09 21:22 ` 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=DGXZORYY7PZD.1XU3HNHXCKBM5@nvidia.com \
--to=ecourtney@nvidia.com \
--cc=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=aliceryhl@google.com \
--cc=apopple@nvidia.com \
--cc=dakr@kernel.org \
--cc=dri-devel-bounces@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=epeer@nvidia.com \
--cc=jhubbard@nvidia.com \
--cc=joelagnelf@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
--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
all inboxes | Powered by JetHome®