public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH v3 0/5] gpu: drm: nova: enable calling into nova-core
@ 2026-05-29 15:27 Alexandre Courbot
  2026-05-29 15:27 ` [PATCH v3 1/5] rust: inline some init methods Alexandre Courbot
                   ` (6 more replies)
  0 siblings, 7 replies; 19+ messages in thread
From: Alexandre Courbot @ 2026-05-29 15:27 UTC (permalink / raw)
  To: Miguel Ojeda, Nathan Chancellor, Nicolas Schier, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
	David Airlie, Simona Vetter
  Cc: John Hubbard, Alistair Popple, Timur Tabi, Zhi Wang,
	Eliot Courtney, linux-kbuild, linux-kernel, rust-for-linux,
	nova-gpu, dri-devel, Alexandre Courbot, Joel Fernandes

`nova-drm` is scheduled to expose a user-space API to receive IOCTLs
from user-mode drivers, and to call into `nova-core` to perform the
actual work. We are about to reach the state where we need the ability
to call into `nova-core`, but the current Rust build system does not
support this, and the solution will likely take at least a couple of
cycles to be merged.

In the meantime, this series introduces a Nova-local workaround for
`nova-drm` to call into `nova-core`. It generates the `nova-core`
metadata that `nova-drm` can use to resolve references at build-time,
and also builds a list of exported symbols for symbol resolution when
modules are loaded.

Since Rust symbols are long, this work ran into the limits on symbol
sizes `modpost` can handle. Thus, the first patch instructs the compiler
to inline initializers for some Rust basic types to avoid those long
symbol names when symbols from `nova-core` are exported. Interestingly,
this also results in a smaller nova-core binary size [1].

The rest of the patches enable inter-module calls from nova-drm to
nova-core.

This series is based on `drm-rust-next`.

[1] https://lore.kernel.org/all/DIN76NTFEU1N.1RT6G4IFD62RG@nvidia.com/

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
Changes in v3:
- Drop the modpost overflow detection patch as it is to be merged
  through the KBuild tree.
- Drop obsolete (and actually unnecessary) changes to `pin_init`.
- Do not inline methods returning `impl PinInit` as they cannot
  contribute to the long symbol names problem.
- Use `#[inline]` instead of `#[inline(always)]` for methods that could
  create excessively long symbols.
- Link to v2: https://patch.msgid.link/20260527-nova-exports-v2-0-06de4c556d55@nvidia.com

Changes in v2:
- Rebase on top of HRT v5.
- Inline some `pin_init` and Rust basic types methods to avoid long
  symbol names and optimize code.
- Print truncating modpost symbols and abort upon meeting them.
- Drop increase of `buf_printf`'s buffer.
- Drop obsolete nova-core renaming patch.
- Link to v1: https://patch.msgid.link/20260430-nova-exports-v1-0-7ca31664e983@nvidia.com

---
Alexandre Courbot (5):
      rust: inline some init methods
      gpu: nova-core: export Rust symbols for dependent modules
      gpu: nova-core: emit Rust metadata for dependent modules
      gpu: drm: nova: build after nova-core metadata
      [POC] drm: nova: demonstrate interaction with nova-core

 drivers/gpu/drm/nova/Makefile             | 15 ++++++++
 drivers/gpu/drm/nova/driver.rs            |  9 ++++-
 drivers/gpu/nova-core/Makefile            | 48 ++++++++++++++++++++++++-
 drivers/gpu/nova-core/driver.rs           | 59 +++++++++++++++++++++++--------
 drivers/gpu/nova-core/gpu.rs              |  9 +++--
 drivers/gpu/nova-core/nova_core.rs        |  4 +--
 drivers/gpu/nova-core/nova_core_exports.c | 13 +++++++
 rust/kernel/alloc/kbox.rs                 |  2 ++
 rust/kernel/init.rs                       |  1 +
 rust/kernel/sync/arc.rs                   |  2 ++
 10 files changed, 141 insertions(+), 21 deletions(-)
---
base-commit: 0e42ec83d46ab8877d38d37493328ed7d1a24de8
change-id: 20260430-nova-exports-502f996c5aab

Best regards,
--  
Alexandre Courbot <acourbot@nvidia.com>


