Repository navigation
arm64: ctxr-execmem: keep an M4-generation boot CPU at EL2 from its first entry - #1184
Merged
RyanTheTide merged 1 commit intoNov 10, 2026
Conversation
…irst entry On a J616s (T6040) booted from a kcbz 0 boot object, Linux died before earlycon=efifb printed a line, through U-Boot's booti and through GRUB alike, with the image in the CTXR window. aura 1.0.0b7, U-Boot e1ef8b63 and GRUB all ran. The only kernel code before earlycon that is new under a window is the boot CPU's trip through EL1, which 46c5ae7 judged safe because CTXR_D_CTL_EL1 reads 0 on the T8140's boot CPU. The T6040's boot CPU, cpu@10100, also reads 0 there, so that value does not tell a confined core from a free one. Take the direct VHE entry on the boot CPU's first entry again when it is an Apple core with a part number from 0x50 that implements VHE, as 73b99c1 and a572073 did, without reading ctxr_stay_el2. Secondaries and resume keep reading the flag. This skips the boot CPU's EL1 phase on raw boots of those chips too, and with it the VHE overrides (kvm-arm.mode=nvhe/protected, id_aa64mmfr1.vh=0), which 46c5ae7 kept: this early the boot CPU can't tell whether it is in a window. Tested on a J616s with aura 1.0.0b7's Mach-O Stage 1 and U-Boot booti: the window at 0x10006c00000 (128 MiB), 14 CPUs started at EL2, boot verify 968 executable mappings and 0 violations (ctxr_exec_enforce=0), and the Apple TSO cpucap detected. The same kernel without this commit died before earlycon on that chain. On the raw Stage 1 it also brings up all 14 CPUs at EL2. Fixes: 46c5ae7 ("arm64: ctxr-execmem: keep the boot CPU on the usual entry path") Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com> Assisted-by: LLM
RyanTheTide
pushed a commit
to aurora-silicon/aura
that referenced
this pull request
Nov 9, 2026
A J616s (M4 Pro) now runs Linux as a daily install from a padded 1.0.0b7 Mach-O Stage 1. Write down what that settles: iBoot starts the T6040 on cpu@10100, all 14 CPUs come up at EL2 in an enforced 128 MiB window, KVM runs guests, Apple TSO works and restart works. Also note that the kernel needs aurora-silicon/linux#1184 on that chip. Also document a trap found on the same Mac. Enrolling the Mach-O object turned Kernel CTRR back on in the LocalPolicy, which had been set up with it off. The raw Stage 1 enrolled after it then came up on one CPU, because iBoot armed CTXR_D from the device tree to the load base. bputil -nc before the raw enrolment brought all 14 back. Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com> Assisted-by: LLM
RyanTheTide
added a commit
that referenced
this pull request
Nov 9, 2026
RyanTheTide
merged commit Nov 10, 2026
aba667e
into
aurora-silicon:integration/aurora
1 check passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a J616s (MacBook Pro M4 Pro, T6040) booted from a kcbz 0 boot object (#985, U-Boot #32/#36, aura 1.0.0b7), the kernel died before
earlycon=efifbprinted anything. That happened through U-Bootbootiand through GRUB alike. aura, U-Boot and GRUB all ran, and the image was in the window. The only code before earlycon that is new under a window is the boot CPU's trip through EL1, which 46c5ae7 kept becauseCTXR_D_CTL_EL1reads 0 on the T8140's boot CPU. The T6040's boot CPU (cpu@10100) also reads 0, so that value doesn't show whether a core is confined.This puts back the direct VHE entry for the boot CPU's first entry on Apple cores from part number 0x50 that implement VHE, as 73b99c1 and a572073 had it. It doesn't read
ctxr_stay_el2, because the flag isn't set yet at that point. Secondaries and resume still read the flag. The documentation paragraph about the entry path is updated to match.Trade-off
This re-opens the two points 46c5ae7 fixed, for the boot CPU of those chips only. A kernel with the option and no window now enters differently from one without it, and
kvm-arm.mode=nvhe/protectedandid_aa64mmfr1.vh=0no longer move that boot CPU off VHE. At first entry the boot CPU can't tell whether it is in a window, because the window comes from the DT, and on the T6040 the register 46c5ae7 relied on doesn't tell either. If you'd rather key this on something else, I can test it on this machine.Testing (J616s, our tree with #985 and #1079 at the same head.S)
booti:0x10006c00000(128 MiB) and 14 CPUs started at EL2.ctxr_exec_enforce=0.CPU features: detected: TSO memory model (Apple), andPR_SET_MEM_MODELreports TSO enabled.ACTLR_EL1bit 1 is writable on P and E cores.bootiand once through GRUB.57c6874a6ec9, plus the doc paragraph.🤖 Generated with Claude Code