Re: [PATCH 05/13] gpu: nova-core: gsp: keep FMC boot params DMA region alive during error
From: Gary Guo
Date: Mon Jun 15 2026 - 13:30:49 EST
On Mon Jun 15, 2026 at 3:40 PM BST, Eliot Courtney wrote:
> Currently, if, for example `boot_fmc` fails, `FmcBootArgs` will be
> dropped before the boot unload guard. But until everything is unloaded,
> GSP may access this memory, so make sure it doesn't get deallocated.
Hmm, this looks very weirld. `boot_fmc` only needs `&args` but it actually need
it for much longer?
This is hinting to me that the signature is wrong of the `boot_fmc` function is
wrong..
What is the exact lifetime requirement for GSP?
>
> Signed-off-by: Eliot Courtney <ecourtney@xxxxxxxxxx>
> ---
> drivers/gpu/nova-core/gsp/hal/gh100.rs | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/gsp/hal/gh100.rs b/drivers/gpu/nova-core/gsp/hal/gh100.rs
> index 98f5ce197d13..b08761af89d3 100644
> --- a/drivers/gpu/nova-core/gsp/hal/gh100.rs
> +++ b/drivers/gpu/nova-core/gsp/hal/gh100.rs
> @@ -162,16 +162,6 @@ fn boot<'a>(
> ) -> Result<BootUnloadGuard<'a>> {
> let fsp_fw = FspFirmware::new(dev, chipset, FIRMWARE_VERSION)?;
>
> - let unload_bundle = crate::gsp::UnloadBundle(
> - KBox::new(FspUnloadBundle, GFP_KERNEL)? as KBox<dyn UnloadBundle>
> - );
> -
> - // Wrap the unload bundle into a drop guard so it is automatically run upon failure.
> - let unload_guard =
> - BootUnloadGuard::new(gsp, dev, bar, gsp_falcon, sec2_falcon, Some(unload_bundle));
> -
> - let mut fsp = Fsp::wait_secure_boot(dev, bar, chipset, fsp_fw)?;
> -
> let args = FmcBootArgs::new(
> dev,
> chipset,
> @@ -180,6 +170,16 @@ fn boot<'a>(
> false,
> )?;
>
> + let mut fsp = Fsp::wait_secure_boot(dev, bar, chipset, fsp_fw)?;
> +
> + let unload_bundle = crate::gsp::UnloadBundle(
> + KBox::new(FspUnloadBundle, GFP_KERNEL)? as KBox<dyn UnloadBundle>
> + );
> +
> + // Wrap the unload bundle into a drop guard so it is automatically run upon failure.
> + let unload_guard =
> + BootUnloadGuard::new(gsp, dev, bar, gsp_falcon, sec2_falcon, Some(unload_bundle));
> +
This usual "usage beyond reference lifetime" needs to be at least explicitly
mentioned here.
Best,
Gary
> fsp.boot_fmc(dev, bar, fb_layout, &args)?;
>
> wait_for_gsp_lockdown_release(dev, bar, gsp_falcon, args.boot_params_dma_handle())?;