From: Joel Fernandes <joelagnelf@nvidia.com>
To: linux-kernel@vger.kernel.org
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Danilo Krummrich" <dakr@kernel.org>,
"Dave Airlie" <airlied@redhat.com>,
"David Airlie" <airlied@gmail.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Simona Vetter" <simona@ffwll.ch>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Koen Koning" <koen.koning@linux.intel.com>,
"Nikola Djukic" <ndjukic@nvidia.com>,
"Alexandre Courbot" <acourbot@nvidia.com>,
"Philipp Stanner" <phasta@kernel.org>,
"Elle Rhumsaa" <elle@weathered-steel.dev>,
"Jonathan Corbet" <corbet@lwn.net>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Jani Nikula" <jani.nikula@linux.intel.com>,
"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
"Tvrtko Ursulin" <tursulin@ursulin.net>,
"Huang Rui" <ray.huang@amd.com>,
"Matthew Auld" <matthew.auld@intel.com>,
"Matthew Brost" <matthew.brost@intel.com>,
"Lucas De Marchi" <lucas.demarchi@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Helge Deller" <deller@gmx.de>,
"John Hubbard" <jhubbard@nvidia.com>,
"Alistair Popple" <apopple@nvidia.com>,
"Timur Tabi" <ttabi@nvidia.com>, "Edwin Peer" <epeer@nvidia.com>,
"Andrea Righi" <arighi@nvidia.com>,
"Andy Ritger" <aritger@nvidia.com>, "Zhi Wang" <zhiw@nvidia.com>,
"Balbir Singh" <balbirs@nvidia.com>,
alexeyi@nvidia.com, "Eliot Courtney" <ecourtney@nvidia.com>,
dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org,
linux-doc@vger.kernel.org, amd-gfx@lists.freedesktop.org,
intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
linux-fbdev@vger.kernel.org,
"Joel Fernandes" <joelagnelf@nvidia.com>
Subject: [PATCH v13 0/1] rust: interop: Add list module for C linked list interface
Date: Tue, 17 Mar 2026 16:17:09 -0400 [thread overview]
Message-ID: <20260317201710.934932-1-joelagnelf@nvidia.com> (raw)
The interop/list module provides Rust abstractions for iterating over C
list_head-based linked lists. The primary use-case right now is iterating
over GPU buddy allocator blocks.
This series provides the interop/list module required for GPU buddy bindings,
which is inturn required for nova-core memory memory management. This patch is
being sent separately from the rest of the patches (DRM buddy movement, GPU
buddy bindings, etc.) as it can go in independently.
The git tree with the patch can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/jfern/linux.git (tag: interop-v13-20260317)
Change log:
Changes from v12 to v13:
- Changed interop/mod.rs to interop.rs file name (Alex).
- Various lint and style corrections, corrected Miguel's Ack email address. (Miguel Ojeda).
Changes from v11 to v12:
- Renamed module from ffi/clist to interop/list, reflecting community feedback
that 'interop' better describes the purpose than 'ffi' (credit to Boqun for
starting this idea.)
- Updated MAINTAINERS entry from "RUST [FFI HELPER]" to "RUST [INTEROP]"
and updated git tree reference.
- Added Acked-by from Miguel.
Changes from v10 to v11:
- Sending only the ffi/clist patches separately from the rest of the
preparatory series, as these can go in independently.
- MAINTAINERS entry: Renamed from "RUST TO C LIST INTERFACES" to
"RUST [FFI HELPER]" with (CLIST) scope annotations for maintainers,
following Danilo's suggestion. Note: There is still an ongoing
discussion about the MAINTAINER file entry naming between Miguel and
Danilo: https://lore.kernel.org/all/DGJXYEXCYIII.Z6FOAA8YYMAZ@kernel.org/
- Updated clist.rs module documentation per Danilo's review: generalized
the FFI usage description and added explicit note directing Rust-only
users to kernel::list::List instead.
- Implemented suggestions from Alice related to safety of CList wrt
concurrent modifications.
- Removed unnecessary trailing comment markers from example imports.
- Added feature guard for offset_of_nested (Eliot).
Changes from v9 to v10:
- Combined clist/ffi patches into the larger "Preparatory patches for
nova-core memory management" series (8 patches total).
- Added new ffi module patch: Convert pub use to pub mod and create
rust/kernel/ffi/mod.rs to host clist as a sub-module.
- Moved clist from rust/kernel/clist.rs to rust/kernel/ffi/clist.rs.
- Added Reviewed-by and Acked-by tags from Gary and Daniel.
Changes from v8 to v9:
- Added nova-core Kconfig change to select GPU_BUDDY.
- Minor fixups.
Changes from v7 to v8:
- Various changes suggested by Danilo, Gary, Daniel. Added tags.
Changes from v6 to v7:
- Extracted clist and GPU buddy patches from the larger RFC v6 nova-core
memory management series into a standalone series.
- Changes based on suggestions by Gary and Dave.
Changes from v5 to v6:
- Part of the larger RFC v6 nova-core memory management series
(26 patches).
Changes from v4 to v5:
- Part of the larger RFC v5 nova-core memory management series
(6 patches).
Changes from v3 to v4:
- Combined the clist and DRM buddy series back together.
- Added Rust bindings for the GPU buddy allocator.
- Moved DRM buddy allocator one level up to drivers/gpu/ so it can be
used by GPU drivers (e.g. nova-core) that have non-DRM usecases.
Changes from v2 to v3:
- Consolidated 3 patches into a single patch.
Changes from v1 to v2:
- Dropped the DRM buddy allocator patches. Series now focuses solely on
the clist module.
- Dropped samples and added doctests.
- Added proper lifetime management similar to scatterlist.
Link to v12: https://lore.kernel.org/all/20260306203648.1136554-1-joelagnelf@nvidia.com/
Link to v11: https://lore.kernel.org/all/20260224222734.3153931-1-joelagnelf@nvidia.com/
Link to v10: https://lore.kernel.org/all/20260218205507.689429-1-joelagnelf@nvidia.com/
Link to v9: https://lore.kernel.org/all/20260210233204.790524-1-joelagnelf@nvidia.com/
Link to v8: https://lore.kernel.org/all/20260209214246.2783990-1-joelagnelf@nvidia.com/
Link to v7: https://lore.kernel.org/all/20260206004110.1914814-1-joelagnelf@nvidia.com/
Joel Fernandes (1):
rust: interop: Add list module for C linked list interface
MAINTAINERS | 8 +
rust/helpers/helpers.c | 1 +
rust/helpers/list.c | 17 ++
rust/kernel/interop.rs | 9 +
rust/kernel/interop/list.rs | 342 ++++++++++++++++++++++++++++++++++++
rust/kernel/lib.rs | 2 +
6 files changed, 379 insertions(+)
create mode 100644 rust/helpers/list.c
create mode 100644 rust/kernel/interop.rs
create mode 100644 rust/kernel/interop/list.rs
--
2.34.1
next reply other threads:[~2026-03-17 20:17 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-17 20:17 Joel Fernandes [this message]
2026-03-17 20:17 ` [PATCH v13 1/1] rust: interop: Add list module for C linked list interface Joel Fernandes
2026-03-17 20:18 ` Joel Fernandes
2026-03-17 20:20 ` Danilo Krummrich
2026-03-17 20:27 ` Joel Fernandes
2026-03-18 8:59 ` Alice Ryhl
2026-03-18 10:53 ` Alexandre Courbot
2026-03-18 10:59 ` Alice Ryhl
2026-03-18 14:30 ` Miguel Ojeda
2026-03-18 14:21 ` Miguel Ojeda
2026-03-18 14:31 ` Alice Ryhl
2026-03-18 14:41 ` Miguel Ojeda
2026-03-18 14:49 ` Danilo Krummrich
2026-03-18 18:57 ` Miguel Ojeda
2026-03-18 14:43 ` Danilo Krummrich
2026-03-18 13:31 ` Gary Guo
2026-03-18 17:58 ` Joel Fernandes
2026-03-18 9:10 ` Alice Ryhl
2026-03-18 18:55 ` Joel Fernandes
2026-03-18 12:40 ` Alice Ryhl
2026-03-18 14:03 ` Miguel Ojeda
2026-03-18 18:31 ` Joel Fernandes
2026-03-18 18:43 ` Joel Fernandes
2026-03-18 18:57 ` Miguel Ojeda
2026-03-18 19:24 ` Joel Fernandes
2026-03-19 11:59 ` Alexandre Courbot
2026-03-23 0:07 ` Alejandra González
2026-03-19 11:39 ` Gary Guo
2026-03-19 12:05 ` Danilo Krummrich
2026-03-19 12:21 ` Gary Guo
2026-03-19 12:51 ` Danilo Krummrich
2026-03-19 16:56 ` Joel Fernandes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260317201710.934932-1-joelagnelf@nvidia.com \
--to=joelagnelf@nvidia.com \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=airlied@redhat.com \
--cc=alex.gaynor@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=alexeyi@nvidia.com \
--cc=aliceryhl@google.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=apopple@nvidia.com \
--cc=arighi@nvidia.com \
--cc=aritger@nvidia.com \
--cc=balbirs@nvidia.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=christian.koenig@amd.com \
--cc=corbet@lwn.net \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=ecourtney@nvidia.com \
--cc=elle@weathered-steel.dev \
--cc=epeer@nvidia.com \
--cc=gary@garyguo.net \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=jhubbard@nvidia.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=koen.koning@linux.intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=lucas.demarchi@intel.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthew.auld@intel.com \
--cc=matthew.brost@intel.com \
--cc=mripard@kernel.org \
--cc=ndjukic@nvidia.com \
--cc=ojeda@kernel.org \
--cc=phasta@kernel.org \
--cc=ray.huang@amd.com \
--cc=rodrigo.vivi@intel.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=thomas.hellstrom@linux.intel.com \
--cc=tmgross@umich.edu \
--cc=ttabi@nvidia.com \
--cc=tursulin@ursulin.net \
--cc=tzimmermann@suse.de \
--cc=zhiw@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox