Skip to content

docs(standards): binder runtime layering, bitness & kernel requirements (#662) - #663

Closed
Ulrond wants to merge 4 commits into
developfrom
feature/662-binder-bitness-layering
Closed

docs(standards): binder runtime layering, bitness & kernel requirements (#662)#663
Ulrond wants to merge 4 commits into
developfrom
feature/662-binder-bitness-layering

Conversation

@Ulrond

@Ulrond Ulrond commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Part of #662.

Adds docs/standards/binder_runtime_and_bitness.md documenting the MW/vendor binder architecture:

  • Each layer ships its own bitness-matched libbinder — MW 32-bit (TARGET_LIB32_VERSION=ON), vendor at its own bitness — and they communicate over the kernel binder driver (IPC), which bridges 32/64. In-process linking can't cross ELF bitness, so the cross-bitness split is necessarily an IPC boundary.
  • Bitness rule table (in-process vs cross-layer) and the kernel-bitness-independence note.
  • Kernel requirements — binder config, device node (binderfs ≥5.0 vs static), 32-bit-userspace-on-64-bit-kernel compat path, stable protocol version.
  • A placeholder for the minimum-kernel feature matrix, to be pinned from the libbinder feature audit (in progress under Binder runtime: MW and vendor must ship separate bitness-matched binders; define kernel feature/version floor #662).

Wired into the mkdocs nav under Standards.

Follow-up commit will fill the feature matrix once the AOSP-13 libbinder ioctl audit completes.

…ts (#662)

Document the MW/vendor binder architecture: each layer builds and ships its
own bitness-matched libbinder (MW 32-bit via TARGET_LIB32_VERSION, vendor at
its own bitness) and they communicate over the kernel binder driver (IPC),
which bridges 32/64 — because in-process linking cannot cross ELF bitness.
Covers the bitness rule, kernel config/device-node (binderfs >=5.0 vs static),
32-bit-userspace-on-64-bit-kernel compat, and a placeholder for the pinned
minimum-kernel feature matrix (tracked by the #662 libbinder audit).
Copilot AI review requested due to automatic review settings June 30, 2026 17:20
@github-project-automation github-project-automation Bot moved this to Architecture Review Required in halif_aidl Jun 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Standards document to clarify how Binder userspace runtimes are delivered across independently mounted MW (/mw) and vendor (/vendor) layers when their processes may differ in bitness, and summarizes the related kernel provisioning expectations. The page is integrated into the MkDocs navigation so it appears under Hardware Abstraction Layer → Standards.

Changes:

  • Added docs/standards/binder_runtime_and_bitness.md documenting MW/vendor Binder runtime layering, cross-bitness IPC boundary, and kernel requirements.
  • Wired the new document into the MkDocs nav under Standards.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
mkdocs.yml Adds the new “Binder Runtime & Bitness” page to the Standards nav.
docs/standards/binder_runtime_and_bitness.md New standards documentation describing Binder runtime layering/bitness and kernel provisioning guidance.

Comment on lines +42 to +46
```text
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder" # static device nodes
CONFIG_ANDROID_BINDERFS=y # kernels >= 5.0 (binderfs)
```
CONFIG_ANDROID_BINDERFS=y # kernels >= 5.0 (binderfs)
```

- **Device node.** The runtime opens `/dev/binder`. On kernels **≥ 5.0** this may be provided via **binderfs** (`mount -t binder binder /dev/binderfs`); on earlier kernels it is a **static device node** created from `CONFIG_ANDROID_BINDER_DEVICES`.
…sion (#662)

The supported floor is kernel 4.9 (hard requirement), through 5.16+. Record
that the AOSP-13 libbinder runtime degrades gracefully across the range
(newer ioctls are guarded), and that the real constraint is protocol-version
/ struct-ABI match. Flag that native.patch currently disables the pre-5.16
fallback definitions and breaks 4.9 builds (linux_binder_idl#35), and that
Docker cannot test kernel versions — verification needs a QEMU/KVM matrix.
Normalised tables.
Make explicit that static binder device nodes (CONFIG_ANDROID_BINDER_DEVICES)
and binderfs (>=5.0) are ALTERNATIVE provisioning routes, not both required;
and that binderfs creates the node under its mount (e.g. /dev/binderfs/binder)
which the platform symlinks to /dev/binder.
Copilot AI review requested due to automatic review settings June 30, 2026 21:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment on lines +73 to +76
## Supported kernel range

**The supported floor is kernel 4.9**, through 5.16 and later.

| All-32-bit userspace | 32-bit | 32-bit | 7 | `BINDER_IPC_32BIT=1` | `CONFIG_ANDROID_BINDER_IPC_32BIT=y` |
| Mixed (32-bit MW + 64-bit vendor) | 32-bit | 64-bit | 8 | 32-bit compile, `BINDER_IPC_32BIT` unset | `CONFIG_ANDROID_BINDER_IPC_32BIT` unset |

> **Build gap.** linux_binder_idl currently couples `TARGET_LIB32_VERSION=ON` to `-DBINDER_IPC_32BIT=1` (`CMakeLists.txt:702-707`), so it can only produce the **protocol-7** 32-bit build. The **mixed** configuration needs a 32-bit compile with **protocol 8** (`BINDER_IPC_32BIT` unset). Decoupling the compile bitness from the protocol flag is tracked in linux_binder_idl#35. Until then, a 32-bit MW cannot share a kernel with a 64-bit vendor.
The upstream AOSP `android-13.0.0_r74` libbinder runtime works across this range: nothing it uses unconditionally is newer than the range, and newer ioctls (process-freeze ~5.10, oneway-spam-detection ~5.11) are runtime-guarded, so on older kernels they degrade non-fatally — `BINDER_SET_CONTEXT_MGR_EXT` (~4.19) falls back to `BINDER_SET_CONTEXT_MGR`, freeze/node-info ioctls return errors only to explicit opt-in callers, and the binderfs probe returns false. The governing constraint is **protocol-version + struct-ABI match**, not individual ioctl availability — libbinder hard-fails the driver open if the kernel's `BINDER_VERSION` is not exactly its own.

!!! warning "Port patch must honour the 4.9 floor"
`native.patch` currently disables the pre-5.16 fallback definitions in `binder_module.h` on a "require 5.16+" assumption, which **breaks builds against 4.9 kernel headers**. The fallback shims must be restored so the runtime builds against both old and new headers — tracked in linux_binder_idl#35.
#662)

Fully qualify + link the external references so they resolve in MkDocs:
linux_binder_idl repo, its CMakeLists.txt coupling, native.patch (which lives
in linux_binder_idl, not this repo), and linux_binder_idl#35. The kernel-4.9
floor is intentional (per the agreed decision); the migration-guide.md '5.10+'
Copilot flagged is illustrative example content (a fictional 'Boot HAL v3
Release Notes' block), not a repo baseline — left unchanged.
@Ulrond Ulrond self-assigned this Jul 3, 2026
@Ulrond Ulrond added this to the Next Release milestone Jul 3, 2026
@Ulrond Ulrond moved this from Architecture Review Required to Under Review in halif_aidl Jul 4, 2026
@Ulrond

Ulrond commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

Relocated to linux_binder_idl — this is a binder build/runtime topic (per-layer libbinder build, bitness, protocol version, kernel range), so it belongs with the binder toolchain, not rdk-halif-aidl standards docs. Folded into linux_binder_idl/BUILD.md via rdkcentral/linux_binder_idl#44 (issue rdkcentral/linux_binder_idl#43), on the 2.5.0 milestone. The mixed protocol-8 build gap is now tracked properly in rdkcentral/linux_binder_idl#42. Closing here.

@Ulrond Ulrond closed this Jul 4, 2026
@Ulrond
Ulrond deleted the feature/662-binder-bitness-layering branch July 4, 2026 08:07
@github-project-automation github-project-automation Bot moved this from Under Review to Resolved in halif_aidl Jul 4, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Status: Resolved

Development

Successfully merging this pull request may close these issues.

2 participants