From: David Rheinsberg <david@readahead.eu>
To: rust-for-linux@vger.kernel.org
Cc: teg@jklm.no, Miguel Ojeda <ojeda@kernel.org>,
David Rheinsberg <david@readahead.eu>
Subject: [RFC 00/16] bus1: Capability-based IPC for Linux
Date: Tue, 31 Mar 2026 21:02:52 +0200 [thread overview]
Message-ID: <20260331190308.141622-1-david@readahead.eu> (raw)
Hi
A decade is gone, the ideas stayed the same. After roughly 10 years
we finally got around to write a new version of bus1, a
capability-based IPC system for linux. The core idea is still the same
as 10 years ago and you can find a good summary by Neil Brown on
LWN [1]. In the meantime, we have successfully introduced many of the
concepts of bus1 to Linux distributions (mostly as part of
`dbus-broker` [2]) and are convinced more than ever that we should move
forward with bus1. But for this initial submission I want to put focus
on the Rust integration.
(Patch #7 contains a man-page with a full introduction of all concepts
of bus1. I will refrain from copying it to this cover-letter.)
The biggest change is that we stripped everything down to the basics and
reimplemented the module in Rust. It is a delight not having to worry
about refcount ownership and object lifetimes, but at the cost of a
C<->Rust bridge that brings some challenges. For now, we settled on
boxing everything that is exposed to C, and calling bindgen manually,
but we would love to improve on several aspects of that in the future.
The bus1 UAPI has been stripped of any convenience helper, fast-path,
or more complex API extension (e.g., promise handles, oneshot handles,
unmanaged IDs, fd-passing, file-system handles,
streaming / flow-control, etc.). This does not mean that we do not want
them back, but they were not necessary and can be replaced with round
trips or other workarounds. Now we are left with the core of bus1, and
we believe it is much easier to understand and follow.
I am only sending this to Rust4Linux now, because I want to get feedback
on the Rust integration first. You are very much welcome to comment on
other parts, but those might be changing heavily depending on the
feedback on the Rust utilities. I will be sending the follow ups to
LKML proper and then shift focus to the UAPI and bus management.
The series can be split into the following parts:
#1 - 4: Small extension to `./rust/kernel/`, which we make use of later
on. These are small in size and should be easy to discuss
independently.
#5 - 7: Add basic module scaffolding, UAPI definitions, and a man-page
explaining the user-space API and intended behavior.
#8 -13: Rust utilities that will be used by the bus1 module, but are not
necessarily specific to bus1. A lot of this is about intrusive
data structures.
#14-16: Implement resource accounting and the bus1 core in Rust,
exposing a C API. Implement a character-device based UAPI in C.
I will gladly split the series in the future, if desired. But given that
r4l generally does not merge unused code, I can carry the utilities just
fine.
If you prefer browsing this online, you can find the series on
codeberg [3] and github [4].
You can also find me on the r4l zulip (@dvdhrm).
Let me know what you think!
Thanks
David
[1] https://lwn.net/Articles/697191/
[2] https://github.com/bus1/dbus-broker
[3] https://codeberg.org/bus1/linux/src/branch/pr/20260331
[4] https://github.com/bus1/linux/tree/pr/20260331
David Rheinsberg (16):
rust/sync: add LockedBy::access_mut_unchecked()
rust/sync: add Arc::drop_unless_unique()
rust/alloc: add Vec::into_boxed_slice()
rust/error: add EXFULL, EBADRQC, EDQUOT, ENOTRECOVERABLE
bus1: add module scaffolding
bus1: add the user-space API
bus1: add man-page
bus1/util: add basic utilities
bus1/util: add field projections
bus1/util: add IntoDeref/FromDeref
bus1/util: add intrusive data-type helpers
bus1/util: add intrusive single linked lists
bus1/util: add intrusive rb-tree
bus1/acct: add resouce accounting
bus1: introduce peers, handles, and nodes
bus1: implement the uapi
Documentation/bus1/bus1.7.rst | 319 ++++++
include/uapi/linux/bus1.h | 82 ++
init/Kconfig | 12 +
ipc/Makefile | 2 +-
ipc/bus1/Makefile | 29 +
ipc/bus1/acct.rs | 1792 +++++++++++++++++++++++++++++++++
ipc/bus1/bus.rs | 1510 +++++++++++++++++++++++++++
ipc/bus1/cdev.c | 1326 ++++++++++++++++++++++++
ipc/bus1/cdev.h | 35 +
ipc/bus1/lib.h | 202 ++++
ipc/bus1/lib.rs | 22 +
ipc/bus1/main.c | 41 +
ipc/bus1/util/convert.rs | 259 +++++
ipc/bus1/util/field.rs | 359 +++++++
ipc/bus1/util/intrusive.rs | 397 ++++++++
ipc/bus1/util/lll.rs | 378 +++++++
ipc/bus1/util/mod.rs | 94 ++
ipc/bus1/util/rb.rs | 1324 ++++++++++++++++++++++++
ipc/bus1/util/slist.rs | 677 +++++++++++++
rust/kernel/alloc/kvec.rs | 67 ++
rust/kernel/error.rs | 4 +
rust/kernel/sync/arc.rs | 21 +
rust/kernel/sync/locked_by.rs | 30 +
rust/kernel/sync/refcount.rs | 16 +
24 files changed, 8997 insertions(+), 1 deletion(-)
create mode 100644 Documentation/bus1/bus1.7.rst
create mode 100644 include/uapi/linux/bus1.h
create mode 100644 ipc/bus1/Makefile
create mode 100644 ipc/bus1/acct.rs
create mode 100644 ipc/bus1/bus.rs
create mode 100644 ipc/bus1/cdev.c
create mode 100644 ipc/bus1/cdev.h
create mode 100644 ipc/bus1/lib.h
create mode 100644 ipc/bus1/lib.rs
create mode 100644 ipc/bus1/main.c
create mode 100644 ipc/bus1/util/convert.rs
create mode 100644 ipc/bus1/util/field.rs
create mode 100644 ipc/bus1/util/intrusive.rs
create mode 100644 ipc/bus1/util/lll.rs
create mode 100644 ipc/bus1/util/mod.rs
create mode 100644 ipc/bus1/util/rb.rs
create mode 100644 ipc/bus1/util/slist.rs
--
2.53.0
next reply other threads:[~2026-03-31 19:05 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 19:02 David Rheinsberg [this message]
2026-03-31 19:02 ` [RFC 01/16] rust/sync: add LockedBy::access_mut_unchecked() David Rheinsberg
2026-03-31 19:29 ` Miguel Ojeda
2026-03-31 19:02 ` [RFC 02/16] rust/sync: add Arc::drop_unless_unique() David Rheinsberg
2026-03-31 19:02 ` [RFC 03/16] rust/alloc: add Vec::into_boxed_slice() David Rheinsberg
2026-03-31 19:28 ` Miguel Ojeda
2026-03-31 21:10 ` Gary Guo
2026-03-31 22:07 ` Danilo Krummrich
2026-04-01 9:28 ` David Rheinsberg
2026-03-31 19:02 ` [RFC 04/16] rust/error: add EXFULL, EBADRQC, EDQUOT, ENOTRECOVERABLE David Rheinsberg
2026-03-31 19:02 ` [RFC 05/16] bus1: add module scaffolding David Rheinsberg
2026-03-31 19:02 ` [RFC 06/16] bus1: add the user-space API David Rheinsberg
2026-03-31 19:02 ` [RFC 07/16] bus1: add man-page David Rheinsberg
2026-04-01 16:30 ` Jonathan Corbet
2026-04-01 18:01 ` David Rheinsberg
2026-04-01 18:06 ` David Rheinsberg
2026-04-04 15:30 ` Thomas Meyer
2026-03-31 19:03 ` [RFC 08/16] bus1/util: add basic utilities David Rheinsberg
2026-03-31 19:35 ` Miguel Ojeda
2026-04-01 11:05 ` David Rheinsberg
2026-04-01 11:25 ` Miguel Ojeda
2026-03-31 19:03 ` [RFC 09/16] bus1/util: add field projections David Rheinsberg
2026-03-31 19:38 ` Miguel Ojeda
2026-03-31 19:03 ` [RFC 10/16] bus1/util: add IntoDeref/FromDeref David Rheinsberg
2026-03-31 19:44 ` Miguel Ojeda
2026-03-31 19:03 ` [RFC 11/16] bus1/util: add intrusive data-type helpers David Rheinsberg
2026-03-31 19:03 ` [RFC 12/16] bus1/util: add intrusive single linked lists David Rheinsberg
2026-03-31 19:03 ` [RFC 13/16] bus1/util: add intrusive rb-tree David Rheinsberg
2026-03-31 19:43 ` Miguel Ojeda
2026-03-31 19:03 ` [RFC 14/16] bus1/acct: add resouce accounting David Rheinsberg
2026-03-31 19:03 ` [RFC 15/16] bus1: introduce peers, handles, and nodes David Rheinsberg
2026-03-31 19:03 ` [RFC 16/16] bus1: implement the uapi David Rheinsberg
2026-03-31 19:46 ` [RFC 00/16] bus1: Capability-based IPC for Linux Miguel Ojeda
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=20260331190308.141622-1-david@readahead.eu \
--to=david@readahead.eu \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=teg@jklm.no \
/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