NVIDIA GPU driver infrastructure
 help / color / mirror / Atom feed
* [PATCH v5 0/5] gpu: drm: nova: enable calling into nova-core
@ 2026-06-22 13:30 Alexandre Courbot
  2026-06-22 13:30 ` [PATCH v5 1/5] gpu: build nova-core and nova-drm from drivers/gpu/Makefile Alexandre Courbot
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Alexandre Courbot @ 2026-06-22 13:30 UTC (permalink / raw)
  To: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Danilo Krummrich, David Airlie, Simona Vetter, Maarten Lankhorst,
	Maxime Ripard
  Cc: John Hubbard, Alistair Popple, 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
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.

The biggest difference since the previous revision is a fix for an issue
raised by Sashiko: with `CONFIG_MODVERSIONS`/`CONFIG_GENDWARFKSYMS`,
Kbuild would compute symbol CRCs from the generated
`nova_core_exports.o` C shim, whose declarations type every exported
Rust symbol as `extern int`. This makes the CRCs describe the shim
declarations rather than the actual Rust definitions, defeating
modversion checks for these exports.

The fix is to run `gendwarfksyms` on `nova_core.o`, so symbol versions
are derived from the Rust DWARF.

Also, the list of exported `nova-core` symbols is now limited to the
symbols actually referenced by `nova-drm`.

This series is based on `master`.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
Changes in v5:
- Drop patch inlining core Rust methods as it was picked up by rust-next.
- Drop `.gitignore` items already covered by parent directory. (thanks Miguel!)
- Reorder imports in last patch.
- Limit the list of exported symbols to those actually used by
  `nova-drm`.
- Fix Rust export CRC generation under `CONFIG_MODVERSIONS` by deriving
  symbol versions from `nova_core.o`'s DWARF instead of the generated C
  export shim. (reported by Sashiko)
- Link to v4: https://patch.msgid.link/20260605-nova-exports-v4-0-e948c287407c@nvidia.com

Changes in v4:
- Build nova-core and nova-drm from `drivers/gpu/Makefile`.
- Emit nova-core's crate metadata as a side-effect of its normal object
  build.
- Align more closely with the rules of `rust/Makefile`.
- Add `.gitignore` entries for generated files.
- Inline a few more Rust methods per Sashiko's recommendation.
- Drop a few `Reviewed-by`s as the implementation has changed
  significantly.
- Link to v3: https://patch.msgid.link/20260530-nova-exports-v3-0-1202aa339ef7@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):
      gpu: build nova-core and nova-drm from drivers/gpu/Makefile
      gpu: nova-core: export Rust symbols for nova-drm
      gpu: nova-core: emit Rust metadata for nova-drm
      gpu: drm: nova: depend on nova-core and use its symbols
      [POC] gpu: drm: nova: demonstrate interaction with nova-core

 drivers/gpu/Makefile                      | 58 +++++++++++++++++++++++++++++-
 drivers/gpu/drm/Makefile                  |  2 +-
 drivers/gpu/drm/nova/Makefile             |  4 +--
 drivers/gpu/drm/nova/driver.rs            |  9 ++++-
 drivers/gpu/nova-core/.gitignore          |  1 +
 drivers/gpu/nova-core/Makefile            |  4 +--
 drivers/gpu/nova-core/driver.rs           | 59 +++++++++++++++++++++++--------
 drivers/gpu/nova-core/gpu.rs              |  9 +++--
 drivers/gpu/nova-core/gsp/hal.rs          |  2 +-
 drivers/gpu/nova-core/nova_core.rs        |  4 +--
 drivers/gpu/nova-core/nova_core_exports.c | 15 ++++++++
 11 files changed, 138 insertions(+), 29 deletions(-)
---
base-commit: ef0c9f75a19532d7675384708fc8621e10850104
change-id: 20260430-nova-exports-502f996c5aab

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


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

end of thread, other threads:[~2026-06-29 10:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-22 13:30 [PATCH v5 0/5] gpu: drm: nova: enable calling into nova-core Alexandre Courbot
2026-06-22 13:30 ` [PATCH v5 1/5] gpu: build nova-core and nova-drm from drivers/gpu/Makefile Alexandre Courbot
2026-06-22 13:30 ` [PATCH v5 2/5] gpu: nova-core: export Rust symbols for nova-drm Alexandre Courbot
2026-06-22 13:30 ` [PATCH v5 3/5] gpu: nova-core: emit Rust metadata " Alexandre Courbot
2026-06-22 13:30 ` [PATCH v5 4/5] gpu: drm: nova: depend on nova-core and use its symbols Alexandre Courbot
2026-06-22 13:30 ` [PATCH POC v5 5/5] gpu: drm: nova: demonstrate interaction with nova-core Alexandre Courbot
2026-06-29 10:11 ` (subset) [PATCH v5 0/5] gpu: drm: nova: enable calling into nova-core Danilo Krummrich

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