binder: rm -f binder.c
Subsystems (3)
Carlos Llamas
maintainerPATCH 1/1 binder: rm -f binder.c
The day has finally come. We are dropping the legacy C implementation of the Binder IPC driver in favor of its Rust version.
For 15+ years, the C driver has grown increasingly complex, making it incredibly painful to maintain and land new features without tripping over vulnerabilities. The Rust implementation alleviates most of these issues, so it's time for a change.
Alice Ryhl has worked hard on the Rust binder for the past couple of years, not only achieving full feature parity but also proving that it can match and often beat the performance of the C counterpart. Having run successfully on Android devices for some time now, we can no longer call this an "experiment".
It's time to move on, yank the C code, and focus all new features and optimizations on the Rust driver.
Long live the new Rust Binder king!
--- drivers/android/Kconfig | 39 +- drivers/android/Makefile | 5 +- drivers/android/binder.c | 7186 ----------------- drivers/android/binder/Makefile | 4 +- drivers/android/binder/rust_binder_main.rs | 2 +- drivers/android/binder/rust_binderfs.c | 2 +- drivers/android/binder_alloc.c | 1409 ---- drivers/android/binder_alloc.h | 189 - drivers/android/binder_internal.h | 597 -- drivers/android/binder_netlink.c | 32 - drivers/android/binder_netlink.h | 21 - drivers/android/binder_trace.h | 448 - drivers/android/binderfs.c | 786 -- drivers/android/dbitmap.h | 169 - drivers/android/tests/.kunitconfig | 7 - drivers/android/tests/Makefile | 6 - drivers/android/tests/binder_alloc_kunit.c | 572 -- rust/bindings/bindings_helper.h | 2 +- .../filesystems/binderfs/binderfs_test.c | 2 +- .../selftests/filesystems/binderfs/config | 1 - 20 files changed, 9 insertions(+), 11470 deletions(-) delete mode 100644 drivers/android/binder.c delete mode 100644 drivers/android/binder_alloc.c delete mode 100644 drivers/android/binder_alloc.h delete mode 100644 drivers/android/binder_internal.h delete mode 100644 drivers/android/binder_netlink.c delete mode 100644 drivers/android/binder_netlink.h delete mode 100644 drivers/android/binder_trace.h delete mode 100644 drivers/android/binderfs.c delete mode 100644 drivers/android/dbitmap.h delete mode 100644 drivers/android/tests/.kunitconfig delete mode 100644 drivers/android/tests/Makefile delete mode 100644 drivers/android/tests/binder_alloc_kunit.c
drivers/android/Kconfig +2 -37
@@ -5,6 +5,7 @@ config ANDROID_BINDER_IPC bool "Android Binder IPC Driver" depends on MMU depends on NET + depends on RUST default n help Binder is used in Android for both communication between processes,
@@ -14,34 +15,9 @@ config ANDROID_BINDER_IPC Android process, using Binder to identify, invoke and pass arguments between said processes. -config ANDROID_BINDER_IPC_RUST - bool "Rust version of Android Binder IPC Driver" - depends on RUST && MMU && NET && !ANDROID_BINDER_IPC - help - This enables the Rust implementation of the Binder driver. - - Binder is used in Android for both communication between processes, - and remote method invocation. - - This means one Android process can call a method/routine in another - Android process, using Binder to identify, invoke and pass arguments - between said processes. - -config ANDROID_BINDERFS - bool "Android Binderfs filesystem" - depends on ANDROID_BINDER_IPC - default n - help - Binderfs is a pseudo-filesystem for the Android Binder IPC driver - which can be mounted per-ipc namespace allowing to run multiple - instances of Android. - Each binderfs mount initially only contains a binder-control device. - It can be used to dynamically allocate new binder IPC devices via - ioctls. - config ANDROID_BINDER_DEVICES string "Android Binder devices" - depends on ANDROID_BINDER_IPC || ANDROID_BINDER_IPC_RUST + depends on ANDROID_BINDER_IPC default "binder,hwbinder,vndbinder" help Default value for the binder.devices parameter.
@@ -51,15 +27,4 @@ config ANDROID_BINDER_DEVICES created. Each binder device has its own context manager, and is therefore logically separated from the other devices. -config ANDROID_BINDER_ALLOC_KUNIT_TEST - tristate "KUnit Tests for Android Binder Alloc" if !KUNIT_ALL_TESTS - depends on ANDROID_BINDER_IPC && KUNIT - default KUNIT_ALL_TESTS - help - This feature builds the binder alloc KUnit tests. - - Each test case runs using a pared-down binder_alloc struct and - test-specific freelist, which allows this KUnit module to be loaded - for testing without interfering with a running system. - endmenu
drivers/android/Makefile +1 -4
@@ -1,7 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only ccflags-y += -I$(src) # needed for trace events -obj-$(CONFIG_ANDROID_BINDERFS) += binderfs.o -obj-$(CONFIG_ANDROID_BINDER_IPC) += binder.o binder_alloc.o binder_netlink.o -obj-$(CONFIG_ANDROID_BINDER_ALLOC_KUNIT_TEST) += tests/ -obj-$(CONFIG_ANDROID_BINDER_IPC_RUST) += binder/ +obj-$(CONFIG_ANDROID_BINDER_IPC) += binder/
drivers/android/binder.c deleted +0 -7186
2,935 lines not on this page · raw message
drivers/android/binder/rust_binder_main.rs +1 -1
Lines of this file are not shown. View the raw message.
drivers/android/binder_alloc.c deleted +0 -1409
1,409 lines not on this page · raw message
drivers/android/binder_alloc.h deleted +0 -189
189 lines not on this page · raw message
drivers/android/binder_internal.h deleted +0 -597
597 lines not on this page · raw message
drivers/android/binder_netlink.c deleted +0 -32
Lines of this file are not shown. View the raw message.
drivers/android/binder_netlink.h deleted +0 -21
Lines of this file are not shown. View the raw message.
drivers/android/binder_trace.h deleted +0 -448
448 lines not on this page · raw message
drivers/android/binderfs.c deleted +0 -786
786 lines not on this page · raw message
drivers/android/dbitmap.h deleted +0 -169
169 lines not on this page · raw message
drivers/android/tests/.kunitconfig deleted +0 -7
Lines of this file are not shown. View the raw message.
drivers/android/tests/binder_alloc_kunit.c deleted +0 -572
572 lines not on this page · raw message
tools/testing/selftests/filesystems/binderfs/binderfs_test.c +1 -1
Lines of this file are not shown. View the raw message.
tools/testing/selftests/filesystems/binderfs/config +0 -1
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.55.0.1007.g17ff1f9808-goog
Part of the diff is not shown here. View the raw message.
Greg Kroah-Hartman
maintainerQuoted 36 lines · Carlos Llamas
The day has finally come. We are dropping the legacy C implementation of the Binder IPC driver in favor of its Rust version.
For 15+ years, the C driver has grown increasingly complex, making it incredibly painful to maintain and land new features without tripping over vulnerabilities. The Rust implementation alleviates most of these issues, so it's time for a change.
Alice Ryhl has worked hard on the Rust binder for the past couple of years, not only achieving full feature parity but also proving that it can match and often beat the performance of the C counterpart. Having run successfully on Android devices for some time now, we can no longer call this an "experiment".
It's time to move on, yank the C code, and focus all new features and optimizations on the Rust driver.
Long live the new Rust Binder king!
Acked-by Alice Ryhl <[email protected]>Signed-off-by Carlos Llamas <[email protected]>--- drivers/android/Kconfig | 39 +- drivers/android/Makefile | 5 +- drivers/android/binder.c | 7186 ----------------- drivers/android/binder/Makefile | 4 +- drivers/android/binder/rust_binder_main.rs | 2 +- drivers/android/binder/rust_binderfs.c | 2 +- drivers/android/binder_alloc.c | 1409 ---- drivers/android/binder_alloc.h | 189 - drivers/android/binder_internal.h | 597 -- drivers/android/binder_netlink.c | 32 - drivers/android/binder_netlink.h | 21 - drivers/android/binder_trace.h | 448 - drivers/android/binderfs.c | 786 --
Quoted 8 lines
drivers/android/dbitmap.h | 169 - drivers/android/tests/.kunitconfig | 7 - drivers/android/tests/Makefile | 6 - drivers/android/tests/binder_alloc_kunit.c | 572 -- rust/bindings/bindings_helper.h | 2 +- .../filesystems/binderfs/binderfs_test.c | 2 +- .../selftests/filesystems/binderfs/config | 1 - 20 files changed, 9 insertions(+), 11470 deletions(-)
Yeah!!!
Great job everyone on this, I'll queue this up this week when I catch up on pending binder fixes/patches...
thanks,
greg k-h