Re: [PATCH 6/9] gpu: nova-core: consolidate GSP boot parameters into GspBootContext
From: Alexandre Courbot
Date: Tue Jun 16 2026 - 10:23:17 EST
On Thu Jun 4, 2026 at 8:43 PM JST, Zhi Wang wrote:
> The GspHal trait methods boot() and post_boot() accept a long list of
> individual parameters (dev, bar, chipset, gsp_falcon, sec2_falcon) that
> are threaded through the entire GSP boot call chain. This makes the
> signatures unwieldy and difficult to extend as new boot-time context
> (e.g. vGPU state) is introduced.
>
> Introduce a GspBootContext struct that bundles the common boot
> parameters into a single object, and refactor the GspHal trait to accept
> &GspBootContext instead of individual arguments. The struct also exposes
> a dev() helper with proper lifetime annotation so that HAL
> implementations can extract the device reference without reborrowing
> constraints.
>
> Update both TU102 and GH100 HAL implementations to extract their
> required parameters from the context struct, and simplify the call sites
> in Gsp::boot() accordingly.
>
> Signed-off-by: Zhi Wang <zhiw@xxxxxxxxxx>
> ---
> drivers/gpu/nova-core/gpu.rs | 14 ++++++-
> drivers/gpu/nova-core/gsp.rs | 22 +++++++++++
> drivers/gpu/nova-core/gsp/boot.rs | 55 ++++++++++++--------------
> drivers/gpu/nova-core/gsp/hal.rs | 23 +++--------
> drivers/gpu/nova-core/gsp/hal/gh100.rs | 14 ++++---
> drivers/gpu/nova-core/gsp/hal/tu102.rs | 31 ++++++---------
> 6 files changed, 85 insertions(+), 74 deletions(-)
I think this one is also good to take independently, it groups all the
context required for booting the GSP in a dedicated type, which is
something we might want to do as the SEC2 and FSP paths require
different resources (and thus could use different associated types).
So I'm leaning towards merging this early as it is independent from the
preceding patches in the series and makes the first step in that
direction.