rust: add pointer projection infrastructure and convert DMA
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 23 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | rust: add projection infrastructurerust/ rust/ scripts/ | +277 | 6 replies | |
| 2/4 | rust: dma: generalize `dma_{read,write}` macrorust/ samples/ | +73 | 3 replies | |
| 3/4 | gpu: nova-core: convert to use new `dma_write!` syntaxdrivers/ drivers/ drivers/ | +15 | 1 reply | |
| 4/4 | rust: dma: remove old dma_{read,write} macro compatibility syntaxrust/ | +0 | 1 reply |
Reviews trailers per patch
3 of 4 patches have a Reviewed-by or Acked-by.
| Patch | Benno Lossin |
|---|---|
| 1/4 | R-b |
| 2/4 | |
| 3/4 | R-b |
| 4/4 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/4] rust: add pointer projection infrastructure and convert DMA
This adds a general pointer projection infrastructure which is intended to serve as the basis for generic I/O projections. The idea is that we will have a unified way of reading/writing MMIO or DMA allocation, creating typed subviews into them, and able to read/write subfields safely.
This is the first step towards that direction, where an infra for projecting arbitrary pointers are added. This takes care to not assume pointers are part of a valid allocation, so it can be used to project I/O pointers, too. dma_read! and dma_write! is converted to use this infra, as they currently have soundness issues [1] and users have already encountered limitation of it [2].
To aid the logistics, patch 2 retains a compatibility layer where the existing syntax and behaviour is still supported. Patch 3 converts Nova which is currently the only in-tree user of the API, and patch 4 removes this compatibility layer.
I have more patches in works which will further simplify Nova side, however the overall dma_{read,write} syntax would remain the same.
Gary Guo (4):
rust: add projection infrastructure
rust: dma: generalize dma_{read,write} macro
gpu: nova-core: convert to use new dma_write! syntax
rust: dma: remove old dma_{read,write} macro compatibility syntax
drivers/gpu/nova-core/gsp.rs | 14 +- drivers/gpu/nova-core/gsp/boot.rs | 2 +- drivers/gpu/nova-core/gsp/cmdq.rs | 10 +- rust/kernel/dma.rs | 97 +++++------ rust/kernel/lib.rs | 5 + rust/kernel/projection.rs | 269 ++++++++++++++++++++++++++++++ samples/rust/rust_dma.rs | 18 +- scripts/Makefile.build | 4 +- 8 files changed, 350 insertions(+), 69 deletions(-) create mode 100644 rust/kernel/projection.rs
base-commit: 9152bc8cebcb14dc16b03ec81f2377ee8ce12268
Signature · 1 line
2.51.2