[PATCH v2 0/8] dma::Coherent & dma::CoherentBox API

Danilo Krummrich
2026-03-20T19:46:46Z

This patch series introduces the dma::Coherent API Gary worked out in the
context of his I/O projection work.

Additionally, introduce dma::CoherentBox, a type that encapsulates a
dma::Coherent object before its DMA address is exposed to the device.
dma::CoherentBox can guarantee exclusive access to the inner dma::Coherent
object and implement Deref and DerefMut.

Also add Coherent::init() and Coherent::init_with_attrs() so we can directly
initialize a new dma::Coherent object through an impl Init<T, E>.

Changes in v2:
- Rebase onto the DMA and nova-core fixes that went into -rc4.
- Rename CoherentInit to CoherentBox.
- Add a bunch of #[inline] attributes.
- Remove a few unnecessary trait bounds in "rust: dma: add generalized
container for types other than slices".
- Fix a typo and convert core::ptr::from_mut(&mut self[i]) into
&raw mut self[i].

Danilo Krummrich (5):
rust: dma: use "kernel vertical" style for imports
rust: dma: introduce dma::CoherentBox for memory initialization
rust: dma: add Coherent:init() and Coherent::init_with_attrs()
gpu: nova-core: use Coherent::init to initialize GspFwWprMeta
gpu: nova-core: convert Gsp::new() to use CoherentBox

Gary Guo (3):
rust: dma: add generalized container for types other than slices
rust: dma: add zeroed constructor to `Coherent`
gpu: nova-core: convert to new dma::Coherent API

drivers/gpu/nova-core/dma.rs | 19 +-
drivers/gpu/nova-core/falcon.rs | 5 +-
drivers/gpu/nova-core/gsp.rs | 68 ++--
drivers/gpu/nova-core/gsp/boot.rs | 7 +-
drivers/gpu/nova-core/gsp/cmdq.rs | 21 +-
drivers/gpu/nova-core/gsp/fw.rs | 128 +++---
rust/kernel/device.rs | 4 +-
rust/kernel/dma.rs | 632 +++++++++++++++++++++++-------
samples/rust/rust_dma.rs | 8 +-
9 files changed, 626 insertions(+), 266 deletions(-)

base-commit: a19457958c3018783881c4416f272cd594f13049
--
2.53.0