^ permalink raw reply	[flat|nested] 19+ messages in thread
* [PATCH v2 0/7] gpu: drm: nova: enable calling into nova-core
@ 2026-05-27 11:52 Alexandre Courbot
  2026-05-27 11:52 ` [PATCH v2 6/7] gpu: drm: nova: build after nova-core metadata Alexandre Courbot
  0 siblings, 1 reply; 19+ messages in thread
From: Alexandre Courbot @ 2026-05-27 11:52 UTC (permalink / raw)
  To: Miguel Ojeda, Nathan Chancellor, Nicolas Schier, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
	David Airlie, Simona Vetter
  Cc: John Hubbard, Alistair Popple, Timur Tabi, Zhi Wang,
	Eliot Courtney, linux-kbuild, linux-kernel, rust-for-linux,
	nova-gpu, dri-devel, Alexandre Courbot, Joel Fernandes

`nova-drm` is scheduled to expose a user-space API to receive IOCTLs
from user-mode drivers, and to call into `nova-core` to perform the
actual work. We are about to reach the state where we need the ability
to call into `nova-core`, but the current Rust build system does not
currently support this, and the solution will likely take at least a
couple of cycles to be merged.

In the meantime, this series introduces a Nova-local workaround for
`nova-drm` to call into `nova-core`. It generates the `nova-core`
metadata that `nova-drm` can use to resolve references at build-time,
and also builds a list of exported symbols for symbol resolution when
modules are loaded.

Since Rust symbols are long, this work ran into the limits on symbol
sizes `modpost` can handle; however the overflow path was not properly
handled, which resulted in late failures. The first patch makes
`modpost` fail on symbols that are too long for its internal buffer and
report them. It is not strictly necessary for this series and can be
merged independently if preferred.

The second and third patches instruct the compiler to inline some
methods of `pin_init` and Rust basic types to avoid those long symbol
names. Interestingly, this also results in a smaller nova-core binary
size [1].

The rest of the patches enable inter-module calls from nova-drm to
nova-core.

This series is based on `drm-rust-next` with [2] and [3] applied.

[1] https://lore.kernel.org/all/DIN76NTFEU1N.1RT6G4IFD62RG@nvidia.com/
[2] https://lore.kernel.org/all/20260525202921.124698-1-dakr@kernel.org/
[3] https://lore.kernel.org/all/20260525225838.276108-1-dakr@kernel.org/

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
Changes in v2:
- Rebase on top of HRT v5.
- Inline some `pin_init` and Rust basic types methods to avoid long
  symbol names and optimize code.
- Print truncating modpost symbols and abort upon meeting them.
- Drop increase of `buf_printf`'s buffer.
- Drop obsolete nova-core renaming patch.
- Link to v1: https://patch.msgid.link/20260430-nova-exports-v1-0-7ca31664e983@nvidia.com

---
Alexandre Courbot (7):
      scripts: modpost: detect and report truncated buf_printf() output
      pin_init: always inline the #ident and #project_ident methods
      rust: always inline some init methods
      gpu: nova-core: export Rust symbols for dependent modules
      gpu: nova-core: emit Rust metadata for dependent modules
      gpu: drm: nova: build after nova-core metadata
      [POC] drm: nova: demonstrate interaction with nova-core

 drivers/gpu/drm/nova/Makefile             | 15 ++++++++
 drivers/gpu/drm/nova/driver.rs            |  9 ++++-
 drivers/gpu/nova-core/Makefile            | 46 +++++++++++++++++++++++-
 drivers/gpu/nova-core/driver.rs           | 59 +++++++++++++++++++++++--------
 drivers/gpu/nova-core/gpu.rs              |  9 +++--
 drivers/gpu/nova-core/nova_core.rs        |  4 +--
 drivers/gpu/nova-core/nova_core_exports.c | 13 +++++++
 rust/kernel/alloc/kbox.rs                 |  2 ++
 rust/kernel/init.rs                       |  1 +
 rust/kernel/sync/arc.rs                   |  2 ++
 rust/kernel/types.rs                      |  3 ++
 rust/pin-init/internal/src/pin_data.rs    |  2 ++
 scripts/mod/modpost.c                     | 11 +++++-
 13 files changed, 154 insertions(+), 22 deletions(-)
---
base-commit: 79c29e27d676a74f9238506a5fe2134637356708
change-id: 20260430-nova-exports-502f996c5aab

Best regards,
--  
Alexandre Courbot <acourbot@nvidia.com>


^ permalink raw reply	[flat|nested] 19+ messages in thread
* [PATCH 0/7] gpu: drm: nova: enable calling into nova-core
@ 2026-04-30 14:55 Alexandre Courbot
  2026-04-30 14:55 ` [PATCH 6/7] gpu: drm: nova: build after nova-core metadata Alexandre Courbot
  0 siblings, 1 reply; 19+ messages in thread
From: Alexandre Courbot @ 2026-04-30 14:55 UTC (permalink / raw)
  To: Miguel Ojeda, Nathan Chancellor, Nicolas Schier, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
	David Airlie, Simona Vetter
  Cc: John Hubbard, Alistair Popple, Joel Fernandes, Timur Tabi,
	Zhi Wang, Eliot Courtney, linux-kbuild, linux-kernel,
	rust-for-linux, nova-gpu, dri-devel, Alexandre Courbot

