Documentation/gpu/nova/core/todo.rst | 17 -- drivers/gpu/nova-core/falcon.rs | 4 +- drivers/gpu/nova-core/fb.rs | 112 +++++++- drivers/gpu/nova-core/fb/hal.rs | 4 + drivers/gpu/nova-core/fb/hal/ga100.rs | 6 +- drivers/gpu/nova-core/fb/hal/ga102.rs | 14 +- drivers/gpu/nova-core/fb/hal/tu102.rs | 14 + drivers/gpu/nova-core/firmware.rs | 204 +++++++++++++- drivers/gpu/nova-core/firmware/booter.rs | 356 ++++++++++++++++++++++++ drivers/gpu/nova-core/firmware/gsp.rs | 117 ++++++++ drivers/gpu/nova-core/firmware/riscv.rs | 89 ++++++ drivers/gpu/nova-core/gpu.rs | 13 +- drivers/gpu/nova-core/gsp.rs | 7 + drivers/gpu/nova-core/nova_core.rs | 2 + drivers/gpu/nova-core/nvfw.rs | 42 +++ drivers/gpu/nova-core/nvfw/r570_144.rs | 28 ++ drivers/gpu/nova-core/nvfw/r570_144_bindings.rs | 126 +++++++++ rust/kernel/transmute.rs | 17 ++ 18 files changed, 1135 insertions(+), 37 deletions(-)
This series makes more progress on the GSP boot process for Ampere GPUs. At the end of the previous series [1], we were left with a WPR memory region created by the FRTS firmware, but still far from the GSP running. This series brings us closer to that goal by preparing 3 firmware packages: * The Booter firmware, which the driver loads and runs on the SEC2 falcon; * The GSP bootloader, which is loaded by Booter onto the GSP RISC-V core; * The GSP firmware itself, which is verified and loaded by the GSP bootloader. There 3 bundles are involved in a rather complex dance that is made necessary by limitations related to the level of privilege required to load code onto the GSP (doing so requires a Heavy Secured signed firmware, which is the role fulfilled by Booter). The first patch is an addition to `FromBytes` that makes it able to process the unaligned headers contained in the firmware files by performing a copy. Second patch adds support for a header commonly used in NVIDIA firmware files. Both are relatively simple. The third patch parses the Booter firmware file, queries the hardware for the right signature to use, and patch it into the firmware blob. This makes Booter ready to load and run. Fourth patch takes care of preparing the GSP bootloader for execution and fifth one does the same for the GSP firmware, which needs to come with its own device-mapped page table. Sixth and seventh patches switch to the 570.144 firmware and introduce the layout for its bindings. The raw bindings are stored in a private module, and abstracted/reexported by the parent module as needed. This allows consumer modules to access a safer/nicer form of the bindings than the raw one, and also makes it easier to switch to a different (and potentially incompatible) firmware version in the future. 570.144 has been picked because it is the latest firmware currently in linux-firmware, but as development progresses the plan is to switch to a newer one that is designed with the constraint of upstream in mind. So support for 570.144 will be dropped in the future. Support for multiple firmware versions is not considered at the moment: there is no immediate need for it as the driver is still unstable, and we can think about this point once we approach stability (and have better visibility about the shape of the firmware at that point). The last patch introduces the first bindings and uses them to compute more framebuffer layout information needed for booting the GSP. A separate patch series will pick up from there to use this information and finally run these firmware blobs. The base of this series is today's nova-next, but there a few more unmerged dependencies required: - BorrowedPage, AsPageIter and VmallocPageIter [2] - Rust infrastructure for sg_table and scatterlist [3] - FromBytes [4] - The Alignment series [5] [1] https://lore.kernel.org/rust-for-linux/20250619-nova-frts-v6-0-ecf41ef99252@nvidia.com/ [2] https://lore.kernel.org/rust-for-linux/20250820145434.94745-1-dakr@kernel.org/ [3] https://lore.kernel.org/rust-for-linux/20250825132539.122412-1-dakr@kernel.org/ [4] https://lore.kernel.org/rust-for-linux/20250824213134.27079-1-christiansantoslima21@gmail.com/ [5] https://lore.kernel.org/rust-for-linux/20250821-num-v4-0-1f3a425d7244@nvidia.com/ Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> --- Changes in v2: - Add some GSP bindings and use them to compute more FB layout info needed to boot GSP, - Use PinInit in GspFirmware to avoid several heap allocations, - Rename `bootloader` to `gsp_bootloader` in `Firmware` to avoid confusion with the future Turing falcon bootloader, - Link to v1: https://lore.kernel.org/r/20250822-nova_firmware-v1-0-ff5633679460@nvidia.com --- Alexandre Courbot (7): rust: transmute: add `from_bytes_copy` method to `FromBytes` trait gpu: nova-core: firmware: add support for common firmware header gpu: nova-core: firmware: process Booter and patch its signature gpu: nova-core: firmware: process the GSP bootloader gpu: nova-core: firmware: process and prepare the GSP firmware gpu: nova-core: firmware: use 570.144 firmware gpu: nova-core: compute layout of more framebuffer regions required for GSP Alistair Popple (1): gpu: nova-core: Add base files for r570.144 firmware bindings Documentation/gpu/nova/core/todo.rst | 17 -- drivers/gpu/nova-core/falcon.rs | 4 +- drivers/gpu/nova-core/fb.rs | 112 +++++++- drivers/gpu/nova-core/fb/hal.rs | 4 + drivers/gpu/nova-core/fb/hal/ga100.rs | 6 +- drivers/gpu/nova-core/fb/hal/ga102.rs | 14 +- drivers/gpu/nova-core/fb/hal/tu102.rs | 14 + drivers/gpu/nova-core/firmware.rs | 204 +++++++++++++- drivers/gpu/nova-core/firmware/booter.rs | 356 ++++++++++++++++++++++++ drivers/gpu/nova-core/firmware/gsp.rs | 117 ++++++++ drivers/gpu/nova-core/firmware/riscv.rs | 89 ++++++ drivers/gpu/nova-core/gpu.rs | 13 +- drivers/gpu/nova-core/gsp.rs | 7 + drivers/gpu/nova-core/nova_core.rs | 2 + drivers/gpu/nova-core/nvfw.rs | 42 +++ drivers/gpu/nova-core/nvfw/r570_144.rs | 28 ++ drivers/gpu/nova-core/nvfw/r570_144_bindings.rs | 126 +++++++++ rust/kernel/transmute.rs | 17 ++ 18 files changed, 1135 insertions(+), 37 deletions(-) --- base-commit: 331c24e6ce814af2af74bac648d1ac1708873e9c change-id: 20250822-nova_firmware-e0ffb492ba35 prerequisite-message-id: <20250820145434.94745-1-dakr@kernel.org> prerequisite-patch-id: 0e1b1f9a665317ff569a37df6ff49cd1880b04f8 prerequisite-patch-id: 178b864e6d1b88ee299dcc05d1a7a4c89ec7ed51 prerequisite-patch-id: 7f72c4bfd0e5f50b6d2f8ce96751782894a3ba81 prerequisite-patch-id: 62fa6de7d3ae99dc54c092087bd716e6749545fd prerequisite-patch-id: 3d14d56ca93b0831837aa26b802100a250adeac6 prerequisite-patch-id: 7a12f4b0e7588874ce589b41b70671dc261b9468 prerequisite-patch-id: c44763ec35c4e4431e769df088b98424cbddf7df prerequisite-message-id: <20250825132539.122412-1-dakr@kernel.org> prerequisite-patch-id: a9e008c179b1c2fbe76654a191e5018880383d49 prerequisite-patch-id: 363279599349e5efc7069a63b3f0574639e25418 prerequisite-patch-id: 4dd34d858514b7b982f4ebc85103a756205c3219 prerequisite-patch-id: a747e05834cdb8b8f727e1f7c8b110c636cadab8 prerequisite-patch-id: 24833689bdecd3fc7a604e13bfe203ccd2fca6f0 prerequisite-message-id: <20250824213134.27079-1-christiansantoslima21@gmail.com> prerequisite-patch-id: 3ddaa5300963f6c069411c6431965a7a48107a8b prerequisite-change-id: 20250620-num-9420281c02c7:v4 prerequisite-patch-id: 50077433250cad1cf60eb8f85c78e532ac91852e prerequisite-patch-id: 021a41cd35f09790ec383521ecc9b4c167868732 prerequisite-patch-id: a1ec5698a198d4aad45432b50d42f401e3db6452 prerequisite-patch-id: 8565b054c432bcc9a3a0d0121a934c74ef36d535 prerequisite-patch-id: 19d008deabb88beb441d2398f120ecb426fbdb43 prerequisite-patch-id: 3bc0d2be065a900d224ff8c1bc4450abfe9eb2cc prerequisite-patch-id: 5b4eb0f71fa2ccf662594819fa79fd932f4f164f prerequisite-patch-id: 9058ca08cd149444b5f910e4bb4494a890d1a733 prerequisite-patch-id: 8804806f7cc605feddded0804eec8b8362d7b965 prerequisite-patch-id: f999cabde51824432a1bf60817518d1ce189eb76 prerequisite-patch-id: 49e15538e142f2e7dd4f1ba0cf2fd891bd265d36 prerequisite-patch-id: 2ecf9b1e26b5203065bfac4ccf74301b3bb4fbe6 prerequisite-patch-id: 1af6ec7c2ce8503fe476985f59949dcd150ee6bf prerequisite-patch-id: ac72e72b3affece504bff76b60b88769ff200a2f prerequisite-patch-id: 7dc0a6da8c9727d27250cf730f8aaf6dd8b3d8c7 prerequisite-patch-id: 31a0a2469de9ac965186098072753dcc749b40fe prerequisite-patch-id: 7e6d1fc7cf910decf481d135a19b0add38da2b2a prerequisite-patch-id: c72ab11e9346de71eabfe0e6466636d5ab15a5ba prerequisite-patch-id: 3f236fdea8c4b33620d0f863fea573b46ab0ded6 prerequisite-patch-id: a8ab42d0c9c3c837bb4cacb02cef585ef163a27e prerequisite-patch-id: 930a1f26364ed67e0d6b85c96251028fda43c80a prerequisite-patch-id: f1bc1fd46145a66235ab7475463584e1803882a3 prerequisite-patch-id: 4a2fd7bd8d13dc2feaf68e0dc681546ce2ab3e40 prerequisite-patch-id: dd0df8d299dc0615a88cc0019f38bc09cee31ed7 prerequisite-patch-id: 56a45978f7b956c94ec66eecd4b438706d5174ce prerequisite-patch-id: e9bceff31bbf653d2641194b97eb1c4e5d8b93ee Best regards, -- Alexandre Courbot <acourbot@nvidia.com>
On 8/25/25 9:07 PM, Alexandre Courbot wrote: ... > The base of this series is today's nova-next, but there a few more > unmerged dependencies required: > > - BorrowedPage, AsPageIter and VmallocPageIter [2] > - Rust infrastructure for sg_table and scatterlist [3] > - FromBytes [4] > - The Alignment series [5] Hi Alex! For future patchsets that have complex and/or lengthy prerequisite patchsets, let's please please make it easier for people to locally apply the series. Very important. The very nicest experience is by simply providing a link to your git branch that exactly matches the patchset you just posted. In this particular case, it would also have worked to just say, "this series can be applied by first applying FromBytes [4], to the base commit." Because that works, and is simpler than hunting down the other three items, which are not actually necessary for git am (although they might be for actual testing). But the point is that the admin can be made simpler for the reviewers--even those of us who know exactly what you're up to. And we should keep that in mind, especially because there are many more of these situations coming soon. thanks, -- John Hubbard
On Wed Aug 27, 2025 at 9:29 AM JST, John Hubbard wrote: > On 8/25/25 9:07 PM, Alexandre Courbot wrote: > ... >> The base of this series is today's nova-next, but there a few more >> unmerged dependencies required: >> >> - BorrowedPage, AsPageIter and VmallocPageIter [2] >> - Rust infrastructure for sg_table and scatterlist [3] >> - FromBytes [4] >> - The Alignment series [5] > > Hi Alex! > > For future patchsets that have complex and/or lengthy prerequisite > patchsets, let's please please make it easier for people to > locally apply the series. Very important. > > The very nicest experience is by simply providing a link to your git > branch that exactly matches the patchset you just posted. > > In this particular case, it would also have worked to just say, "this > series can be applied by first applying FromBytes [4], to the base commit." > > Because that works, and is simpler than hunting down the other three > items, which are not actually necessary for git am (although they > might be for actual testing). > > But the point is that the admin can be made simpler for the reviewers--even > those of us who know exactly what you're up to. And we should keep > that in mind, especially because there are many more of these situations > coming soon. Right, b4 is supposed to be able to help with this as well, but indeed a link to a git tree should be the standard with patchsets requiring such dependencies. :) Will try to keep this in mind.
On 8/27/25 1:39 AM, Alexandre Courbot wrote: > On Wed Aug 27, 2025 at 9:29 AM JST, John Hubbard wrote: >> On 8/25/25 9:07 PM, Alexandre Courbot wrote: >> ... >> But the point is that the admin can be made simpler for the reviewers--even >> those of us who know exactly what you're up to. And we should keep >> that in mind, especially because there are many more of these situations >> coming soon. > > Right, b4 is supposed to be able to help with this as well, but indeed a It really doesn't quite, though. It is true that "base" (git format-patch --base) helps "b4 am" set things up, but then a subsequent "git am" fails due to missing prerequisites. b4 isn't set up to go retrieve those, on its own anyway. thanks, -- John Hubbard
On Wed, Aug 27, 2025 at 02:56:26PM -0700, John Hubbard wrote: > > Right, b4 is supposed to be able to help with this as well, but indeed a > > It really doesn't quite, though. > > It is true that "base" (git format-patch --base) helps "b4 am" set things > up, but then a subsequent "git am" fails due to missing prerequisites. > > b4 isn't set up to go retrieve those, on its own anyway. Sure it is. :) Try `b4 shazam -H` on this series. -K
On 8/28/25 1:44 PM, Konstantin Ryabitsev wrote: > On Wed, Aug 27, 2025 at 02:56:26PM -0700, John Hubbard wrote: >>> Right, b4 is supposed to be able to help with this as well, but indeed a >> >> It really doesn't quite, though. >> >> It is true that "base" (git format-patch --base) helps "b4 am" set things >> up, but then a subsequent "git am" fails due to missing prerequisites. >> >> b4 isn't set up to go retrieve those, on its own anyway. > > Sure it is. :) > > Try `b4 shazam -H` on this series. That is nice, I've updated my mental model of what b4 can do now. It still fails for this particular series, but it at least tries quite thoroughly to get the dependencies. I think this demonstrates a case of pushing even a very capable tool such as b4, a little too hard, though. <blueforge> linux-people (nova-next)$ b4 shazam -H "<20250826-nova_firmware-v2-0-93566252fe3a@nvidia.com>" Grabbing thread from lore.kernel.org/all/20250826-nova_firmware-v2-0-93566252fe3a@nvidia.com/t.mbox.gz Checking for newer revisions Grabbing search results from lore.kernel.org Analyzing 35 messages in the thread Analyzing 10 code-review messages Checking attestation on all messages, may take a moment... --- ✗ [PATCH v2 1/8] rust: transmute: add `from_bytes_copy` method to `FromBytes` trait + Acked-by: Miguel Ojeda <ojeda@kernel.org> (✓ DKIM/gmail.com) + Reviewed-by: John Hubbard <jhubbard@nvidia.com> (✗ DKIM/nvidia.com) + Reviewed-by: Benno Lossin <lossin@kernel.org> (✓ DKIM/kernel.org) ✗ [PATCH v2 2/8] gpu: nova-core: firmware: add support for common firmware header ✗ [PATCH v2 3/8] gpu: nova-core: firmware: process Booter and patch its signature ✗ [PATCH v2 4/8] gpu: nova-core: firmware: process the GSP bootloader + Reviewed-by: John Hubbard <jhubbard@nvidia.com> (✗ DKIM/nvidia.com) ✗ [PATCH v2 5/8] gpu: nova-core: firmware: process and prepare the GSP firmware ✗ [PATCH v2 6/8] gpu: nova-core: firmware: use 570.144 firmware + Reviewed-by: John Hubbard <jhubbard@nvidia.com> (✗ DKIM/nvidia.com) ✗ [PATCH v2 7/8] gpu: nova-core: Add base files for r570.144 firmware bindings + Reviewed-by: John Hubbard <jhubbard@nvidia.com> (✗ DKIM/nvidia.com) ✗ [PATCH v2 8/8] gpu: nova-core: compute layout of more framebuffer regions required for GSP --- ✗ BADSIG: DKIM/nvidia.com --- Total patches: 8 --- Base: using specified base-commit 331c24e6ce814af2af74bac648d1ac1708873e9c Deps: looking for dependencies matching 39 patch-ids Deps: Applying prerequisite patch: [PATCH v5 1/7] rust: page: implement BorrowedPage Deps: Applying prerequisite patch: [PATCH v5 2/7] rust: alloc: vmalloc: implement Vmalloc::to_page() Deps: Applying prerequisite patch: [PATCH v5 3/7] rust: alloc: implement VmallocPageIter Deps: Applying prerequisite patch: [PATCH v5 4/7] rust: page: define trait AsPageIter Deps: Applying prerequisite patch: [PATCH v5 5/7] rust: alloc: kbox: implement AsPageIter for VBox Deps: Applying prerequisite patch: [PATCH v2 4/6] rust: alloc: layout: implement ArrayLayout::size() Deps: Applying prerequisite patch: [PATCH v4 7/7] rust: alloc: kvec: implement AsPageIter for VVec Deps: Applying prerequisite patch: [PATCH v3 1/5] rust: dma: implement DataDirection Deps: Applying prerequisite patch: [PATCH v3 2/5] rust: dma: add type alias for bindings::dma_addr_t Deps: Applying prerequisite patch: [PATCH v3 3/5] rust: scatterlist: Add abstraction for sg_table Deps: Applying prerequisite patch: [PATCH v3 4/5] samples: rust: dma: add sample code for SGTable Deps: Applying prerequisite patch: [PATCH 4/4] MAINTAINERS: rust: dma: add scatterlist files Deps: Applying prerequisite patch: [PATCH v10] rust: transmute: Add methods for FromBytes trait Deps: Applying prerequisite patch: [PATCH] MAINTAINERS: Add website of Nova GPU driver Deps: Applying prerequisite patch: [PATCH 2/7] rust: gpu: update ARef and AlwaysRefCounted imports from sync::aref Deps: Applying prerequisite patch: [PATCH 01/18] gpu: nova-core: register: minor grammar and spelling fixes Deps: Applying prerequisite patch: [PATCH v2 02/19] gpu: nova-core: register: fix typo Deps: Applying prerequisite patch: [PATCH v2 04/19] gpu: nova-core: register: improve documentation for basic registers Deps: Applying prerequisite patch: [PATCH v2 05/19] gpu: nova-core: register: simplify @leaf_accessor rule Deps: Applying prerequisite patch: [PATCH v2 06/19] gpu: nova-core: register: remove `try_` accessors for relative registers Deps: Applying prerequisite patch: [PATCH 06/18] gpu: nova-core: register: move OFFSET declaration to I/O impl block Deps: Applying prerequisite patch: [PATCH 07/18] gpu: nova-core: register: fix documentation and indentation Deps: Applying prerequisite patch: [PATCH v2 09/19] gpu: nova-core: register: add missing doccomments for fixed registers I/O accessors Deps: Applying prerequisite patch: [PATCH 09/18] gpu: nova-core: register: add fields dispatcher internal rule Deps: Applying prerequisite patch: [PATCH v2 11/19] gpu: nova-core: register: improve `Debug` implementation Deps: Applying prerequisite patch: [PATCH 11/18] gpu: nova-core: register: generate correct `Default` implementation Deps: Applying prerequisite patch: [PATCH 12/18] gpu: nova-core: register: split @io rule into fixed and relative versions Deps: Applying prerequisite patch: [PATCH 13/18] gpu: nova-core: register: use #[inline(always)] for all methods Deps: Applying prerequisite patch: [PATCH v2 15/19] gpu: nova-core: register: redesign relative registers Deps: Applying prerequisite patch: [PATCH v2 16/19] gpu: nova-core: falcon: add distinct base address for PFALCON2 Deps: Applying prerequisite patch: [PATCH v2 17/19] gpu: nova-core: register: add support for register arrays Deps: Applying prerequisite patch: [PATCH v2 18/19] gpu: nova-core: falcon: use register arrays for FUSE registers Deps: Applying prerequisite patch: [PATCH v2 19/19] gpu: nova-core: register: add support for relative array registers Deps: Applying prerequisite patch: [PATCH v2] gpu: nova-core: falcon: align DMA transfers to 256 bytes Deps: Applying prerequisite patch: [PATCH v4 1/2] rust: add `Alignment` type Deps: Applying prerequisite patch: [PATCH v3 2/2] gpu: nova-core: use Alignment for alignment-related operations Magic: Preparing a sparse worktree Unable to cleanly apply series, see failure log below --- Applying: rust: page: implement BorrowedPage Applying: rust: alloc: vmalloc: implement Vmalloc::to_page() Applying: rust: alloc: implement VmallocPageIter Applying: rust: page: define trait AsPageIter Applying: rust: alloc: kbox: implement AsPageIter for VBox Applying: rust: alloc: layout: implement ArrayLayout::size() Applying: rust: alloc: kvec: implement AsPageIter for VVec Applying: rust: dma: implement DataDirection Applying: rust: dma: add type alias for bindings::dma_addr_t Patch failed at 0009 rust: dma: add type alias for bindings::dma_addr_t error: patch failed: drivers/gpu/nova-core/falcon.rs:4 error: drivers/gpu/nova-core/falcon.rs: patch does not apply hint: Use 'git am --show-current-patch=diff' to see the failed patch hint: When you have resolved this problem, run "git am --continue". hint: If you prefer to skip this patch, run "git am --skip" instead. hint: To restore the original branch and stop patching, run "git am --abort". hint: Disable this message with "git config set advice.mergeConflict false" --- Not fetching into FETCH_HEAD <blueforge> linux-people (nova-next)$ git am --show-current-patch=diff fatal: Resolve operation not in progress, we are not resuming. <blueforge> linux-people (nova-next)$ thanks, -- John Hubbard
© 2016 - 2025 Red Hat, Inc.