* [PATCH 0/9] gpu: nova-core: run falcon binaries for the r000 GSP-RM
@ 2026-11-20 4:46 John Hubbard
2026-11-20 4:46 ` [PATCH 1/9] rust: pci: add domain_nr() accessor John Hubbard
` (8 more replies)
0 siblings, 9 replies; 19+ messages in thread
From: John Hubbard @ 2026-11-20 4:46 UTC (permalink / raw)
To: Danilo Krummrich, Alexandre Courbot
Cc: Timur Tabi, Alistair Popple, Eliot Courtney, Zhi Wang,
David Airlie, Simona Vetter, Bjorn Helgaas, Miguel Ojeda,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Daniel Almeida,
Tamir Duberstein, Onur Özkan, nova-gpu, dri-devel, LKML,
linux-pci, rust-for-linux, John Hubbard
This series adds the code that runs a falcon binary on behalf of the
r000 GSP-RM during boot. It is the next part of the r000 GSP firmware
series [1], which moves nova-core onto the GSP firmware of the r615 and
later releases. The patches do not depend on the switch to r000, so they
are posted on their own, in order to make the rest of that series
smaller. With these applied, the driver still boots the r570 firmware.
Some background (perhaps a refresher for some readers): the GSP falcon
has two cores, a falcon core and a RISC-V core, and only one of the two
is active at a time. GSP-RM runs on the RISC-V core.
During boot, the r000 GSP-RM requires a binary to run on the falcon
core. GSP-RM raises a load-and-execute event and suspends the RISC-V
core. The driver then resets the GSP falcon, loads and runs the binary,
and resumes GSP-RM. There are two such events:
* On GA102 and later, the binary is a Heavy-Secured (HS) binary that
GSP-RM has placed in the framebuffer.
* On Turing and GA100, the binary is an image that the generic falcon
bootloader loads. The event carries a descriptor of the image.
The series adds a handler for each of the two events, and a dispatcher
that selects the handler from the command ID of an event. The handlers
share steps with code that the driver already has, so the series first
factors those steps out:
* the wait for the GSP suspend, out of the shutdown path
* the BROM and BOOTVEC programming, out of the PIO and DMA load paths
* the core reset and the core resume, out of the CPU sequencer
The only change in what the driver does with the r570 firmware is a
slight change in the appearance of two error messages (mentioned below).
The series also has one patch that the handlers do not use, and that the
rest of the r000 series requires: the PCI domain accessor. The patch is
its v2 posting [2] with the Reviewed-by tags from Alex and Gary.
The series applies on drm-rust-next at 0dbf41fd03ab, on top of one build
fix that is in v7.4-rc2 and not yet in drm-rust-next:
commit 57d916a3eb76 ("rust: bindings: derive Zeroable for bindgen's
opaque array wrappers"). A branch with everything applied:
https://github.com/johnhubbard/linux/tree/nova-core-run-falcon-binaries-v0/
Changes since v3 of the r000 series. The two handlers and the dispatcher
come from v3 patches 15, 17 and 18:
* The handlers now use the core reset and the core resume of the CPU
sequencer.
* Typesafe handler code: a handler receives its decoded parameters, and
the dispatcher decodes the payload of the event, instead of using two
raw byte slices to describe the payload.
* The selection of the BAR2 engine ID is now introduced in a separate,
small patch.
* Fixed two error messages in GSP-RM resume.
An LLM coding assistant (Claude Code) helped write every patch, and
drafted the commit messages and this letter, all of which I've edited by
hand afterwards.
[1] https://lore.kernel.org/all/20260918010719.1176945-1-jhubbard@nvidia.com/
[2] https://lore.kernel.org/all/20261111200549.160806-1-jhubbard@nvidia.com/
John Hubbard (9):
rust: pci: add domain_nr() accessor
gpu: nova-core: falcon: factor out the wait for the GSP suspend
gpu: nova-core: falcon: factor out the BROM and BOOTVEC programming
gpu: nova-core: gsp: factor out the core reset and the core resume
gpu: nova-core: gsp: fix resume_gsp_rm()'s error messages
gpu: nova-core: falcon: select the BAR2 engine ID for framebuffer DMA
gpu: nova-core: gsp: add the r000 load-and-execute HS binary handler
gpu: nova-core: gsp: add the r000 load-and-execute bootloader handler
gpu: nova-core: gsp: add the load-and-execute event dispatcher
drivers/gpu/nova-core/falcon.rs | 46 +-
drivers/gpu/nova-core/falcon/gsp.rs | 15 +
.../gpu/nova-core/firmware/gen_bootloader.rs | 8 +-
drivers/gpu/nova-core/gsp.rs | 1 +
drivers/gpu/nova-core/gsp/boot.rs | 8 +-
drivers/gpu/nova-core/gsp/load_exec.rs | 493 ++++++++++++++++++
drivers/gpu/nova-core/gsp/sequencer.rs | 48 +-
drivers/gpu/nova-core/regs.rs | 2 +
drivers/gpu/nova-core/sbuffer.rs | 1 -
rust/helpers/pci.c | 5 +
rust/kernel/pci.rs | 16 +
11 files changed, 582 insertions(+), 61 deletions(-)
create mode 100644 drivers/gpu/nova-core/gsp/load_exec.rs
base-commit: 0dbf41fd03abee01a37a83336ed84cd5812af633
prerequisite-patch-id: dba3141a4ed9123a37958daa1a27e82669d64941
--
2.56.1
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 1/9] rust: pci: add domain_nr() accessor
2026-11-20 4:46 [PATCH 0/9] gpu: nova-core: run falcon binaries for the r000 GSP-RM John Hubbard
@ 2026-11-20 4:46 ` John Hubbard
2026-11-20 4:54 ` sashiko-bot
2026-11-20 4:46 ` [PATCH 2/9] gpu: nova-core: falcon: factor out the wait for the GSP suspend John Hubbard
` (7 subsequent siblings)
8 siblings, 1 reply; 19+ messages in thread
From: John Hubbard @ 2026-11-20 4:46 UTC (permalink / raw)
To: Danilo Krummrich, Alexandre Courbot
Cc: Timur Tabi, Alistair Popple, Eliot Courtney, Zhi Wang,
David Airlie, Simona Vetter, Bjorn Helgaas, Miguel Ojeda,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Daniel Almeida,
Tamir Duberstein, Onur Özkan, nova-gpu, dri-devel, LKML,
linux-pci, rust-for-linux, John Hubbard
The nova-core driver has to send the GPU's PCI location to the GPU's
firmware as one word that holds the domain, the bus and the device
number.
The PCI abstraction has dev_id(), which packs the bus, the device and
the function into one value. It has no accessor that reports the domain.
Add an accessor for the domain number.
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
rust/helpers/pci.c | 5 +++++
rust/kernel/pci.rs | 16 ++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/rust/helpers/pci.c b/rust/helpers/pci.c
index a8540f90b13c..a1e033531419 100644
--- a/rust/helpers/pci.c
+++ b/rust/helpers/pci.c
@@ -7,6 +7,11 @@ __rust_helper u16 rust_helper_pci_dev_id(struct pci_dev *dev)
return PCI_DEVID(dev->bus->number, dev->devfn);
}
+__rust_helper int rust_helper_pci_domain_nr(struct pci_bus *bus)
+{
+ return pci_domain_nr(bus);
+}
+
__rust_helper resource_size_t
rust_helper_pci_resource_start(struct pci_dev *pdev, int bar)
{
diff --git a/rust/kernel/pci.rs b/rust/kernel/pci.rs
index 769d01d23429..60e0d8518266 100644
--- a/rust/kernel/pci.rs
+++ b/rust/kernel/pci.rs
@@ -408,6 +408,22 @@ pub fn dev_id(&self) -> u16 {
unsafe { bindings::pci_dev_id(self.as_raw()) }
}
+ /// Returns the PCI domain number of the bus that this device is on.
+ #[inline]
+ pub fn domain_nr(&self) -> u32 {
+ // SAFETY: By its type invariant `self.as_raw` is always a valid pointer to a
+ // `struct pci_dev`, which holds a reference to the `struct pci_bus` that its `bus` field
+ // points to.
+ let domain_nr = unsafe { bindings::pci_domain_nr((*self.as_raw()).bus) };
+
+ debug_assert!(domain_nr >= 0);
+
+ // CAST: `pci_domain_nr()` returns an `int`, but a registered bus never has a negative
+ // domain. A negative value here is a kernel bug rather than a condition for a caller to
+ // handle.
+ domain_nr as u32
+ }
+
/// Returns the PCI subsystem vendor ID.
#[inline]
pub fn subsystem_vendor_id(&self) -> u16 {
--
2.56.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 2/9] gpu: nova-core: falcon: factor out the wait for the GSP suspend
2026-11-20 4:46 [PATCH 0/9] gpu: nova-core: run falcon binaries for the r000 GSP-RM John Hubbard
2026-11-20 4:46 ` [PATCH 1/9] rust: pci: add domain_nr() accessor John Hubbard
@ 2026-11-20 4:46 ` John Hubbard
2026-11-20 4:49 ` sashiko-bot
2026-11-20 4:46 ` [PATCH 3/9] gpu: nova-core: falcon: factor out the BROM and BOOTVEC programming John Hubbard
` (6 subsequent siblings)
8 siblings, 1 reply; 19+ messages in thread
From: John Hubbard @ 2026-11-20 4:46 UTC (permalink / raw)
To: Danilo Krummrich, Alexandre Courbot
Cc: Timur Tabi, Alistair Popple, Eliot Courtney, Zhi Wang,
David Airlie, Simona Vetter, Bjorn Helgaas, Miguel Ojeda,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Daniel Almeida,
Tamir Duberstein, Onur Özkan, nova-gpu, dri-devel, LKML,
linux-pci, rust-for-linux, John Hubbard
The r000 boot protocol requires the driver to wait for the GSP suspend
bit after each load-and-execute event, as the shutdown path already
does.
In order to make the wait available to the boot sequence, factor it out
of the shutdown path, into a method of the GSP falcon.
No functional changes.
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
drivers/gpu/nova-core/falcon/gsp.rs | 15 +++++++++++++++
drivers/gpu/nova-core/gsp/boot.rs | 8 +-------
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/nova-core/falcon/gsp.rs b/drivers/gpu/nova-core/falcon/gsp.rs
index 54247691b53c..2ea28fa53db8 100644
--- a/drivers/gpu/nova-core/falcon/gsp.rs
+++ b/drivers/gpu/nova-core/falcon/gsp.rs
@@ -54,6 +54,21 @@ pub(crate) fn is_processor_suspended(&self) -> bool {
.processor_suspended()
}
+ /// Waits until GSP-RM has suspended the RISC-V core.
+ ///
+ /// # Errors
+ ///
+ /// - `ETIMEDOUT` if the core has not suspended within five seconds.
+ pub(crate) fn wait_for_processor_suspend(&self) -> Result {
+ read_poll_timeout(
+ || Ok(self.is_processor_suspended()),
+ |suspended| *suspended,
+ Delta::from_millis(10),
+ Delta::from_secs(5),
+ )
+ .map(|_| ())
+ }
+
/// Clears the SWGEN0 latch in the GSP falcon.
///
/// While the latch is set, no later message signals the tree, so a caller that consumed a
diff --git a/drivers/gpu/nova-core/gsp/boot.rs b/drivers/gpu/nova-core/gsp/boot.rs
index 9d5da5b165ac..2815fe8b306e 100644
--- a/drivers/gpu/nova-core/gsp/boot.rs
+++ b/drivers/gpu/nova-core/gsp/boot.rs
@@ -97,13 +97,7 @@ fn shutdown_gsp(
cmdq.send_rpc_command(commands::rpc::UnloadingGuestDriver::new(mode))?;
// Wait until GSP signals it is suspended.
- read_poll_timeout(
- || Ok(gsp_falcon.is_processor_suspended()),
- |suspended| *suspended,
- Delta::from_millis(10),
- Delta::from_secs(5),
- )
- .map(|_| ())
+ gsp_falcon.wait_for_processor_suspend()
}
/// Attempts to unload the GSP firmware.
--
2.56.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 3/9] gpu: nova-core: falcon: factor out the BROM and BOOTVEC programming
2026-11-20 4:46 [PATCH 0/9] gpu: nova-core: run falcon binaries for the r000 GSP-RM John Hubbard
2026-11-20 4:46 ` [PATCH 1/9] rust: pci: add domain_nr() accessor John Hubbard
2026-11-20 4:46 ` [PATCH 2/9] gpu: nova-core: falcon: factor out the wait for the GSP suspend John Hubbard
@ 2026-11-20 4:46 ` John Hubbard
2026-11-20 4:49 ` sashiko-bot
2026-11-20 4:46 ` [PATCH 4/9] gpu: nova-core: gsp: factor out the core reset and the core resume John Hubbard
` (5 subsequent siblings)
8 siblings, 1 reply; 19+ messages in thread
From: John Hubbard @ 2026-11-20 4:46 UTC (permalink / raw)
To: Danilo Krummrich, Alexandre Courbot
Cc: Timur Tabi, Alistair Popple, Eliot Courtney, Zhi Wang,
David Airlie, Simona Vetter, Bjorn Helgaas, Miguel Ojeda,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Daniel Almeida,
Tamir Duberstein, Onur Özkan, nova-gpu, dri-devel, LKML,
linux-pci, rust-for-linux, John Hubbard
The r000 boot protocol requires the driver to program the BROM registers
and the BOOTVEC register of the GSP falcon for a binary that GSP-RM has
placed in the framebuffer, as the PIO and DMA load paths already do for
a firmware image.
In order to make the programming available to a caller that has no
firmware image, factor it out of the two load paths, into a falcon
method that receives the BROM parameters and the boot address.
No functional changes.
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
drivers/gpu/nova-core/falcon.rs | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/nova-core/falcon.rs b/drivers/gpu/nova-core/falcon.rs
index fb4f1cad867e..28c37c82b8a2 100644
--- a/drivers/gpu/nova-core/falcon.rs
+++ b/drivers/gpu/nova-core/falcon.rs
@@ -515,10 +515,7 @@ pub(crate) fn pio_load<F: FalconFirmware<Target = E> + FalconPioLoadable>(
}
self.pio_wr_dmem_slice(fw.dmem_load_params())?;
- self.hal.program_brom(self, &fw.brom_params());
-
- self.pfalcon
- .write_reg(regs::NV_PFALCON_FALCON_BOOTVEC::zeroed().with_value(fw.boot_addr()));
+ self.program_brom_and_bootvec(&fw.brom_params(), fw.boot_addr());
Ok(())
}
@@ -676,15 +673,19 @@ fn dma_load<F: FalconFirmware<Target = E> + FalconDmaLoadable>(&self, fw: &F) ->
fw.dmem_load_params(),
)?;
- self.hal.program_brom(self, &fw.brom_params());
-
- // Set `BootVec` to start of non-secure code.
- self.pfalcon
- .write_reg(regs::NV_PFALCON_FALCON_BOOTVEC::zeroed().with_value(fw.boot_addr()));
+ self.program_brom_and_bootvec(&fw.brom_params(), fw.boot_addr());
Ok(())
}
+ /// Programs the BROM registers with `brom_params` and the `BOOTVEC` register with `boot_addr`.
+ fn program_brom_and_bootvec(&self, brom_params: &FalconBromParams, boot_addr: u32) {
+ self.hal.program_brom(self, brom_params);
+
+ self.pfalcon
+ .write_reg(regs::NV_PFALCON_FALCON_BOOTVEC::zeroed().with_value(boot_addr));
+ }
+
/// Wait until the falcon CPU is halted.
pub(crate) fn wait_till_halted(&self) -> Result<()> {
// TIMEOUT: arbitrarily large value, firmwares should complete in less than 2 seconds.
--
2.56.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 4/9] gpu: nova-core: gsp: factor out the core reset and the core resume
2026-11-20 4:46 [PATCH 0/9] gpu: nova-core: run falcon binaries for the r000 GSP-RM John Hubbard
` (2 preceding siblings ...)
2026-11-20 4:46 ` [PATCH 3/9] gpu: nova-core: falcon: factor out the BROM and BOOTVEC programming John Hubbard
@ 2026-11-20 4:46 ` John Hubbard
2026-11-20 4:49 ` sashiko-bot
2026-11-20 4:47 ` [PATCH 5/9] gpu: nova-core: gsp: fix resume_gsp_rm()'s error messages John Hubbard
` (4 subsequent siblings)
8 siblings, 1 reply; 19+ messages in thread
From: John Hubbard @ 2026-11-20 4:46 UTC (permalink / raw)
To: Danilo Krummrich, Alexandre Courbot
Cc: Timur Tabi, Alistair Popple, Eliot Courtney, Zhi Wang,
David Airlie, Simona Vetter, Bjorn Helgaas, Miguel Ojeda,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Daniel Almeida,
Tamir Duberstein, Onur Özkan, nova-gpu, dri-devel, LKML,
linux-pci, rust-for-linux, John Hubbard
The r000 boot protocol requires the driver to reset the GSP falcon
before running the binary of a load-and-execute event, and to resume
GSP-RM afterwards. The core reset and the core resume commands of the
CPU sequencer already do both.
In order to make the core reset and the core resume available outside
the sequencer, factor them out of it, into a module of their own.
No functional changes.
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
drivers/gpu/nova-core/gsp.rs | 1 +
drivers/gpu/nova-core/gsp/load_exec.rs | 78 ++++++++++++++++++++++++++
drivers/gpu/nova-core/gsp/sequencer.rs | 48 +++-------------
3 files changed, 88 insertions(+), 39 deletions(-)
create mode 100644 drivers/gpu/nova-core/gsp/load_exec.rs
diff --git a/drivers/gpu/nova-core/gsp.rs b/drivers/gpu/nova-core/gsp.rs
index 2f1cdf8b7bec..854062112cf1 100644
--- a/drivers/gpu/nova-core/gsp.rs
+++ b/drivers/gpu/nova-core/gsp.rs
@@ -20,6 +20,7 @@
pub(crate) mod cmdq;
pub(crate) mod commands;
mod fw;
+mod load_exec;
mod logbuffer;
mod nvkv;
mod regs;
diff --git a/drivers/gpu/nova-core/gsp/load_exec.rs b/drivers/gpu/nova-core/gsp/load_exec.rs
new file mode 100644
index 000000000000..ccbfcbfe3ce5
--- /dev/null
+++ b/drivers/gpu/nova-core/gsp/load_exec.rs
@@ -0,0 +1,78 @@
+// SPDX-License-Identifier: GPL-2.0
+// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
+//! The core reset and the core resume of the GSP falcon.
+
+use kernel::{
+ device,
+ dma::DmaAddress,
+ prelude::*,
+ time::Delta, //
+};
+
+use crate::falcon::{
+ gsp::Gsp,
+ sec2::Sec2,
+ Falcon, //
+};
+
+/// Resets the GSP falcon and its DMA-related registers.
+pub(super) fn reset_gsp_falcon(gsp_falcon: &Falcon<'_, Gsp>) -> Result {
+ gsp_falcon.reset()?;
+ gsp_falcon.dma_reset();
+ Ok(())
+}
+
+/// Resumes GSP-RM on the GSP falcon by starting the SEC2 falcon.
+///
+/// Resets the GSP falcon and writes `libos_dma_address` to its mailboxes before the start, and
+/// writes `bootloader_app_version` to its OS register once the resume has completed.
+///
+/// The SEC2 falcon must hold a loaded firmware that has not started.
+///
+/// # Errors
+///
+/// - `ETIMEDOUT` if the resume has not completed within two seconds.
+/// - `EIO` if `MAILBOX0` of the SEC2 falcon is not zero after the resume, or if the RISC-V core of
+/// the GSP falcon is not active.
+///
+/// Errors from the reset of the GSP falcon are propagated as-is.
+pub(super) fn resume_gsp_rm(
+ dev: &device::Device,
+ gsp_falcon: &Falcon<'_, Gsp>,
+ sec2_falcon: &Falcon<'_, Sec2>,
+ libos_dma_address: DmaAddress,
+ bootloader_app_version: u32,
+) -> Result {
+ // Reset the GSP to prepare it for resuming.
+ gsp_falcon.reset()?;
+
+ // Write the libOS DMA address to GSP mailboxes.
+ gsp_falcon.write_mailboxes(
+ Some(libos_dma_address as u32),
+ Some((libos_dma_address >> 32) as u32),
+ );
+
+ // Start the SEC2 falcon which will trigger GSP-RM to resume on the GSP.
+ sec2_falcon.start()?;
+
+ // Poll until GSP-RM reload/resume has completed (up to 2 seconds).
+ gsp_falcon.check_reload_completed(Delta::from_secs(2))?;
+
+ // Verify SEC2 completed successfully by checking its mailbox for errors.
+ let mbox0 = sec2_falcon.read_mailbox0();
+ if mbox0 != 0 {
+ dev_err!(dev, "Sequencer: sec2 errors: {:?}\n", mbox0);
+ return Err(EIO);
+ }
+
+ // Configure GSP with the bootloader version.
+ gsp_falcon.write_os_version(bootloader_app_version);
+
+ // Verify the GSP's RISC-V core is active indicating successful GSP boot.
+ if !gsp_falcon.is_riscv_active() {
+ dev_err!(dev, "Sequencer: RISC-V core is not active\n");
+ return Err(EIO);
+ }
+ Ok(())
+}
diff --git a/drivers/gpu/nova-core/gsp/sequencer.rs b/drivers/gpu/nova-core/gsp/sequencer.rs
index 23b09fb875e9..913989cd7615 100644
--- a/drivers/gpu/nova-core/gsp/sequencer.rs
+++ b/drivers/gpu/nova-core/gsp/sequencer.rs
@@ -32,6 +32,7 @@
Cmdq, //
},
fw,
+ load_exec,
GspBootContext,
LibosMemoryRegionInitArgument, //
},
@@ -213,11 +214,7 @@ fn run(&self, seq: &GspSequencer<'_>) -> Result {
GspSeqCmd::RegPoll(cmd) => cmd.run(seq),
GspSeqCmd::DelayUs(cmd) => cmd.run(seq),
GspSeqCmd::RegStore(cmd) => cmd.run(seq),
- GspSeqCmd::CoreReset => {
- seq.gsp_falcon.reset()?;
- seq.gsp_falcon.dma_reset();
- Ok(())
- }
+ GspSeqCmd::CoreReset => load_exec::reset_gsp_falcon(seq.gsp_falcon),
GspSeqCmd::CoreStart => {
seq.gsp_falcon.start()?;
Ok(())
@@ -230,40 +227,13 @@ fn run(&self, seq: &GspSequencer<'_>) -> Result {
// At this point, 'SEC2-RTOS' has been loaded into SEC2 by the sequencer
// but neither SEC2-RTOS nor GSP-RM is running yet. This part of the
// sequencer will start both.
-
- // Reset the GSP to prepare it for resuming.
- seq.gsp_falcon.reset()?;
-
- let libos_dma_address = seq.libos.dma_address();
-
- // Write the libOS DMA address to GSP mailboxes.
- seq.gsp_falcon.write_mailboxes(
- Some(libos_dma_address as u32),
- Some((libos_dma_address >> 32) as u32),
- );
-
- // Start the SEC2 falcon which will trigger GSP-RM to resume on the GSP.
- seq.sec2_falcon.start()?;
-
- // Poll until GSP-RM reload/resume has completed (up to 2 seconds).
- seq.gsp_falcon.check_reload_completed(Delta::from_secs(2))?;
-
- // Verify SEC2 completed successfully by checking its mailbox for errors.
- let mbox0 = seq.sec2_falcon.read_mailbox0();
- if mbox0 != 0 {
- dev_err!(seq.dev, "Sequencer: sec2 errors: {:?}\n", mbox0);
- return Err(EIO);
- }
-
- // Configure GSP with the bootloader version.
- seq.gsp_falcon.write_os_version(seq.bootloader_app_version);
-
- // Verify the GSP's RISC-V core is active indicating successful GSP boot.
- if !seq.gsp_falcon.is_riscv_active() {
- dev_err!(seq.dev, "Sequencer: RISC-V core is not active\n");
- return Err(EIO);
- }
- Ok(())
+ load_exec::resume_gsp_rm(
+ seq.dev,
+ seq.gsp_falcon,
+ seq.sec2_falcon,
+ seq.libos.dma_address(),
+ seq.bootloader_app_version,
+ )
}
}
}
--
2.56.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 5/9] gpu: nova-core: gsp: fix resume_gsp_rm()'s error messages
2026-11-20 4:46 [PATCH 0/9] gpu: nova-core: run falcon binaries for the r000 GSP-RM John Hubbard
` (3 preceding siblings ...)
2026-11-20 4:46 ` [PATCH 4/9] gpu: nova-core: gsp: factor out the core reset and the core resume John Hubbard
@ 2026-11-20 4:47 ` John Hubbard
2026-11-20 4:49 ` sashiko-bot
2026-11-20 4:47 ` [PATCH 6/9] gpu: nova-core: falcon: select the BAR2 engine ID for framebuffer DMA John Hubbard
` (3 subsequent siblings)
8 siblings, 1 reply; 19+ messages in thread
From: John Hubbard @ 2026-11-20 4:47 UTC (permalink / raw)
To: Danilo Krummrich, Alexandre Courbot
Cc: Timur Tabi, Alistair Popple, Eliot Courtney, Zhi Wang,
David Airlie, Simona Vetter, Bjorn Helgaas, Miguel Ojeda,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Daniel Almeida,
Tamir Duberstein, Onur Özkan, nova-gpu, dri-devel, LKML,
linux-pci, rust-for-linux, John Hubbard
resume_gsp_rm()'s error messages have two problems:
* Both messages open with "Sequencer:", which assumes that the function
knows which code is calling it, and that that will never change. This
kind of tight coupling is almost never desirable in well-structured
code.
* One message prints the SEC2 mailbox value in decimal. That needlessly
complicates looking up the error code, given that Open RM documents
those values in hex.
Remove the sequencer's name from both messages and name the GSP-RM
resume instead, and print the SEC2 mailbox value in hexadecimal.
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
drivers/gpu/nova-core/gsp/load_exec.rs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/nova-core/gsp/load_exec.rs b/drivers/gpu/nova-core/gsp/load_exec.rs
index ccbfcbfe3ce5..bf465ac1151f 100644
--- a/drivers/gpu/nova-core/gsp/load_exec.rs
+++ b/drivers/gpu/nova-core/gsp/load_exec.rs
@@ -62,7 +62,11 @@ pub(super) fn resume_gsp_rm(
// Verify SEC2 completed successfully by checking its mailbox for errors.
let mbox0 = sec2_falcon.read_mailbox0();
if mbox0 != 0 {
- dev_err!(dev, "Sequencer: sec2 errors: {:?}\n", mbox0);
+ dev_err!(
+ dev,
+ "SEC2 reported an error while resuming GSP-RM: {:#x}\n",
+ mbox0
+ );
return Err(EIO);
}
@@ -71,7 +75,7 @@ pub(super) fn resume_gsp_rm(
// Verify the GSP's RISC-V core is active indicating successful GSP boot.
if !gsp_falcon.is_riscv_active() {
- dev_err!(dev, "Sequencer: RISC-V core is not active\n");
+ dev_err!(dev, "GSP RISC-V core is not active after resuming GSP-RM\n");
return Err(EIO);
}
Ok(())
--
2.56.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 6/9] gpu: nova-core: falcon: select the BAR2 engine ID for framebuffer DMA
2026-11-20 4:46 [PATCH 0/9] gpu: nova-core: run falcon binaries for the r000 GSP-RM John Hubbard
` (4 preceding siblings ...)
2026-11-20 4:47 ` [PATCH 5/9] gpu: nova-core: gsp: fix resume_gsp_rm()'s error messages John Hubbard
@ 2026-11-20 4:47 ` John Hubbard
2026-11-20 4:53 ` sashiko-bot
2026-11-20 4:47 ` [PATCH 7/9] gpu: nova-core: gsp: add the r000 load-and-execute HS binary handler John Hubbard
` (2 subsequent siblings)
8 siblings, 1 reply; 19+ messages in thread
From: John Hubbard @ 2026-11-20 4:47 UTC (permalink / raw)
To: Danilo Krummrich, Alexandre Courbot
Cc: Timur Tabi, Alistair Popple, Eliot Courtney, Zhi Wang,
David Airlie, Simona Vetter, Bjorn Helgaas, Miguel Ojeda,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Daniel Almeida,
Tamir Duberstein, Onur Özkan, nova-gpu, dri-devel, LKML,
linux-pci, rust-for-linux, John Hubbard
When Open RM loads a binary from the framebuffer into a falcon by DMA,
it selects BAR2 as the MMU engine ID of the transfer, in the falcon's
FBIF_TRANSCFG register. Nova-core's definition of the register has no
field for the engine ID, so the DMA transfer code has no way to select
one.
Add the field, and select the BAR2 engine ID for a DMA transfer whose
source is the framebuffer.
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
drivers/gpu/nova-core/falcon.rs | 24 ++++++++++++++++++++++--
drivers/gpu/nova-core/regs.rs | 2 ++
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/nova-core/falcon.rs b/drivers/gpu/nova-core/falcon.rs
index 28c37c82b8a2..75954856ad7c 100644
--- a/drivers/gpu/nova-core/falcon.rs
+++ b/drivers/gpu/nova-core/falcon.rs
@@ -175,6 +175,18 @@ pub(crate) enum FalconFbifMemType with From<Bounded<u32, 1>> {
}
}
+bounded_enum! {
+ /// MMU engine ID under which the falcon's FBIF issues a DMA transfer. A kernel driver should
+ /// select `Bar2Fn0`. (Only GPU firmware selects `Own`.)
+ #[derive(Debug, Copy, Clone)]
+ pub(crate) enum FalconFbifEngineIdFlag with From<Bounded<u32, 1>> {
+ /// The engine ID of PCI function 0's BAR2.
+ Bar2Fn0 = 0,
+ /// The falcon's own engine ID.
+ Own = 1,
+ }
+}
+
const PFALCON_REGION_SIZE: usize = SZ_4K;
const PFALCON2_REGION_SIZE: usize = SZ_4K;
@@ -607,8 +619,16 @@ fn dma_wr(
self.pfalcon
.update(regs::NV_PFALCON_FBIF_TRANSCFG::at(0), |v| {
- v.with_target(fbif_target)
- .with_mem_type(FalconFbifMemType::Physical)
+ let v = v
+ .with_target(fbif_target)
+ .with_mem_type(FalconFbifMemType::Physical);
+
+ match src {
+ FalconDmaSource::Sysmem(_) => v,
+ FalconDmaSource::Framebuffer { .. } => {
+ v.with_engine_id_flag(FalconFbifEngineIdFlag::Bar2Fn0)
+ }
+ }
});
for pos in (0..num_transfers).map(|i| i * DMA_LEN) {
diff --git a/drivers/gpu/nova-core/regs.rs b/drivers/gpu/nova-core/regs.rs
index dfe7944cf1e7..050054a2b23d 100644
--- a/drivers/gpu/nova-core/regs.rs
+++ b/drivers/gpu/nova-core/regs.rs
@@ -18,6 +18,7 @@
DmaTrfCmdSize,
FalconCoreRev,
FalconCoreRevSubversion,
+ FalconFbifEngineIdFlag,
FalconFbifMemType,
FalconFbifTarget,
FalconMem,
@@ -291,6 +292,7 @@ pub(crate) fn usable_fb_size(self) -> u64 {
}
pub(crate) NV_PFALCON_FBIF_TRANSCFG(u32)[8] @ 0x00000600 {
+ 16:16 engine_id_flag => FalconFbifEngineIdFlag;
2:2 mem_type => FalconFbifMemType;
1:0 target ?=> FalconFbifTarget;
}
--
2.56.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 7/9] gpu: nova-core: gsp: add the r000 load-and-execute HS binary handler
2026-11-20 4:46 [PATCH 0/9] gpu: nova-core: run falcon binaries for the r000 GSP-RM John Hubbard
` (5 preceding siblings ...)
2026-11-20 4:47 ` [PATCH 6/9] gpu: nova-core: falcon: select the BAR2 engine ID for framebuffer DMA John Hubbard
@ 2026-11-20 4:47 ` John Hubbard
2026-11-20 4:53 ` sashiko-bot
2026-11-20 4:47 ` [PATCH 8/9] gpu: nova-core: gsp: add the r000 load-and-execute bootloader handler John Hubbard
2026-11-20 4:47 ` [PATCH 9/9] gpu: nova-core: gsp: add the load-and-execute event dispatcher John Hubbard
8 siblings, 1 reply; 19+ messages in thread
From: John Hubbard @ 2026-11-20 4:47 UTC (permalink / raw)
To: Danilo Krummrich, Alexandre Courbot
Cc: Timur Tabi, Alistair Popple, Eliot Courtney, Zhi Wang,
David Airlie, Simona Vetter, Bjorn Helgaas, Miguel Ojeda,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Daniel Almeida,
Tamir Duberstein, Onur Özkan, nova-gpu, dri-devel, LKML,
linux-pci, rust-for-linux, John Hubbard
The GSP falcon is a microcontroller with two cores, a falcon core and a
RISC-V core, and only one of the two is active at a time. GSP-RM runs on
the RISC-V core.
On GA102 and later, the r000 GSP-RM requires a Heavy-Secured (HS) binary
to run on the falcon core during boot. GSP-RM is suspended while the
binary runs.
The driver runs the binary on behalf of GSP-RM, in the following steps:
1. GSP-RM places the binary in the framebuffer.
2. GSP-RM raises a load-and-execute event.
3. GSP-RM suspends the RISC-V core.
4. The driver waits until the RISC-V core is suspended.
5. The driver resets the GSP falcon, which selects the falcon core.
6. The driver loads the binary from the framebuffer into the GSP falcon.
7. The driver starts the binary and waits for the falcon core to halt.
8. The driver resumes GSP-RM on the RISC-V core.
Nova-core has no handler for the load-and-execute event.
Add the handler, which performs steps 4 through 8.
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/falcon.rs | 5 +-
drivers/gpu/nova-core/gsp/load_exec.rs | 203 ++++++++++++++++++++++++-
drivers/gpu/nova-core/sbuffer.rs | 1 -
3 files changed, 199 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/nova-core/falcon.rs b/drivers/gpu/nova-core/falcon.rs
index 75954856ad7c..459a0a88146a 100644
--- a/drivers/gpu/nova-core/falcon.rs
+++ b/drivers/gpu/nova-core/falcon.rs
@@ -145,7 +145,6 @@ pub(crate) enum FalconDmaSource<'a> {
/// A DMA object in system memory.
Sysmem(&'a Coherent<'a, [u8]>),
/// GPU framebuffer memory at physical address `base`.
- #[expect(dead_code)]
Framebuffer { base: u64 },
}
@@ -563,7 +562,7 @@ pub(crate) fn with_fbif_transcfg<R>(
}
/// Perform a DMA write according to `load_offsets` from `src` into the falcon's `target_mem`.
- fn dma_wr(
+ pub(crate) fn dma_wr(
&self,
src: FalconDmaSource<'_>,
target_mem: FalconMem,
@@ -699,7 +698,7 @@ fn dma_load<F: FalconFirmware<Target = E> + FalconDmaLoadable>(&self, fw: &F) ->
}
/// Programs the BROM registers with `brom_params` and the `BOOTVEC` register with `boot_addr`.
- fn program_brom_and_bootvec(&self, brom_params: &FalconBromParams, boot_addr: u32) {
+ pub(crate) fn program_brom_and_bootvec(&self, brom_params: &FalconBromParams, boot_addr: u32) {
self.hal.program_brom(self, brom_params);
self.pfalcon
diff --git a/drivers/gpu/nova-core/gsp/load_exec.rs b/drivers/gpu/nova-core/gsp/load_exec.rs
index bf465ac1151f..d9a4ccd88289 100644
--- a/drivers/gpu/nova-core/gsp/load_exec.rs
+++ b/drivers/gpu/nova-core/gsp/load_exec.rs
@@ -1,21 +1,50 @@
// SPDX-License-Identifier: GPL-2.0
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
-//! The core reset and the core resume of the GSP falcon.
+//! The load-and-execute events of the GSP boot.
+//!
+//! See `Documentation/gpu/nova/core/falcon.rst`:
+//!
+//! - "Falcon security levels" describes the Heavy-Secured (HS) mode of a falcon and the boot ROM
+//! that verifies an HS binary. The note in "Root of trust establishment" says why the GSP falcon
+//! stops running GSP-RM, runs an HS binary, and then resumes GSP-RM.
+//! - "Falcon memory subsystem and DMA engine" describes the instruction memory (IMEM) and the data
+//! memory (DMEM) of a falcon, and the DMA engine that loads a binary into them.
+
+use core::array;
use kernel::{
device,
dma::DmaAddress,
prelude::*,
- time::Delta, //
+ time::Delta,
+ transmute::FromBytes, //
};
-use crate::falcon::{
- gsp::Gsp,
- sec2::Sec2,
- Falcon, //
+use crate::{
+ falcon::{
+ gsp::Gsp,
+ sec2::Sec2,
+ Falcon,
+ FalconBromParams,
+ FalconDmaLoadTarget,
+ FalconDmaSource,
+ FalconMem, //
+ },
+ gsp::{
+ cmdq::gmc::MessageFromGsp,
+ GspBootContext, //
+ },
+ sbuffer::SBufferIter, //
};
+/// DMEM virtual address value that means "no virtual address assigned".
+const FLCN_DMEM_VA_INVALID: u32 = 0xffff_ffff;
+
+/// `MAILBOX0` value that means that a falcon binary has not started. A binary that reports its
+/// status through `MAILBOX0` replaces it.
+const FLCN_ERR_BINARY_NOT_STARTED: u32 = 0xfe;
+
/// Resets the GSP falcon and its DMA-related registers.
pub(super) fn reset_gsp_falcon(gsp_falcon: &Falcon<'_, Gsp>) -> Result {
gsp_falcon.reset()?;
@@ -80,3 +109,165 @@ pub(super) fn resume_gsp_rm(
}
Ok(())
}
+
+/// Waits until GSP-RM has suspended the RISC-V core, and then resets the GSP falcon.
+fn reset_gsp_falcon_after_suspend(dev: &device::Device, gsp_falcon: &Falcon<'_, Gsp>) -> Result {
+ gsp_falcon.wait_for_processor_suspend().inspect_err(|_| {
+ dev_err!(
+ dev,
+ "Timeout waiting for GSP-RM (RISC-V core) to suspend (mbox0={:#x})\n",
+ gsp_falcon.read_mailbox0()
+ );
+ })?;
+
+ reset_gsp_falcon(gsp_falcon)
+}
+
+/// Runs the Heavy-Secured (HS) binary of a `GMCAPI_CMD_EXEC_HS_BINARY` event on the falcon core of
+/// the GSP falcon, and then resumes GSP-RM.
+///
+/// `params` describes the binary. The handler:
+///
+/// 1. Waits until GSP-RM has suspended the RISC-V core, for up to five seconds.
+/// 2. Resets the GSP falcon, which selects the falcon core.
+/// 3. Loads the code segment into IMEM and the data segment into DMEM, by DMA from the
+/// framebuffer.
+/// 4. Programs the boot ROM parameters and the boot vector, and writes
+/// [`FLCN_ERR_BINARY_NOT_STARTED`] to `MAILBOX0`.
+/// 5. Starts the falcon core, and waits until the falcon core halts, for up to two seconds. The
+/// binary halts the falcon core when it is done, so the handler learns from the halt that the
+/// binary has finished.
+/// 6. Logs an error if `MAILBOX0` still holds [`FLCN_ERR_BINARY_NOT_STARTED`], which means that
+/// the binary did not start.
+/// 7. Resumes GSP-RM on the RISC-V core, via [`resume_gsp_rm`].
+///
+/// A binary that reports a status writes the status to `MAILBOX0` before it halts. The handler
+/// does not check that status, so the result does not depend on it.
+///
+/// # Errors
+///
+/// - `EINVAL` if the engine ID mask or the ucode ID of `params` does not fit its
+/// [`FalconBromParams`] field.
+/// - `ETIMEDOUT` if GSP-RM has not suspended the RISC-V core within five seconds, or if the
+/// falcon core has not halted within two seconds of its start.
+///
+/// Errors from the reset of the GSP falcon, the DMA transfers and the resume of GSP-RM are
+/// propagated as-is.
+#[expect(dead_code)]
+fn handle_hs_binary(
+ ctx: &GspBootContext<'_, '_>,
+ libos_dma_address: DmaAddress,
+ bootloader_app_version: u32,
+ params: &HsBinaryParams,
+) -> Result {
+ let dev = ctx.dev();
+ let gsp_falcon = ctx.gsp_falcon;
+ let brom_params = FalconBromParams {
+ pkc_data_offset: params.hs_sig_dmem_addr,
+ engine_id_mask: u16::try_from(params.engine_id_mask).map_err(|_| EINVAL)?,
+ ucode_id: u8::try_from(params.ucode_id).map_err(|_| EINVAL)?,
+ };
+
+ reset_gsp_falcon_after_suspend(dev, gsp_falcon)?;
+
+ gsp_falcon.dma_wr(
+ FalconDmaSource::Framebuffer {
+ base: params.imem_dma_base,
+ },
+ FalconMem::ImemSecure,
+ FalconDmaLoadTarget {
+ src_start: params.imem_va,
+ dst_start: params.imem_pa,
+ len: params.imem_size,
+ },
+ )?;
+
+ // A data segment with a virtual address is tagged with it. One without starts at the DMA base.
+ let tag_dmem = params.dmem_va != FLCN_DMEM_VA_INVALID;
+
+ gsp_falcon.dma_wr(
+ FalconDmaSource::Framebuffer {
+ base: params.dmem_dma_base,
+ },
+ FalconMem::Dmem { tag: tag_dmem },
+ FalconDmaLoadTarget {
+ src_start: if tag_dmem { params.dmem_va } else { 0 },
+ dst_start: params.dmem_pa,
+ len: params.dmem_size,
+ },
+ )?;
+
+ gsp_falcon.program_brom_and_bootvec(&brom_params, params.imem_va);
+
+ let (mbox0, _) = gsp_falcon
+ .boot(Some(FLCN_ERR_BINARY_NOT_STARTED), None)
+ .inspect_err(|_| {
+ dev_err!(
+ dev,
+ "Timeout waiting for HS binary to halt (mbox0={:#x})\n",
+ gsp_falcon.read_mailbox0()
+ );
+ })?;
+ if mbox0 == FLCN_ERR_BINARY_NOT_STARTED {
+ dev_err!(dev, "HS binary did not start\n");
+ } else {
+ dev_dbg!(dev, "HS binary halted with mbox0={:#x}\n", mbox0);
+ }
+
+ resume_gsp_rm(
+ dev,
+ gsp_falcon,
+ ctx.sec2_falcon,
+ libos_dma_address,
+ bootloader_app_version,
+ )
+}
+
+/// Payload of a `GMCAPI_CMD_EXEC_HS_BINARY` event, which describes the HS binary to run.
+#[repr(C)]
+struct HsBinaryParams {
+ /// DMA base of the code segment, a physical address in the framebuffer. The code segment starts
+ /// at `imem_dma_base + imem_va`.
+ imem_dma_base: u64,
+ /// DMA base of the data segment, a physical address in the framebuffer. The data segment starts
+ /// at `dmem_dma_base + dmem_va`, or at `dmem_dma_base` when the data segment has no virtual
+ /// address.
+ dmem_dma_base: u64,
+ _reserved64: [u64; 2],
+ /// Virtual address of the code segment. The binary starts executing at this address.
+ imem_va: u32,
+ /// Physical address in IMEM at which the code segment is loaded.
+ imem_pa: u32,
+ /// Size in bytes of the code segment.
+ imem_size: u32,
+ /// Virtual address of the data segment, or [`FLCN_DMEM_VA_INVALID`] if the data segment has
+ /// no virtual address. The DMA transfer writes no tags in that case.
+ dmem_va: u32,
+ /// Physical address in DMEM at which the data segment is loaded.
+ dmem_pa: u32,
+ /// Size in bytes of the data segment.
+ dmem_size: u32,
+ /// Physical address in DMEM of the signature of the binary.
+ hs_sig_dmem_addr: u32,
+ /// Mask of the falcon engines on which the binary can run, with one bit per engine.
+ engine_id_mask: u32,
+ /// ID number of the binary. Each ID has a fuse register that holds a version number. The boot
+ /// ROM uses the ID and that version number as inputs of the signature verification.
+ ucode_id: u32,
+ _reserved32: [u32; 3],
+}
+
+// SAFETY: This struct only contains integer types for which all bit patterns are valid.
+unsafe impl FromBytes for HsBinaryParams {}
+
+impl MessageFromGsp for HsBinaryParams {
+ type InitError = Error;
+
+ fn read(payload: &mut SBufferIter<array::IntoIter<&[u8], 2>>) -> Result<Self> {
+ let mut bytes = [0u8; size_of::<Self>()];
+
+ payload.read_exact(&mut bytes)?;
+
+ Self::from_bytes_copy(&bytes).ok_or(EINVAL)
+ }
+}
diff --git a/drivers/gpu/nova-core/sbuffer.rs b/drivers/gpu/nova-core/sbuffer.rs
index 3a41d224c77a..b8c01104c255 100644
--- a/drivers/gpu/nova-core/sbuffer.rs
+++ b/drivers/gpu/nova-core/sbuffer.rs
@@ -146,7 +146,6 @@ fn get_slice(&mut self, len: usize) -> Option<&'a [u8]> {
/// Ideally we would implement `Read`, but it is not available in `core`.
/// So mimic `std::io::Read::read_exact`.
- #[expect(unused)]
pub(crate) fn read_exact(&mut self, mut dst: &mut [u8]) -> Result {
while !dst.is_empty() {
match self.get_slice(dst.len()) {
--
2.56.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 8/9] gpu: nova-core: gsp: add the r000 load-and-execute bootloader handler
2026-11-20 4:46 [PATCH 0/9] gpu: nova-core: run falcon binaries for the r000 GSP-RM John Hubbard
` (6 preceding siblings ...)
2026-11-20 4:47 ` [PATCH 7/9] gpu: nova-core: gsp: add the r000 load-and-execute HS binary handler John Hubbard
@ 2026-11-20 4:47 ` John Hubbard
2026-11-20 4:52 ` sashiko-bot
2026-11-20 4:47 ` [PATCH 9/9] gpu: nova-core: gsp: add the load-and-execute event dispatcher John Hubbard
8 siblings, 1 reply; 19+ messages in thread
From: John Hubbard @ 2026-11-20 4:47 UTC (permalink / raw)
To: Danilo Krummrich, Alexandre Courbot
Cc: Timur Tabi, Alistair Popple, Eliot Courtney, Zhi Wang,
David Airlie, Simona Vetter, Bjorn Helgaas, Miguel Ojeda,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Daniel Almeida,
Tamir Duberstein, Onur Özkan, nova-gpu, dri-devel, LKML,
linux-pci, rust-for-linux, John Hubbard
On Turing and GA100, the r000 GSP-RM requires an image to run on the
falcon core during boot, through the generic falcon bootloader. GSP-RM
is suspended while the image runs.
The driver runs the image on behalf of GSP-RM, in the following steps:
1. GSP-RM raises a load-and-execute event, which carries a descriptor of
the image.
2. GSP-RM suspends the RISC-V core.
3. The driver waits until the RISC-V core is suspended.
4. The driver resets the GSP falcon, which selects the falcon core.
5. The driver loads the bootloader and the descriptor into the GSP
falcon.
6. The driver starts the bootloader, which loads the image and starts
it.
7. The driver waits for the falcon core to halt.
8. The driver resumes GSP-RM on the RISC-V core.
Nova-core has no handler for the bootloader's load-and-execute event.
Add the handler, which performs steps 3 through 8.
Co-developed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
.../gpu/nova-core/firmware/gen_bootloader.rs | 8 +-
drivers/gpu/nova-core/gsp/load_exec.rs | 164 +++++++++++++++++-
2 files changed, 170 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/nova-core/firmware/gen_bootloader.rs b/drivers/gpu/nova-core/firmware/gen_bootloader.rs
index 751335c97e35..8d8c94cc19ee 100644
--- a/drivers/gpu/nova-core/firmware/gen_bootloader.rs
+++ b/drivers/gpu/nova-core/firmware/gen_bootloader.rs
@@ -13,7 +13,10 @@
},
prelude::*,
ptr::Alignable,
- transmute::AsBytes, //
+ transmute::{
+ AsBytes,
+ FromBytes, //
+ },
};
use crate::{
@@ -123,6 +126,9 @@ pub(crate) fn new(
// SAFETY: This struct doesn't contain uninitialized bytes and doesn't have interior mutability.
unsafe impl AsBytes for BootloaderDmemDescV2 {}
+// SAFETY: This struct only contains integer types for which all bit patterns are valid.
+unsafe impl FromBytes for BootloaderDmemDescV2 {}
+
/// The generic falcon bootloader image and its IMEM load parameters.
pub(crate) struct GenericBootloader {
/// Bootloader code, zero-padded to a whole number of falcon memory blocks.
diff --git a/drivers/gpu/nova-core/gsp/load_exec.rs b/drivers/gpu/nova-core/gsp/load_exec.rs
index d9a4ccd88289..ab0c2959d3e8 100644
--- a/drivers/gpu/nova-core/gsp/load_exec.rs
+++ b/drivers/gpu/nova-core/gsp/load_exec.rs
@@ -9,7 +9,8 @@
//! that verifies an HS binary. The note in "Root of trust establishment" says why the GSP falcon
//! stops running GSP-RM, runs an HS binary, and then resumes GSP-RM.
//! - "Falcon memory subsystem and DMA engine" describes the instruction memory (IMEM) and the data
-//! memory (DMEM) of a falcon, and the DMA engine that loads a binary into them.
+//! memory (DMEM) of a falcon, and the DMA engine that loads a binary into them. The DMA engine
+//! accesses the framebuffer or system memory through the FBIF (Framebuffer Interface).
use core::array;
@@ -29,8 +30,13 @@
FalconBromParams,
FalconDmaLoadTarget,
FalconDmaSource,
+ FalconFbifTarget,
FalconMem, //
},
+ firmware::gen_bootloader::{
+ BootloaderDmemDescV2,
+ GenericBootloader, //
+ },
gsp::{
cmdq::gmc::MessageFromGsp,
GspBootContext, //
@@ -223,6 +229,106 @@ fn handle_hs_binary(
)
}
+/// Runs the image of a `GMCAPI_CMD_EXEC_GENERIC_BOOTLOADER` event on the falcon core of the GSP
+/// falcon, through the generic falcon bootloader, and then resumes GSP-RM.
+///
+/// `params` holds the descriptor of the image. The generic falcon bootloader loads and starts the
+/// image that the descriptor names, per [`GenericBootloader::run`]. The handler:
+///
+/// 1. Checks that the descriptor in `params` has the size of [`BootloaderDmemDescV2`], and gets
+/// the FBIF (Framebuffer Interface) target that `params` selects.
+/// 2. Waits until GSP-RM has suspended the RISC-V core, for up to five seconds.
+/// 3. Resets the GSP falcon, which selects the falcon core.
+/// 4. Runs `bootloader` with the descriptor and with [`FLCN_ERR_BINARY_NOT_STARTED`] in
+/// `MAILBOX0`, and waits until the falcon core halts, for up to two seconds. The image halts
+/// the falcon core when it is done, so the handler learns from the halt that the image has
+/// finished.
+/// 5. Logs an error if `MAILBOX0` still holds [`FLCN_ERR_BINARY_NOT_STARTED`], which means that
+/// the image did not start.
+/// 6. Resumes GSP-RM on the RISC-V core, via [`resume_gsp_rm`].
+///
+/// An image that reports a status writes the status to `MAILBOX0` before it halts. The handler
+/// does not check that status, so the result does not depend on it.
+///
+/// # Errors
+///
+/// - `EINVAL` if `bootloader` is `None`, if the descriptor size in `params` is not the size of
+/// [`BootloaderDmemDescV2`], or if the address space and the cache attribute in `params` select
+/// no FBIF target.
+/// - `ETIMEDOUT` if GSP-RM has not suspended the RISC-V core within five seconds, or if the
+/// falcon core has not halted within two seconds of its start.
+///
+/// Errors from the reset of the GSP falcon, the run of the bootloader and the resume of GSP-RM
+/// are propagated as-is.
+#[expect(dead_code)]
+fn handle_generic_bootloader(
+ ctx: &GspBootContext<'_, '_>,
+ bootloader: Option<&GenericBootloader>,
+ libos_dma_address: DmaAddress,
+ bootloader_app_version: u32,
+ params: &GenericBootloaderParams,
+) -> Result {
+ /// Expected size of the descriptor, in bytes.
+ const DMEM_DESC_SIZE: u32 = cv!(size_of::<BootloaderDmemDescV2>());
+
+ let dev = ctx.dev();
+ let gsp_falcon = ctx.gsp_falcon;
+ let Some(bootloader) = bootloader else {
+ dev_err!(
+ dev,
+ "No generic bootloader for the load-and-execute event\n"
+ );
+ return Err(EINVAL);
+ };
+
+ if params.dmem_desc_size != DMEM_DESC_SIZE {
+ dev_err!(
+ dev,
+ "Generic bootloader descriptor is {} bytes, expected {}\n",
+ params.dmem_desc_size,
+ DMEM_DESC_SIZE
+ );
+ return Err(EINVAL);
+ }
+
+ let fbif_target = params.fbif_target()?;
+
+ reset_gsp_falcon_after_suspend(dev, gsp_falcon)?;
+
+ let (mbox0, _) = bootloader
+ .run(
+ gsp_falcon,
+ ¶ms.dmem_desc,
+ fbif_target,
+ FLCN_ERR_BINARY_NOT_STARTED,
+ )
+ .inspect_err(|e| {
+ dev_err!(
+ dev,
+ "Failed to run the generic bootloader: {:?} (mbox0={:#x})\n",
+ e,
+ gsp_falcon.read_mailbox0()
+ );
+ })?;
+ if mbox0 == FLCN_ERR_BINARY_NOT_STARTED {
+ dev_err!(dev, "Image of the generic bootloader did not start\n");
+ } else {
+ dev_dbg!(
+ dev,
+ "Image of the generic bootloader halted with mbox0={:#x}\n",
+ mbox0
+ );
+ }
+
+ resume_gsp_rm(
+ dev,
+ gsp_falcon,
+ ctx.sec2_falcon,
+ libos_dma_address,
+ bootloader_app_version,
+ )
+}
+
/// Payload of a `GMCAPI_CMD_EXEC_HS_BINARY` event, which describes the HS binary to run.
#[repr(C)]
struct HsBinaryParams {
@@ -271,3 +377,59 @@ fn read(payload: &mut SBufferIter<array::IntoIter<&[u8], 2>>) -> Result<Self> {
Self::from_bytes_copy(&bytes).ok_or(EINVAL)
}
}
+
+/// Payload of a `GMCAPI_CMD_EXEC_GENERIC_BOOTLOADER` event, which describes the image for the
+/// generic falcon bootloader to run.
+#[repr(C)]
+struct GenericBootloaderParams {
+ /// Descriptor of the image, which the bootloader reads from DMEM.
+ dmem_desc: BootloaderDmemDescV2,
+ /// Size in bytes of the descriptor, as GSP-RM defines it.
+ dmem_desc_size: u32,
+ /// Address space of the image: [`Self::ADDR_SYSMEM`] for system memory, or
+ /// [`Self::ADDR_FBMEM`] for the framebuffer.
+ addr_space: u32,
+ /// CPU cache attribute of an image in system memory: [`Self::NV_MEMORY_CACHED`] or
+ /// [`Self::NV_MEMORY_UNCACHED`].
+ cpu_cache_attrib: u32,
+ _reserved: [u32; 4],
+}
+
+impl GenericBootloaderParams {
+ const ADDR_SYSMEM: u32 = 1;
+ const ADDR_FBMEM: u32 = 2;
+ const NV_MEMORY_CACHED: u32 = 0;
+ const NV_MEMORY_UNCACHED: u32 = 1;
+
+ /// Returns the FBIF target that `addr_space` and `cpu_cache_attrib` select.
+ ///
+ /// # Errors
+ ///
+ /// - `EINVAL` if the pair selects no FBIF target.
+ fn fbif_target(&self) -> Result<FalconFbifTarget> {
+ match (self.addr_space, self.cpu_cache_attrib) {
+ (Self::ADDR_FBMEM, _) => Ok(FalconFbifTarget::LocalFb),
+ (Self::ADDR_SYSMEM, Self::NV_MEMORY_CACHED) => Ok(FalconFbifTarget::CoherentSysmem),
+ (Self::ADDR_SYSMEM, Self::NV_MEMORY_UNCACHED) => {
+ Ok(FalconFbifTarget::NoncoherentSysmem)
+ }
+ _ => Err(EINVAL),
+ }
+ }
+}
+
+// SAFETY: The nested descriptor is `FromBytes`, and every other field is an integer type for
+// which all bit patterns are valid.
+unsafe impl FromBytes for GenericBootloaderParams {}
+
+impl MessageFromGsp for GenericBootloaderParams {
+ type InitError = Error;
+
+ fn read(payload: &mut SBufferIter<array::IntoIter<&[u8], 2>>) -> Result<Self> {
+ let mut bytes = [0u8; size_of::<Self>()];
+
+ payload.read_exact(&mut bytes)?;
+
+ Self::from_bytes_copy(&bytes).ok_or(EINVAL)
+ }
+}
--
2.56.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 9/9] gpu: nova-core: gsp: add the load-and-execute event dispatcher
2026-11-20 4:46 [PATCH 0/9] gpu: nova-core: run falcon binaries for the r000 GSP-RM John Hubbard
` (7 preceding siblings ...)
2026-11-20 4:47 ` [PATCH 8/9] gpu: nova-core: gsp: add the r000 load-and-execute bootloader handler John Hubbard
@ 2026-11-20 4:47 ` John Hubbard
2026-11-20 4:51 ` sashiko-bot
8 siblings, 1 reply; 19+ messages in thread
From: John Hubbard @ 2026-11-20 4:47 UTC (permalink / raw)
To: Danilo Krummrich, Alexandre Courbot
Cc: Timur Tabi, Alistair Popple, Eliot Courtney, Zhi Wang,
David Airlie, Simona Vetter, Bjorn Helgaas, Miguel Ojeda,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Daniel Almeida,
Tamir Duberstein, Onur Özkan, nova-gpu, dri-devel, LKML,
linux-pci, rust-for-linux, John Hubbard
The two load-and-execute events of the r000 boot protocol arrive as GMC
events, and the command ID of a GMC event names its kind. Nova-core has
a handler for each of the two events, and no code that selects the
handler from the command ID.
Add a dispatcher that selects the handler from the command ID of a GMC
event, decodes the payload of the event into the parameters of that
handler, and rejects an event with any other command ID.
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/gsp/load_exec.rs | 64 ++++++++++++++++++++++++--
1 file changed, 61 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/nova-core/gsp/load_exec.rs b/drivers/gpu/nova-core/gsp/load_exec.rs
index ab0c2959d3e8..5fef09f16185 100644
--- a/drivers/gpu/nova-core/gsp/load_exec.rs
+++ b/drivers/gpu/nova-core/gsp/load_exec.rs
@@ -38,7 +38,11 @@
GenericBootloader, //
},
gsp::{
- cmdq::gmc::MessageFromGsp,
+ cmdq::gmc::{
+ GmcMessage,
+ MessageFromGsp, //
+ },
+ fw::GmcCommandId,
GspBootContext, //
},
sbuffer::SBufferIter, //
@@ -116,6 +120,62 @@ pub(super) fn resume_gsp_rm(
Ok(())
}
+/// Runs the handler of the load-and-execute event `event`.
+///
+/// The command ID of `event` selects the handler, and the payload of `event` holds the parameters
+/// of that handler. `bootloader` is the generic falcon bootloader, which the handler of a
+/// `GMCAPI_CMD_EXEC_GENERIC_BOOTLOADER` event requires. Each handler ends in [`resume_gsp_rm`],
+/// which receives `libos_dma_address` and `bootloader_app_version`.
+///
+/// # Errors
+///
+/// - `EINVAL` if the command ID of `event` is not that of a load-and-execute event, or if the
+/// payload of `event` is shorter than the parameters of the handler.
+///
+/// Errors from the handlers are propagated as-is.
+#[expect(dead_code)]
+pub(super) fn handle_event(
+ ctx: &GspBootContext<'_, '_>,
+ bootloader: Option<&GenericBootloader>,
+ libos_dma_address: DmaAddress,
+ bootloader_app_version: u32,
+ event: &GmcMessage<'_>,
+) -> Result {
+ let dev = ctx.dev();
+ let command = event.header().command();
+ let (slice_1, slice_2) = event.payload();
+ let mut payload = SBufferIter::new_reader([slice_1, slice_2]);
+
+ let (id, result) = match command.id() {
+ Ok(id @ GmcCommandId::ExecGenericBootloader) => (
+ id,
+ GenericBootloaderParams::read(&mut payload).and_then(|params| {
+ handle_generic_bootloader(
+ ctx,
+ bootloader,
+ libos_dma_address,
+ bootloader_app_version,
+ ¶ms,
+ )
+ }),
+ ),
+ Ok(id @ GmcCommandId::ExecHsBinary) => (
+ id,
+ HsBinaryParams::read(&mut payload).and_then(|params| {
+ handle_hs_binary(ctx, libos_dma_address, bootloader_app_version, ¶ms)
+ }),
+ ),
+ _ => {
+ dev_err!(dev, "Not a load-and-execute event: {:?}\n", command);
+ return Err(EINVAL);
+ }
+ };
+
+ result.inspect_err(|e| {
+ dev_err!(dev, "Load-and-execute event {:?} failed: {:?}\n", id, e);
+ })
+}
+
/// Waits until GSP-RM has suspended the RISC-V core, and then resets the GSP falcon.
fn reset_gsp_falcon_after_suspend(dev: &device::Device, gsp_falcon: &Falcon<'_, Gsp>) -> Result {
gsp_falcon.wait_for_processor_suspend().inspect_err(|_| {
@@ -159,7 +219,6 @@ fn reset_gsp_falcon_after_suspend(dev: &device::Device, gsp_falcon: &Falcon<'_,
///
/// Errors from the reset of the GSP falcon, the DMA transfers and the resume of GSP-RM are
/// propagated as-is.
-#[expect(dead_code)]
fn handle_hs_binary(
ctx: &GspBootContext<'_, '_>,
libos_dma_address: DmaAddress,
@@ -260,7 +319,6 @@ fn handle_hs_binary(
///
/// Errors from the reset of the GSP falcon, the run of the bootloader and the resume of GSP-RM
/// are propagated as-is.
-#[expect(dead_code)]
fn handle_generic_bootloader(
ctx: &GspBootContext<'_, '_>,
bootloader: Option<&GenericBootloader>,
--
2.56.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 5/9] gpu: nova-core: gsp: fix resume_gsp_rm()'s error messages
2026-11-20 4:47 ` [PATCH 5/9] gpu: nova-core: gsp: fix resume_gsp_rm()'s error messages John Hubbard
@ 2026-11-20 4:49 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-11-20 4:49 UTC (permalink / raw)
To: John Hubbard; +Cc: linux-pci
> resume_gsp_rm()'s error messages have two problems:
>
> * Both messages open with "Sequencer:", which assumes that the function
> knows which code is calling it, and that that will never change. This
> kind of tight coupling is almost never desirable in well-structured
> code.
>
> * One message prints the SEC2 mailbox value in decimal. That needlessly
> complicates looking up the error code, given that Open RM documents
> those values in hex.
>
> Remove the sequencer's name from both messages and name the GSP-RM
> resume instead, and print the SEC2 mailbox value in hexadecimal.
>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120044704.165223-1-jhubbard@nvidia.com?part=5
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 2/9] gpu: nova-core: falcon: factor out the wait for the GSP suspend
2026-11-20 4:46 ` [PATCH 2/9] gpu: nova-core: falcon: factor out the wait for the GSP suspend John Hubbard
@ 2026-11-20 4:49 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-11-20 4:49 UTC (permalink / raw)
To: John Hubbard; +Cc: linux-pci
> The r000 boot protocol requires the driver to wait for the GSP suspend
> bit after each load-and-execute event, as the shutdown path already
> does.
>
> In order to make the wait available to the boot sequence, factor it out
> of the shutdown path, into a method of the GSP falcon.
>
> No functional changes.
>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120044704.165223-1-jhubbard@nvidia.com?part=2
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 4/9] gpu: nova-core: gsp: factor out the core reset and the core resume
2026-11-20 4:46 ` [PATCH 4/9] gpu: nova-core: gsp: factor out the core reset and the core resume John Hubbard
@ 2026-11-20 4:49 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-11-20 4:49 UTC (permalink / raw)
To: John Hubbard; +Cc: linux-pci
> The r000 boot protocol requires the driver to reset the GSP falcon
> before running the binary of a load-and-execute event, and to resume
> GSP-RM afterwards. The core reset and the core resume commands of the
> CPU sequencer already do both.
>
> In order to make the core reset and the core resume available outside
> the sequencer, factor them out of it, into a module of their own.
>
> No functional changes.
>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120044704.165223-1-jhubbard@nvidia.com?part=4
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 3/9] gpu: nova-core: falcon: factor out the BROM and BOOTVEC programming
2026-11-20 4:46 ` [PATCH 3/9] gpu: nova-core: falcon: factor out the BROM and BOOTVEC programming John Hubbard
@ 2026-11-20 4:49 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-11-20 4:49 UTC (permalink / raw)
To: John Hubbard; +Cc: linux-pci
> The r000 boot protocol requires the driver to program the BROM registers
> and the BOOTVEC register of the GSP falcon for a binary that GSP-RM has
> placed in the framebuffer, as the PIO and DMA load paths already do for
> a firmware image.
>
> In order to make the programming available to a caller that has no
> firmware image, factor it out of the two load paths, into a falcon
> method that receives the BROM parameters and the boot address.
>
> No functional changes.
>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120044704.165223-1-jhubbard@nvidia.com?part=3
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 9/9] gpu: nova-core: gsp: add the load-and-execute event dispatcher
2026-11-20 4:47 ` [PATCH 9/9] gpu: nova-core: gsp: add the load-and-execute event dispatcher John Hubbard
@ 2026-11-20 4:51 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-11-20 4:51 UTC (permalink / raw)
To: John Hubbard; +Cc: linux-pci
> The two load-and-execute events of the r000 boot protocol arrive as GMC
> events, and the command ID of a GMC event names its kind. Nova-core has
> a handler for each of the two events, and no code that selects the
> handler from the command ID.
>
> Add a dispatcher that selects the handler from the command ID of a GMC
> event, decodes the payload of the event into the parameters of that
> handler, and rejects an event with any other command ID.
>
> Co-developed-by: Alexandre Courbot <acourbot@nvidia.com>
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120044704.165223-1-jhubbard@nvidia.com?part=9
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 8/9] gpu: nova-core: gsp: add the r000 load-and-execute bootloader handler
2026-11-20 4:47 ` [PATCH 8/9] gpu: nova-core: gsp: add the r000 load-and-execute bootloader handler John Hubbard
@ 2026-11-20 4:52 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-11-20 4:52 UTC (permalink / raw)
To: John Hubbard; +Cc: linux-pci
> On Turing and GA100, the r000 GSP-RM requires an image to run on the
> falcon core during boot, through the generic falcon bootloader. GSP-RM
> is suspended while the image runs.
>
> The driver runs the image on behalf of GSP-RM, in the following steps:
>
> 1. GSP-RM raises a load-and-execute event, which carries a descriptor of
> the image.
> 2. GSP-RM suspends the RISC-V core.
> 3. The driver waits until the RISC-V core is suspended.
> 4. The driver resets the GSP falcon, which selects the falcon core.
> 5. The driver loads the bootloader and the descriptor into the GSP
> falcon.
> 6. The driver starts the bootloader, which loads the image and starts
> it.
> 7. The driver waits for the falcon core to halt.
> 8. The driver resumes GSP-RM on the RISC-V core.
>
> Nova-core has no handler for the bootloader's load-and-execute event.
>
> Add the handler, which performs steps 3 through 8.
>
> Co-developed-by: Alexandre Courbot <acourbot@nvidia.com>
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120044704.165223-1-jhubbard@nvidia.com?part=8
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 7/9] gpu: nova-core: gsp: add the r000 load-and-execute HS binary handler
2026-11-20 4:47 ` [PATCH 7/9] gpu: nova-core: gsp: add the r000 load-and-execute HS binary handler John Hubbard
@ 2026-11-20 4:53 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-11-20 4:53 UTC (permalink / raw)
To: John Hubbard; +Cc: linux-pci
> The GSP falcon is a microcontroller with two cores, a falcon core and a
> RISC-V core, and only one of the two is active at a time. GSP-RM runs on
> the RISC-V core.
>
> On GA102 and later, the r000 GSP-RM requires a Heavy-Secured (HS) binary
> to run on the falcon core during boot. GSP-RM is suspended while the
> binary runs.
>
> The driver runs the binary on behalf of GSP-RM, in the following steps:
>
> 1. GSP-RM places the binary in the framebuffer.
> 2. GSP-RM raises a load-and-execute event.
> 3. GSP-RM suspends the RISC-V core.
> 4. The driver waits until the RISC-V core is suspended.
> 5. The driver resets the GSP falcon, which selects the falcon core.
> 6. The driver loads the binary from the framebuffer into the GSP falcon.
> 7. The driver starts the binary and waits for the falcon core to halt.
> 8. The driver resumes GSP-RM on the RISC-V core.
>
> Nova-core has no handler for the load-and-execute event.
>
> Add the handler, which performs steps 4 through 8.
>
> Co-developed-by: Alexandre Courbot <acourbot@nvidia.com>
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120044704.165223-1-jhubbard@nvidia.com?part=7
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 6/9] gpu: nova-core: falcon: select the BAR2 engine ID for framebuffer DMA
2026-11-20 4:47 ` [PATCH 6/9] gpu: nova-core: falcon: select the BAR2 engine ID for framebuffer DMA John Hubbard
@ 2026-11-20 4:53 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-11-20 4:53 UTC (permalink / raw)
To: John Hubbard; +Cc: linux-pci
> When Open RM loads a binary from the framebuffer into a falcon by DMA,
> it selects BAR2 as the MMU engine ID of the transfer, in the falcon's
> FBIF_TRANSCFG register. Nova-core's definition of the register has no
> field for the engine ID, so the DMA transfer code has no way to select
> one.
>
> Add the field, and select the BAR2 engine ID for a DMA transfer whose
> source is the framebuffer.
>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120044704.165223-1-jhubbard@nvidia.com?part=6
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 1/9] rust: pci: add domain_nr() accessor
2026-11-20 4:46 ` [PATCH 1/9] rust: pci: add domain_nr() accessor John Hubbard
@ 2026-11-20 4:54 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-11-20 4:54 UTC (permalink / raw)
To: John Hubbard; +Cc: linux-pci
> The nova-core driver has to send the GPU's PCI location to the GPU's
> firmware as one word that holds the domain, the bus and the device
> number.
>
> The PCI abstraction has dev_id(), which packs the bus, the device and
> the function into one value. It has no accessor that reports the domain.
>
> Add an accessor for the domain number.
>
> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
> Reviewed-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120044704.165223-1-jhubbard@nvidia.com?part=1
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2026-11-20 4:54 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 4:46 [PATCH 0/9] gpu: nova-core: run falcon binaries for the r000 GSP-RM John Hubbard
2026-11-20 4:46 ` [PATCH 1/9] rust: pci: add domain_nr() accessor John Hubbard
2026-11-20 4:54 ` sashiko-bot
2026-11-20 4:46 ` [PATCH 2/9] gpu: nova-core: falcon: factor out the wait for the GSP suspend John Hubbard
2026-11-20 4:49 ` sashiko-bot
2026-11-20 4:46 ` [PATCH 3/9] gpu: nova-core: falcon: factor out the BROM and BOOTVEC programming John Hubbard
2026-11-20 4:49 ` sashiko-bot
2026-11-20 4:46 ` [PATCH 4/9] gpu: nova-core: gsp: factor out the core reset and the core resume John Hubbard
2026-11-20 4:49 ` sashiko-bot
2026-11-20 4:47 ` [PATCH 5/9] gpu: nova-core: gsp: fix resume_gsp_rm()'s error messages John Hubbard
2026-11-20 4:49 ` sashiko-bot
2026-11-20 4:47 ` [PATCH 6/9] gpu: nova-core: falcon: select the BAR2 engine ID for framebuffer DMA John Hubbard
2026-11-20 4:53 ` sashiko-bot
2026-11-20 4:47 ` [PATCH 7/9] gpu: nova-core: gsp: add the r000 load-and-execute HS binary handler John Hubbard
2026-11-20 4:53 ` sashiko-bot
2026-11-20 4:47 ` [PATCH 8/9] gpu: nova-core: gsp: add the r000 load-and-execute bootloader handler John Hubbard
2026-11-20 4:52 ` sashiko-bot
2026-11-20 4:47 ` [PATCH 9/9] gpu: nova-core: gsp: add the load-and-execute event dispatcher John Hubbard
2026-11-20 4:51 ` sashiko-bot
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.