[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250512095544.3334680-1-abdiel.janulgue@gmail.com>
Date: Mon, 12 May 2025 12:53:26 +0300
From: Abdiel Janulgue <abdiel.janulgue@...il.com>
To: dakr@...nel.org,
lyude@...hat.com
Cc: Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>,
Valentin Obst <kernel@...entinobst.de>,
linux-kernel@...r.kernel.org (open list),
Marek Szyprowski <m.szyprowski@...sung.com>,
Robin Murphy <robin.murphy@....com>,
airlied@...hat.com,
rust-for-linux@...r.kernel.org,
iommu@...ts.linux.dev (open list:DMA MAPPING HELPERS),
Petr Tesarik <petr@...arici.cz>,
Andrew Morton <akpm@...ux-foundation.org>,
Herbert Xu <herbert@...dor.apana.org.au>,
Sui Jingfeng <sui.jingfeng@...ux.dev>,
Randy Dunlap <rdunlap@...radead.org>,
Michael Kelley <mhklinux@...look.com>,
Abdiel Janulgue <abdiel.janulgue@...il.com>
Subject: [RFC PATCH 0/2] scatterlist rust bindings
Hi,
Here are the scatterlist bindings that has been brewing for a while in my
local tree while working with Nova code. The bindings are used mostly to
build the radix3 table from the GSP firmware which is loaded via dma.
This interface can be used on top of existing kernel scatterlist objects
or to allocate a new one from scratch.
Some questions still need to be resolved, which mostly come from
the DeviceSGTable::dma_map() function. Primarily, what if you call
bindings::dma_map_sgtable() on an already mapped sg_table? From my
experiments it doesn't seem to do anything and no indication is returned if
the call succeeded or not. Should we save the "mapping info" to a list
everytime we call DeviceSGTable::dma_map more than once?
Hoping this initial submission will generate some discussion. I'd like to
acknowledge valuable feedback from Danilo Krummrich and Lyude
Paul in shaping this up.
Abdiel Janulgue (2):
rust: add initial scatterlist bindings
samples: rust: add sample code for scatterlist bindings
rust/bindings/bindings_helper.h | 1 +
rust/helpers/helpers.c | 1 +
rust/helpers/scatterlist.c | 25 +++
rust/kernel/lib.rs | 1 +
rust/kernel/scatterlist.rs | 275 ++++++++++++++++++++++++++++++++
samples/rust/rust_dma.rs | 14 +-
6 files changed, 316 insertions(+), 1 deletion(-)
create mode 100644 rust/helpers/scatterlist.c
create mode 100644 rust/kernel/scatterlist.rs
base-commit: dd21715de3dfa6f6457432ce909e5f7eb142a7d2
--
2.43.0
Powered by blists - more mailing lists