[PATCH 0/1] nova-core: Convert bindings to use zerocopy

From: Alistair Popple

Date: Sun Jun 28 2026 - 22:52:52 EST


This patch converts all the bindings to use the new zerocopy library. Bindings
are currently generated using a fairly simple bindgen script[1]. This is a
temporary solution until the bindings have been stablisied but for now upstream
should be kept in sync with the resulting output.

Note that this does not completely remove all users of the transmute
From/AsBytes traits from nova-core, leaving some ambiguity with when referring
to FromBytes. However others have recently posted patches[2][3][4] to remove
the majority of other uses which should allow us to remove transmute::FromBytes
entirely from nova-core.

Given the inevitable conflicts that will arise from trying to merge several
different series doing bits of the same thing I'm happy if someone wants to take
this patch and the others and roll them into a single series. Alternatively I am
happy to take that on - hopefully Alex can provide some guidance here for what
would be preferred.

[1] - https://github.com/apopple-nvidia/nova-gsp-binding-generator/tree/zerocopy
[2] - https://lore.kernel.org/rust-for-linux/20260628-dma-zerocopy-bridge-v1-0-9a2895ebe30d@xxxxxxxxx/
[3] - https://lore.kernel.org/rust-for-linux/20260625205146.5047-1-niyudi.honda@xxxxxx/
[4] - https://lore.kernel.org/rust-for-linux/20260621143647.264770-1-nico.antinori.7@xxxxxxxxx/

Cc: Danilo Krummrich <dakr@xxxxxxxxxx>
Cc: Alice Ryhl <aliceryhl@xxxxxxxxxx>
Cc: Miguel Ojeda <ojeda@xxxxxxxxxx
Cc: "Nicolás Antinori" <nico.antinori.7@xxxxxxxxx>
Cc: "Alexandre Courbot" <acourbot@xxxxxxxxxx>
Cc: "David Airlie" <airlied@xxxxxxxxx>
Cc: "Shuah Khan" <skhan@xxxxxxxxxxxxxxxxxxx>
Cc: "Simona Vetter" <simona@xxxxxxxx>
Cc: "Gary Guo" <gary@xxxxxxxxxxx>
Cc: "Onur Özkan" <work@xxxxxxxxxxxxx>
Cc: "Tamir Duberstein" <tamird@xxxxxxxxxx>
Cc: "Trevor Gross" <tmgross@xxxxxxxxx>
Cc: Pedro Yudi Honda <niyudi.honda@xxxxxx>
Cc: SeungJong Ha <engineer.jjhama@xxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
Cc: rust-for-linux@xxxxxxxxxxxxxxx
Cc: nova-gpu@xxxxxxxxxxxxxx

Alistair Popple (1):
nova-core: Update firmware bindings to use zerocopy traits

drivers/gpu/nova-core/Makefile | 4 +
drivers/gpu/nova-core/gsp/cmdq.rs | 21 +-
.../gpu/nova-core/gsp/cmdq/continuation.rs | 16 +-
drivers/gpu/nova-core/gsp/commands.rs | 19 +-
drivers/gpu/nova-core/gsp/fw.rs | 54 +----
drivers/gpu/nova-core/gsp/fw/commands.rs | 50 ++---
drivers/gpu/nova-core/gsp/fw/r570_144.rs | 41 ++++
.../gpu/nova-core/gsp/fw/r570_144/bindings.rs | 185 ++++++++++++------
drivers/gpu/nova-core/gsp/sequencer.rs | 5 +-
scripts/Makefile.build | 4 +-
10 files changed, 223 insertions(+), 176 deletions(-)

--
2.54.0