[PATCH v4 0/4] Fixes the stack overflow

Tim Kovalenko via B4 Relay posted 4 patches 1 month ago
drivers/gpu/nova-core/gsp.rs      |  48 ++++---
drivers/gpu/nova-core/gsp/boot.rs |   2 +-
drivers/gpu/nova-core/gsp/cmdq.rs |  23 ++-
rust/kernel/dma.rs                | 114 +++++++--------
rust/kernel/lib.rs                |   4 +
rust/kernel/ptr.rs                |  30 +++-
rust/kernel/ptr/projection.rs     | 294 ++++++++++++++++++++++++++++++++++++++
samples/rust/rust_dma.rs          |  30 ++--
scripts/Makefile.build            |   4 +-
9 files changed, 443 insertions(+), 106 deletions(-)
[PATCH v4 0/4] Fixes the stack overflow
Posted by Tim Kovalenko via B4 Relay 1 month ago
---
Changes in v4:
- Rebase on top of projection changes
- Use index projection when writing PTEs
- Keep PteArray, as discussed in V2, and move entry calculation there
- Avoid stack allocation by writing PTEs directly to DMA memory

- Link to v3: https://lore.kernel.org/r/20260217-drm-rust-next-v3-1-9e7e95c597dc@proton.me

Changes in v3:
- Addressed the comments and re-instated the PteArray type.
- PteArray now uses `init` instead of `new` where it writes to `self`
  page by page.
- PteArray just needs a pte pointer obtained from the `gsp_mem.as_slice_mut`.

I hope I understood everything in the V2 email chain and implemented it correctly :)

- Link to v2: https://lore.kernel.org/r/20260213-drm-rust-next-v2-1-aa094f78721a@proton.me

Changes in v2:
- Missed a code formatting issue.
- Link to v1: https://lore.kernel.org/r/20260212-drm-rust-next-v1-1-409398b12e61@proton.me

---
Gary Guo (3):
      rust: ptr: add `KnownSize` trait to support DST size info extraction
      rust: ptr: add projection infrastructure
      rust: dma: use pointer projection infra for `dma_{read,write}` macro

Tim Kovalenko (1):
      gpu: nova-core: fix stack overflow in GSP memory allocation

 drivers/gpu/nova-core/gsp.rs      |  48 ++++---
 drivers/gpu/nova-core/gsp/boot.rs |   2 +-
 drivers/gpu/nova-core/gsp/cmdq.rs |  23 ++-
 rust/kernel/dma.rs                | 114 +++++++--------
 rust/kernel/lib.rs                |   4 +
 rust/kernel/ptr.rs                |  30 +++-
 rust/kernel/ptr/projection.rs     | 294 ++++++++++++++++++++++++++++++++++++++
 samples/rust/rust_dma.rs          |  30 ++--
 scripts/Makefile.build            |   4 +-
 9 files changed, 443 insertions(+), 106 deletions(-)
---
base-commit: dd8a93dafe6ef50b49d2a7b44862264d74a7aafa
change-id: 20260212-drm-rust-next-beb92aee9d75

Best regards,
-- 
Tim Kovalenko <tim.kovalenko@proton.me>
Re: [PATCH v4 0/4] Fixes the stack overflow
Posted by Danilo Krummrich 1 month ago
On Mon Mar 9, 2026 at 5:34 PM CET, Tim Kovalenko via B4 Relay wrote:
>
> ---
> Changes in v4:
> - Rebase on top of projection changes

Thanks for the quick follow-up!

There was no need to include the series you rebased onto, i.e. it is usually
enough to just mention that your patch is based on another series and provide a
link.

But don't worry, I just mention this for the next time, there is nothing that
needs to be done on your end.

(One additional thing to note, in case you will actually have to (re-)send
patches of other people in the future, is that such patches still need to have
your Signed-off-by: in addition, since by sending them you are involved in the
handling of those patches.)

Thanks,
Danilo