`nova-drm` is scheduled to expose a user-space API to receive IOCTLs
from user-mode drivers, and to call into `nova-core` to perform the
actual work. We are about to reach the state where we need the ability
to call into `nova-core`, but the current Rust build system does not
currently support this, and the solution will likely take at least a
couple of cycles to be merged.

In the meantime, this series would like to introduce a Nova-local
workaround for `nova-drm` to call into `nova-core`. It generates the
`nova-core` metadata that `nova-drm` can use to resolve references at
build-time, and also builds a list of exported symbols for symbol
resolution when modules are loaded.

Since Rust symbols are long, this work ran into the limits of `modpost`,
which the first two patches try to address: the first one, by detecting
and reporting buffer overflow situations that were ignored until now;
the second, by increasing the size of the buffer used to build the
symbol names, so `nova-core`'s symbols can fit.

@Miguel: I expect the design used here will allow us to smoothly switch
to the new build system once it is merged; I hope you are ok with this
temporary workaround.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
Alexandre Courbot (7):
      scripts: modpost: detect and report truncated buf_printf() output
      scripts: modpost: increase buf_printf's buffer size
      gpu: nova-core: rename module from nova_core to nova-core
      gpu: nova-core: export Rust symbols for dependent modules
      gpu: nova-core: emit Rust metadata for dependent modules
      gpu: drm: nova: build after nova-core metadata
      [POC] drm: nova: demonstrate interaction with nova-core

 drivers/gpu/drm/nova/Makefile             | 15 ++++++++++
 drivers/gpu/drm/nova/driver.rs            |  6 ++++
 drivers/gpu/nova-core/Kconfig             |  2 +-
 drivers/gpu/nova-core/Makefile            | 48 ++++++++++++++++++++++++++++++-
 drivers/gpu/nova-core/driver.rs           | 20 +++++++++++--
 drivers/gpu/nova-core/gpu.rs              |  9 ++++--
 drivers/gpu/nova-core/nova_core.rs        |  4 +--
 drivers/gpu/nova-core/nova_core_exports.c | 11 +++++++
 scripts/mod/modpost.c                     | 13 +++++++--
 9 files changed, 117 insertions(+), 11 deletions(-)
---
base-commit: 11a63a5335eb7b5da4ca38014fa83be5d437144d
change-id: 20260430-nova-exports-502f996c5aab

Best regards,
--  
Alexandre Courbot <acourbot@nvidia.com>


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2026-06-04  6:23 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-29 15:27 [PATCH v3 0/5] gpu: drm: nova: enable calling into nova-core Alexandre Courbot
2026-05-29 15:27 ` [PATCH v3 1/5] rust: inline some init methods Alexandre Courbot
2026-06-03 11:52   ` Gary Guo
2026-06-04  6:23   ` Claude review: " Claude Code Review Bot
2026-05-29 15:27 ` [PATCH v3 2/5] gpu: nova-core: export Rust symbols for dependent modules Alexandre Courbot
2026-06-04  6:23   ` Claude review: " Claude Code Review Bot
2026-05-29 15:27 ` [PATCH v3 3/5] gpu: nova-core: emit Rust metadata " Alexandre Courbot
2026-06-04  6:23   ` Claude review: " Claude Code Review Bot
2026-05-29 15:27 ` [PATCH v3 4/5] gpu: drm: nova: build after nova-core metadata Alexandre Courbot
2026-06-04  6:23   ` Claude review: " Claude Code Review Bot
2026-05-29 15:27 ` [PATCH POC v3 5/5] drm: nova: demonstrate interaction with nova-core Alexandre Courbot
2026-06-04  6:23   ` Claude review: " Claude Code Review Bot
2026-06-01 13:50 ` [PATCH v3 0/5] gpu: drm: nova: enable calling into nova-core Miguel Ojeda
2026-06-01 17:00   ` Miguel Ojeda
2026-06-03 10:30   ` Alexandre Courbot
2026-06-03 11:49     ` Miguel Ojeda
2026-06-04  6:23 ` Claude review: " Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-05-27 11:52 [PATCH v2 0/7] " Alexandre Courbot
2026-05-27 11:52 ` [PATCH v2 6/7] gpu: drm: nova: build after nova-core metadata Alexandre Courbot
2026-05-28  2:22   ` Claude review: " Claude Code Review Bot
2026-04-30 14:55 [PATCH 0/7] gpu: drm: nova: enable calling into nova-core Alexandre Courbot
2026-04-30 14:55 ` [PATCH 6/7] gpu: drm: nova: build after nova-core metadata Alexandre Courbot
2026-05-05  0:17   ` Claude review: " Claude Code Review Bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox