rust: rxarray: add rust xarray support
Subsystems (2)
RFC PATCH v2 1/1 rust: rxarray: add rust xarray support
From: Daniel Gomez <[email protected]>
Add Rust XArray support.
This is the Rust implementation of the XArray lib/xarray.c. As of now, it supports basic functionality: store, load, load_mut and erase.
---
As discussed at LPC26, this is the version of the Rust XArray that is ready to merge for testing and evaluating purposes following the Rust reference implementation rule (experimental) [1]. Next, we will make progress following the roadmap suggested in v1.
For the motivation, see v1 link below in the changelog.
A branch with the patches can be found here [2].
---
Changes in v2:
- Add Matthew Wilcox in the XARRAY RUST MAINTAINERS entry.
- Drop bench lib and xarray_benchmark_rust benchmark module to scope the series to the Rust XArray implementation only.
- Link to v1: https://patch.msgid.link/[email protected]
--- MAINTAINERS | 12 + lib/Kconfig | 11 + rust/kernel/lib.rs | 2 + rust/kernel/rxarray.rs | 1407 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1432 insertions(+)
MAINTAINERS +12 -0
@@ -29681,6 +29681,18 @@ C: https://rust-for-linux.zulipchat.com T: git https://github.com/Rust-for-Linux/linux.git xarray-next F: rust/kernel/xarray.rs +XARRAY [RUST] +M: Daniel Gomez <[email protected]> +M: Matthew Wilcox <[email protected]> +R: Andreas Hindborg <[email protected]> +L: [email protected] +S: Supported +W: https://rust-for-linux.com +B: https://github.com/Rust-for-Linux/linux/issues +C: https://rust-for-linux.zulipchat.com +T: git git://git.kernel.org/pub/scm/linux/kernel/git/da.gomez/linux.git rxarray-next +F: rust/kernel/rxarray.rs + XBOX DVD IR REMOTE M: Benjamin Valentin <[email protected]> S: Maintained
lib/Kconfig +11 -0
@@ -349,6 +349,17 @@ config XARRAY_MULTI Support entries which occupy multiple consecutive indices in the XArray. +config XARRAY_RUST + bool "Rust XArray (EXPERIMENTAL)" + depends on RUST + depends on EXPERT + help + This builds the Rust implementation of the XArray (kernel::rxarray). + It is an experimental reference implementation under evaluation and does + not yet cover every feature of the C XArray. + + If unsure, say N. + config ASSOCIATIVE_ARRAY bool help
rust/kernel/lib.rs +2 -0
@@ -122,6 +122,8 @@pub mod rbtree;pub mod regulator;pub mod revocable; +#[cfg( CONFIG_XARRAY_RUST )] +pub mod rxarray;pub mod safety;pub mod scatterlist;pub mod security;
rust/kernel/rxarray.rs new file +1407 -0
1,407 lines not on this page · raw message
---
base-commit: 4cfc5bf97cabf660c04b22ba933d198cc4aa98ec
change-id: 20260922-rxarray-next-f1912366209c
Best regards,
Signature · 1 line
Daniel Gomez <[email protected]>
Quoted 15 lines · Daniel Gomez
From: Daniel Gomez <[email protected]>
Add Rust XArray support.
This is the Rust implementation of the XArray
lib/xarray.c. As of now, it supports basic functionality: store, load,load_mutand erase.Reviewed-by Andreas Hindborg <[email protected]>Signed-off-by Daniel Gomez <[email protected]>---
As discussed at LPC26, this is the version of the Rust XArray that is ready to merge for testing and evaluating purposes following the Rust reference implementation rule (experimental) [1]. Next, we will make progress following the roadmap suggested in v1.
Quoted 6 lines
For the motivation, see v1 link below in the changelog.
A branch with the patches can be found here [2].
Quoted 16 lines · Matthew Wilcox
Quoted 15 lines · Daniel Gomez
From: Daniel Gomez <[email protected]>
Add Rust XArray support.
This is the Rust implementation of the XArray
lib/xarray.c. As of now, it supports basic functionality: store, load,load_mutand erase.Reviewed-by Andreas Hindborg <[email protected]>Signed-off-by Daniel Gomez <[email protected]>---
As discussed at LPC26, this is the version of the Rust XArray that is ready to merge for testing and evaluating purposes following the Rust reference implementation rule (experimental) [1]. Next, we will make progress following the roadmap suggested in v1.
Quoted 9 lines
Quoted 6 lines
For the motivation, see v1 link below in the changelog.
A branch with the patches can be found here [2].
Reviewed-by Matthew Wilcox (Oracle) <[email protected]>
Thanks, Matthew.
Following our discussion with Miguel at LPC, I'll send PRs for the Rust XArray to you, ie. the "PRs from their Rust sub-maintainer" option in [1] using my tree at kernel.org [2]. If that ever doesn't fit your schedule, the Rust for Linux tree takes them as fallback [3]. Note that the Rust tree follows its key cycle dates, i.e. the last version of a series should reach the list before -rc5 [4]. We have passed that date, (for R4L tree) but I'll send the PR anyway so you can pick up when ready.
And as I mentioned, I'm happy to take on more of the work if it helps.
[1] https://rust-for-linux.com/rust-kernel-policy#how-is-rust-introduced-in-a-subsystem
[2] https://git.kernel.org/pub/scm/linux/kernel/git/da.gomez/linux.git/log/?h=rxarray-next
[3] https://rust-for-linux.com/rust-kernel-policy#who-maintains-rust-code-in-the-kernel
[4] https://rust-for-linux.com/contributing#key-cycle-dates