Re: [PATCH] gpu: nova-core: replace unsafe pointer cast with pin-init self-reference

From: Eliot Courtney

Date: Mon Oct 19 2026 - 20:56:49 EST


On Mon Oct 19, 2026 at 10:36 PM JST, Gary Guo wrote:
> From: Gary Guo <gary@xxxxxxxxxxx>
>
> Nova core's driver data makes use of a few unsafe self-references for
> device resources. Replace them with pin-init's self reference feature
> instead.
>
> `auxiliary::Registration` is only allowed to capture a single lifetime, but
> it needs to capture `&'gpu Gpu<'bar>`. However, we cannot use coercion here
> as `Gpu` is invariant over `'bar`. As we know that `'bar` outlives `'gpu`,
> use pin-init's existential lifetime to erase the `'bar` lifetime in
> `NovaCoreApi`.
>
> Swap bar1 and bar0's drop order to make pin-init happy.
>
> Signed-off-by: Gary Guo <gary@xxxxxxxxxxx>
> ---

Reviewed-by: Eliot Courtney <ecourtney@xxxxxxxxxx>