Repository navigation
arm64: user4k: turn 4K userspace on by default, keep user4k=off - #2731
Conversation
Commit 1705968 ("arm64: user4k: keep 4K userspace off unless booted with user4k=on") made the per-process user granule an opt-in while it had been tested only on the J700. Since then every Aurora distribution boots every supported Mac with user4k=on: Fedora's kiwi images and aurora-userpages' %posttrans, Arch's /etc/default/grub.d/50-aurora-user4k.cfg and NixOS's aurora.userpages module all add it, and the lab fleet (M1 Pro, M2, J616s, Neo) runs with it. The option that decides the behaviour of every shipped system should be the kernel's default, not a command-line knob each distribution has to add. Initialise arm64_user4k_on to true. The early parameter is unchanged: user4k=off (or 0/n) still turns the feature off for that boot, with the same effects as before (the page-size prctls refuse non-native sizes, every exec gets the native granule, no 4K user granule capability is detected and the page_ext record is not reserved). user4k=on stays accepted and is now a no-op. The decision is still per CPU capability: a CPU without the 4K translation granule gets no alternative, as before. Update the comments, Kconfig help, kernel-parameters.txt, user4k.rst, user_page_size.rst and the userpages launcher's hint and README to describe user4k=off as the switch. The userpages launcher's hint names both causes of EINVAL: a kernel booted with user4k=off and one built without the per-process granule support. Signed-off-by: Ryan Murray <[email protected]>
|
Same code as #2272 (only comment/help-text wording differs; compared patch by patch), so the hardware rows posted there apply: #2272 (comment) (booted without any |
|
user4k=off row, 13-inch M4 MacBook Air (J713, T8132, 27.2 stub), the default kernel (which carries this change) with |
|
Merge-train adversarial review (MERGETRAIN-LINUX2) at 36e4785: NO BLOCKERS. Code read only, nothing built here. Before the merge it still needs Dj's verdict at this head; the missing rows are listed below. Full review#2731 arm64: user4k: turn 4K userspace on by default, keep user4k=off @36e4785aVERDICT: NO BLOCKERS The code change is one line, arch/arm64/mm/context.c:48 Things I checked that do not break:
Nits:
Missing rows:
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed at live head 36e4785abf6387974a84e94a59ff550af7e0fc47 against all 6 sections of pre-pr-checklist.md. 0 code/policy/attribution/CI blockers; approved for merge.
Verified
- §1–§2 Default cmdline & CPU-capability gating: Single-line functional change (
bool arm64_user4k_on __ro_after_init = true;inarch/arm64/mm/context.c:48) removes the mandatoryuser4k=oncmdline knob while preservinguser4k=off(0/n) viakstrtobool()and CPU-capability gating (ID_AA64MMFR0_EL1.TGran4/ARM64_HAS_USER4K_GRANULE). No chip/board/firmware gates. - §3 Correctness across configs/arches:
- Scoped to
CONFIG_ARM64_USER4K_EXPERIMENTAL(arm64 16K/64K kernels); 4K arm64 kernels and other architectures are unaffected. - Confirmed every reader of
user4k_enabled()/arch_mm_alt_granule_enabled()(has_user4k_granule,has_user16k_granule,subpage_ext_needed,arch_mm_init_exec,arm64_bprm_prepare_mm,arch_exec_page_size_shift) runs afterparse_early_param(). - Confirmed all 30 in-tree
user4k=onreferences across docs, Kconfig, comments, KUnit tests, andtools/aurora-userpagesare updated, and the#2272review nits (Kconfig.debugline reflow anduserpages.coff_hint()naming bothuser4k=offand not built in) are resolved.
- Scoped to
- §4 Clean-room & attribution: Commit
36e4785abf63has human author/committer (Ryan Murray <[email protected]>) and humanSigned-off-by:only (#2272'sCo-Authored-By:trailer is removed); PR body includesAssisted-by:. - §5 Evidence & CI: All 7 CI checks (
host-tests,source,rust-build,kunit, and all 3 DWC3/ATC build configurations) are green on36e4785abf63. Hardware evidence covers both items requested on#2272:user4k=offopt-out row on J713 (M4 Air, T8132, 27.2 stub):userpages 4k truereturnsEINVAL; default boot (nouser4k=) runsuserpages 4k truecleanly.- Identical code diff to
#2272proven across 4 SoC generations withoutuser4k=(userpages 4k trueOK on T6000 M1 Pro, T8112 M2 Air, T8132 M4 Air, T8140 MacBook Neo; plus T6040 M4 Pro and T8122 M3 Air booted cleanly; SELinux enforcing, 0 AVC, 0 failed units, 0 oops, s2idle 2/2, dEQP-VK 16,541 smoke unchanged).
- §6 Naming: Clean.
Non-blocking nits
arch/arm64/Kconfig.debug:74-75andarch/arm64/mm/user4k-test.c:14769:"with it"is slightly ambiguous;"with user4k=off"would be clearer.mm/user-subpage.c:74: comment line slightly exceeds 80 columns.- Optionally record
userpages 4k trueon T6040/T8122 and an arm64 QEMU KUnit run (arm64-user4k-policywithuser4k=off) as follow-up coverage.
Assisted-by: LLM (Gemini 4 Neon)
Problem
4K userspace for x86 and 4K-page programs (FEX, aurora-userpages) needs
user4k=onon every kernel command line. Every distribution and every lab Mac adds it, so the behaviour of every shipped system depends on a command-line knob.Change
arm64_user4k_onnow starts true.user4k=off(or 0/n) still turns the feature off for a boot, with the same effects as before;user4k=onis accepted and does nothing. The decision is still per CPU capability. Kconfig help, kernel-parameters.txt, user4k.rst, user_page_size.rst and the userpages launcher's hint describeuser4k=offas the switch; the hint names both causes of EINVAL (booted withuser4k=off, or not built in).This replaces #2272 with the same code change, the review nits fixed (hint text, Kconfig help reflowed) and a commit that carries only the human sign-off.
Testing
user4k=argument;userpages 4k trueruns, on three kernels built from integration/aurora plus open PRs (boots on 11-22), including the current default.user4k=argument,userpages 4k trueOK; the M4 Pro (T6040) and M3 Air (T8122) booted without it.user4k=offfor one boot:userpages 4k truefails with EINVAL.Still to run
userpages 4k trueon the M4 Pro (T6040) and M3 Air (T8122), booted withoutuser4k=(booted, not run).Assisted-by: LLM (Claude:Opus 5.5)