Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ANDROID: binder: remove 32-bit binder interface.

New devices launching with Android P need to use the 64-bit
binder interface, even on 32-bit SoCs [0].

This change removes the Kconfig option to select the 32-bit
binder interface. We don't think this will affect existing
userspace for the following reasons:
1) The latest Android common tree is 4.14, so we don't
believe any Android devices are on kernels >4.14.
2) Android devices launch on an LTS release and stick with
it, so we wouldn't expect devices running on <= 4.14 now
to upgrade to 4.17 or later. But even if they did, they'd
rebuild the world (kernel + userspace) anyway.
3) Other userspaces like 'anbox' are already using the
64-bit interface.

Note that this change doesn't remove the 32-bit UAPI
itself; the reason for that is that Android userspace
always uses the latest UAPI headers from upstream, and
userspace retains 32-bit support for devices that are
upgrading. This will be removed as well in 2-3 years,
at which point we can remove the code from the UAPI
as well.

Finally, this change introduces build errors on archs where
64-bit get_user/put_user is not supported, so make binder
unavailable on m68k (which wouldn't want it anyway).

[0]: https://android-review.googlesource.com/c/platform/build/+/595193

Signed-off-by: Martijn Coenen <maco@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Martijn Coenen and committed by
Greg Kroah-Hartman
1190b4e3 176c2572

+1 -18
+1 -14
drivers/android/Kconfig
··· 10 10 11 11 config ANDROID_BINDER_IPC 12 12 bool "Android Binder IPC Driver" 13 - depends on MMU 13 + depends on MMU && !M68K 14 14 default n 15 15 ---help--- 16 16 Binder is used in Android for both communication between processes, ··· 31 31 that specifies the names of the binder device nodes that will be 32 32 created. Each binder device has its own context manager, and is 33 33 therefore logically separated from the other devices. 34 - 35 - config ANDROID_BINDER_IPC_32BIT 36 - bool "Use old (Android 4.4 and earlier) 32-bit binder API" 37 - depends on !64BIT && ANDROID_BINDER_IPC 38 - default y 39 - ---help--- 40 - The Binder API has been changed to support both 32 and 64bit 41 - applications in a mixed environment. 42 - 43 - Enable this to support an old 32-bit Android user-space (v4.4 and 44 - earlier). 45 - 46 - Note that enabling this will break newer Android user-space. 47 34 48 35 config ANDROID_BINDER_IPC_SELFTEST 49 36 bool "Android Binder IPC Driver Selftest"
-4
drivers/android/binder.c
··· 72 72 #include <linux/security.h> 73 73 #include <linux/spinlock.h> 74 74 75 - #ifdef CONFIG_ANDROID_BINDER_IPC_32BIT 76 - #define BINDER_IPC_32BIT 1 77 - #endif 78 - 79 75 #include <uapi/linux/android/binder.h> 80 76 #include "binder_alloc.h" 81 77 #include "binder_trace.h"