Re: [PATCH 6/9] gpu: nova-core: consolidate GSP boot parameters into GspBootContext

From: Alexandre Courbot

Date: Wed Jun 17 2026 - 09:27:58 EST


On Tue Jun 16, 2026 at 11:13 PM JST, Alexandre Courbot wrote:
> 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.

Merged into drm-rust-next, thanks! With two minor edits:

[acourbot: pass `GspBootContext` by value to `Gsp::boot`.] │

So the boot context can be modified by `Gsp::boot` if needed (although
that shouldn't be necessary, but it is more natural to pass by value
here regardless).

[acourbot: deconstruct `GspBootContext` in `Gsp::boot` to simplify diff.]

To stay consistent with what was done in the HALs. This also makes the
diff considerably smaller and easier to parse.