Skip to content

kboot: give the J616s the J614s camera and SEP handoff - #293

Merged
RyanTheTide merged 10 commits into
aurora-silicon:mainfrom
scottjones:upstream/j616s-isp-sep-handoff
Nov 30, 2026
Merged

RyanTheTide merged 10 commits into
aurora-silicon:mainfrom
scottjones:upstream/j616s-isp-sep-handoff

Conversation

@scottjones

@scottjones scottjones commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

The 16" M4 Pro (J616s) shares the J614s ISP description (t604x-j614-j616.dtsi), but only the J614s got the handoff that fills it from this boot's ADT. A J616s booted with the tree's static segment addresses, which came from one 26.6.2 boot. iBoot moves the segments: on our J616s the ISP text was at 0x10000c34000, not 0x10000c44000. The kernel mapped the wrong memory, the ISP never came up ("never received first magic number from firmware"), and the static ranges overlapped iBoot's other reservations.

On some boots iBoot also puts the RTKit buddy segment (the DCP __OS_LOG buffers and the AOP segment) inside the SEP firmware range, so the kernel warns that sep-firmware and the dcp-oslog nodes overlap. Main splits the SEP reservation around them on the J614s only.

Both handoffs now follow what the tree and the ADT show, not a board list:

 dt_set_isp_fwdata()
-  ISP found by the isp alias only (J616s tree has none: "'isp' not found")
+  no isp alias: the one node whose first memory region is isp-firmware-text
 kboot_prepare_dt()
-  J614s: dt_split_j614s_sep_reservations()
+  every tree: dt_split_sep_reservations()
+    no sep-firmware: nothing to do (0)
+    ADT /chosen/memory-map RTBuddySeg not inside SEPFW, or /arm-io/sep sepfw-booted not set:
+      sep-firmware left whole, with a line saying why (0)
+    ADT shows the warm range shared: split it around the no-map DCP OS logs and coprocessor firmware in it
+    anything it does not expect when a split is due: refuse, and the handoff fails (-1)
+    a sep-firmware it cannot read at all: refuse on any tree (-1)

The split is gated on two ADT facts, not on the board: the RTKit buddy segment lies inside the SEP firmware range (shared), and iBoot has already booted the SEP from it (warm). Without both, the SEP may still need its firmware there, so the reservation stays whole. On the J614s this matches main when the ADT shows the overlap, including an AOP segment on its own.

The SEP node is found through the sep alias, as dt_set_sep() does, not at the T6040 path. On the T8132 trees (J604, J623, J624, J713, J715), which also have the ISP placeholders and no alias, the ISP is disabled in the tree, so the fill does nothing there. The only change is that apple,firmware-version and apple,firmware-compat now go on that disabled node.

Tested: J616s one-shot ESP Stage 2 at 8d358c4: ISP filled from the ADT, apple-isp bound, 1080p NV12 stream (60 frames), SEP left whole per the ADT (RTBuddySeg below SEPFW on this boot), apple_sep up, Touch ID sensor bound, 0 reserved-memory overlaps, Enforcing, 0 AVCs, 0 failed units; default restored. Host: full pytest 1660 passed; clang/gcc 2.42/fedora Stage 1 and ESP Stage 2 size checks pass. J614s row not run (no J614s in our lab).
Risk: two-way door. The ISP fill affects the J616s. The SEP split now runs only where the live ADT shows the buddy segment inside a booted SEP's firmware range, on any SoC; there, a tree the split does not expect fails the handoff. On every Mac with a SEP reservation, a sep-firmware node the code cannot read at all fails the handoff; dt_set_sep() always writes it in the readable shape.

Evidence
  • test_sep_dcp_log_split.py runs the split and its call in kboot_prepare_dt() on trees built in the loader's shape, with the ADT facts it reads. It covers the J616s layout of a 26.6.2 boot (one retained range after three OS logs and the AOP segment), several OS logs, an AOP segment alone, a SEP node found through its alias, and the ADT cases that keep the range whole (RTBuddySeg ending at SEPFW as on a 27.0 J616s boot, no RTBuddySeg, the all-ones value, SEP not booted). Trees with nothing to do come out byte-identical. Refused trees fail the handoff and are unchanged.
  • Live 27.x ADTs (J413, J473, J615, J616s, J713) have sepfw-booted = 1 and RTBuddySeg at or below SEPFW (J413: none), so the split does not run on them. The 26.6.2 J616c tree has RTBuddySeg running into SEPFW.
  • test_t6041_isp_handoff.py covers the J616s tree shape without the alias. It is filled, a refused fill disables that ISP, and a second node taking the text placeholder leaves it untouched.
  • J616s row: traces/boot/20261201-293-j616s (lab store).

Merge Danger

Door: two-way.

Blast Radius: M4 Pro boot (J614s, J616s), plus any Mac whose ADT puts the RTKit buddy segment inside a booted SEP's firmware range.

A wrong address on a J616s would cost the camera on that board until reverted. A refused SEP split fails the handoff instead of booting with the overlap.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for bringing the J616s camera and SEP handoff up to the J614s level.

We select behaviour by a hardware property, not by the list of machines it was tested on. The new t6040_m4pro_laptop() (src/kboot.c:9525-9531), dapf_is_j616s() (src/dapf.c:457) and j614s_aop (src/kboot.c:11897) pick the ISP and SEP handoffs by board id plus ADT model, so the next T6040/T6041 board that shares this layout needs another list entry.

The reason in your description is a firmware fact: iBoot moves the ISP segments every boot, and puts the DCP __OS_LOG buffers inside the SEP range. Could the ISP fill run whenever the tree has the shared ISP node and its /reserved-memory placeholders and the ADT has the ISP segment-ranges, and the SEP split whenever the ADT shows the OS logs inside the SEP range? The AOP part can stay keyed on what the J614s AOP node needs.

We can run rows on our J616s (M4 Pro) with that version.

@RyanTheTide

Copy link
Copy Markdown
Contributor

One addition to the earlier note: dt_split_j614s_sep_reservations() already checks the tree itself (it returns early without a sep-firmware node and only splits ranges that actually overlap), so the board gate in front of it at kboot_prepare_dt() can likely just go. On evidence, the before row is on 26.6.2 and the after row does not say which firmware or machine; could you confirm it was a J616s and, if possible, rerun it on the 27.2 (26B123) stub we target? We can also run the J616s row on our side once the selection change is in. Thanks for the camera work.

@scottjones
scottjones force-pushed the upstream/j616s-isp-sep-handoff branch 2 times, most recently from 93d0954 to 64c9075 Compare November 20, 2026 05:24
@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the two new commits. Finding the ISP through its isp-firmware-text placeholder when the tree has no isp alias, and splitting the SEP range wherever DCP OS logs actually lie inside it, is exactly the hardware-driven selection we hoped for; the board gate is gone from the code.

The description still shows the earlier t6040_m4pro_laptop() gate and the J614s-only AOP part, so it would help to update it to match the head. We will run a J616s boot row on 64c9075 (camera stream and the reserved-memory overlap check) and post it here.

@scottjones
scottjones force-pushed the upstream/j616s-isp-sep-handoff branch 2 times, most recently from 5cc443c to 9884781 Compare November 20, 2026 07:35
@scottjones

Copy link
Copy Markdown
Contributor Author

Before you run the J616s row: please use the current head, 9884781 (same trees as 5cc443c; only the commit messages changed), rather than 64c9075. Results on my J616s (MacBook Pro 16" M4 Pro, 26.6.2 stub, kernel 7.3.0-0testedgeB2):

  • 64c9075: camera OK (sensor 0x958), but the SEP range stays whole and the kernel logs two reserved-memory OVERLAP warnings against the dcp-oslog nodes. The range also holds the AOP's no-map asc-mem firmware segment, which that version refused to split around.
  • 5cc443c / 9884781: a sep-retained range is present, with no overlap warnings and no kernel error lines. The camera finds sensor 0x958, Touch ID matches, and no units failed.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the J616s results and for the pointer. We will run our J616s row on 9884781 rather than 64c9075 (camera stream, Touch ID and the reserved-memory overlap check) and post it here. Your 64c9075 result, with the SEP range left whole because of the AOP's no-map segment, is a useful negative for the split logic.

@DjDeveloperr DjDeveloperr 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.

Thanks. Finding the ISP through its isp-firmware-text placeholder, and splitting the SEP range wherever DCP OS logs lie inside it, is the hardware-driven selection Ryan asked for. The J616s result on 9884781 is clear: one sep-retained range, no overlap warnings, and Touch ID and the camera up. CI is green on 9884781.

Two things hold it.

1. The SEP split must stay fail-closed. On main, the J614s split fails the handoff on any tree it doesn't expect: every check in dt_split_j614s_sep_reservations() returns -1, and kboot_prepare_dt() bails (src/kboot.c:11920-11922 on main). dt_split_sep_reservations() turns those same checks into goto keep (src/kboot.c:8733-8809), which prints "SEP reservation left whole" and boots on. That now applies to the J614s too. For example, a J614s whose tree has a mapped reservation inside the SEP range now boots with it, where main stops. For SEP reservations we keep failures fatal.

Suggested shape:

  • Return 0 without a change only when there's nothing to do: no sep-firmware, or nothing inside the range. If you want, also when only another coprocessor's no-map firmware lies inside it (the "no DCP OS log" case at :8775), since the whole range stays reserved there.
  • Every other refusal returns -1, so kboot_prepare_dt() bails as main does on the J614s. That covers the reservation's own shape (:8735-8742), a reservation inside the range that isn't a no-map coprocessor region (:8754-8767), a SEP node that doesn't take sep-firmware as sepfw (:8785-8797), and overlapping regions (:8809).
  • test_sep_dcp_log_split.py would then expect the bail on those trees instead of a byte-identical tree.

2. DCO. docs/licensing.md asks for a Signed-off-by on new contributions. 6678180 and 9884781 have none, though your earlier commits did.

Not blocking: the description still shows the t6040_m4pro_laptop() gate and the J614s-only AOP part, as Ryan noted.

Once both are in, Ryan's J616s row (camera stream, Touch ID, the overlap check) and a J614s boot can come after the merge, with a revert ready.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 2.

The fail-closed refusals and the missing Signed-off-by from the 11-20 review still stand at 9884781. Two more:

  1. The split now reaches other SoCs, and on those its success path removes the SEP's memory region. Once it gets past the refusals, dt_split_sep_reservations() deletes memory-region/memory-region-names from the SEP node and deletes sep-firmware (src/kboot.c, the block after "From here on the tree is being changed"). The only trigger is an apple,dcp-os-log node inside the SEP range. Those nodes are made on T6030 and T8132 (src/kboot.c:4327-4328) and on T6040/T6041/T6050 (dcp6_reserve_oslogs(), src/kboot_display_handoff.c:992). On any of those Macs where iBoot happens to put a DCP log inside the SEP range, the kernel's SEP driver now boots with no sepfw region. Only the J614s/J616s have shown that this works. The claim that "only the OS logs show the warm SEP range is shared" is an inference, not something the ADT states. Either find an ADT property of the SEP node that says the firmware is already running from that range, or show the shared-range layout and a working SEP on each SoC that can reach this path. Until then, a refusal (per the 11-20 shape) is the safe outcome there.

  2. Both commits end with Assisted-by: Claude:claude-opus-5-5 and Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>, and the description ends with the Claude Code emoji line. Take both trailers out of the commits; they need the human Signed-off-by from the 11-20 review instead. End the description with Assisted-by: LLM (<Vendor>:<Model>).

Not blocking: with dt_isp_node(), the T8132 trees (J604/J623/J624/J713/J715) now get apple,firmware-version/-compat written to their disabled ISP node. That is harmless today, but it means the fill runs on those trees and only the node's status stops it. A row on one of them should show no new ISP log lines.

HW row: J616s on the 27.2 (26B123) stub at this head (the rows so far are on 26.6.2): camera stream, Touch ID, the "retained warm SEP range" line, no reserved-memory overlap. A J614s boot showing the same split as main. One T8132 (J713) and one T6030 or T6041 boot showing "SEP reservation left whole" or a working SEP after a split. Pass: 0 failed units, 0 AVCs, 0 new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

…s no isp alias

The M4 Pro MacBook trees (t604x-j614-j616.dtsi, the J614s and J616s) have
the ISP firmware placeholders but no isp alias. The placeholder-driven
handoff looks the ISP up by that alias, so on a J616s dt_set_isp_fwdata()
printed "'isp' not found" and returned before filling anything. The ISP
was handed to the kernel enabled, with the tree's static segment
addresses from one 26.6.2 boot. iBoot moves the segments: on our J616s the
text was at 0x10000c34000, not 0x10000c44000. So the kernel mapped the
wrong memory, and the firmware never reported in ("never received first
magic number from firmware").

When the alias is missing on a tree with placeholders, take as the ISP
the one node whose first memory region is the isp-firmware-text
placeholder, for the fill and for disabling the ISP when the fill is
refused. If two nodes take it, none is guessed.

This replaces the earlier J616s board check: any tree with the
placeholders, an enabled ISP node that takes them and ADT segment-ranges
gets the fill, whatever its alias. The J614s still takes its own path
after DAPF setup, and the AOP stays the J614s's alone.

The T8132 trees (J604, J623, J624, J713, J715) also have placeholders and
no isp alias. Their ISP is disabled in the tree, so the fill does nothing
there; the only change is that apple,firmware-version and
apple,firmware-compat now go on that disabled node, which the H17 ISP
driver does not read.

Unlike the earlier version, the J616s fill is not held back for the DAPF
result or the 26.6.2 firmware: it runs, like every placeholder fill, in
kboot_prepare_dt().

test_t6041_isp_handoff.py gains the J616s tree shape without the alias:
it is filled, a refused fill disables that ISP, and a second node taking
the text placeholder leaves it untouched. The first case fails when the
lookup goes back to the alias alone.

Tested on a J616s with the earlier, board-gated version (macOS 26.6.2
firmware, kernel 7.3 test build): the ISP text and data reservations
carried the ADT's addresses, the ISP found its sensor (0x958), and 1080p
NV12 frames streamed with real image content. This version, on the same
J616s (macOS 26.6.2 stub, kernel 7.3 test build): the ISP text is
reserved at this boot's ADT address, the ISP finds its sensor (0x958) and
the video device comes up.

Signed-off-by: Scott Jones <scottajones@gmail.com>
On the M4 Pro MacBooks (J614s, J616s) iBoot places the DCP __OS_LOG
buffers inside the SEP firmware range it reports, and the kernel warns at
boot that sep-firmware and the dcp-oslog nodes overlap. The J614s split
that keeps the warm SEP range around those no-map regions ran on the
J614s alone, behind a board check, so the J616s booted with the overlap.

Select the split by what the tree shows instead of by board: check
every tree, and split only when a DCP OS log reservation (no-map,
apple,dcp-os-log, as the display handoff makes them) lies inside the SEP
range. On a T6040 those exist when the display handoff ran (26.6.2
firmware, a tree that describes the display block). The split then
keeps the SEP range around every no-map reservation inside it that is
an OS log or another coprocessor's live firmware (apple,asc-mem): on our
J616s the AOP's firmware segment sits right after the three OS logs, and
the first log starts below the range. A tree whose SEP range overlaps nothing keeps its reservation as
dt_set_sep() made it.

Dropping the board check alone is not enough. The split looked the SEP
node up at /sep@406600000, which is the T6040/T6041 address. On other
SoCs dt_set_sep() makes sep-firmware but that path does not exist, so the
split would return an error and fail kboot_prepare_dt() on those Macs.
Find the SEP node through the sep alias, as dt_set_sep() does.

When the split cannot be done safely, leave the tree unchanged, say why,
and boot on, as the J616s did before. That covers:
 - no OS log inside the range (only those show the warm SEP range is
   shared; on a Mac whose SEP boots from the reservation, removing it
   would break the SEP);
 - any other kind of reservation inside the range;
 - reservations that overlap each other;
 - a SEP node that does not take sep-firmware as sepfw.
Only a failure after the tree has started to change still fails the
handoff.

test_sep_dcp_log_split.py runs the split and its call in
kboot_prepare_dt() on trees built in the shape the loader leaves them:
 - the J616s layout of a 26.6.2 boot, read from the Mac (SEP
   0x10005f5c000-0x100064d0000, OS logs from 0x10005f3c000, below the
   range, to 0x10005fa8000, then the AOP segment to 0x10005fd4000), is
   split into one retained range after them;
 - two OS logs give three retained ranges, a log past the start of the
   range is clamped, and another coprocessor's firmware beside an OS log
   is split out with it, but not on its own;
 - a SEP node at another path is found through its alias;
 - trees that overlap nothing, or where the split is refused, come out
   byte-identical.
Restoring the board check, the fixed SEP path, the old function without
its gate, failing on a refusal, dropping the OS log trigger, accepting
OS logs only (the previous version of this commit, which left the J616s
range whole), or dropping the no-map, kind, overlap, SEP compatible or
sep-firmware no-map checks each fails it.

Tested on a J616s with the earlier, board-gated version (macOS 26.6.2
firmware, kernel 7.3 test build): the reservations carried no overlap
warnings, the DCPs came up as before, and the boot reached the desktop.
The previous version of this commit (OS logs only), on our J616s: the
camera and Touch ID worked, but the AOP segment made it leave the SEP
range whole, and the kernel reported sep-firmware overlapping two OS
logs. This version, on the same J616s: one sep-retained reservation
(5104 KiB) around the three OS logs and the AOP segment, no
reserved-memory overlap warnings and no failed reservations, the SEP up
with Touch ID matching a fingerprint, the camera up, and no failed
units.

Signed-off-by: Scott Jones <scottajones@gmail.com>
@scottjones
scottjones force-pushed the upstream/j616s-isp-sep-handoff branch from 9884781 to 149ff32 Compare November 24, 2026 14:43
@github-actions github-actions Bot added changes-requested A reviewer requested changes (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks required sections (bot) labels Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Merge readiness at 8d358c42: not ready yet

Check Detail
CI at head ok 26 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes no requested by RyanTheTide, DjDeveloperr
Hardware row at head ok in the PR body at 8d358c42
Conflicts ok none
PR text ok Risk: two-way · . The ISP fill affects the J616s. The SEP split now runs only where the live ADT shows the buddy segment inside a booted SEP's firmware range, on any SoC; there, a tree the split does not expect fails the handoff. On every Mac with a SEP reservation, a sep-firmware node the code cannot read at all fails the handoff; dtsetsep() always writes it in the readable shape.

Areas: none matched in CODEOWNERS

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@DjDeveloperr DjDeveloperr 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.

Verdict: HOLD at 149ff327a5f9
Blockers:

  1. tests/python/test_sep_dcp_log_split.py:46-50 (CI red): Pytest (macos-26 + llvm-brew) fails to link sep-dcp-log-split with duplicate symbols _fdt_address_cells and _fdt_size_cells because run_c() on current main already links src/libfdt/fdt_addresses.c (cancelling the remaining pytest matrix). Drop the local fdt_address_cells/fdt_size_cells stubs and rebase onto current main.
  2. src/kboot.c:8733-8809,8840-8843 (§3, prior blocker unfixed): dt_split_sep_reservations() still turns all pre-mutation validation errors into goto keep returning 0 instead of failing closed (return -1 -> bail()) as main does on J614s. Return 0 unchanged only when there is nothing to do (no sep-firmware, nothing inside the range, or no DCP OS log inside it); keep structural, unexpected-overlap, and sepfw-binding checks fail-closed (return -1) and update tests/python/test_sep_dcp_log_split.py accordingly.
  3. src/kboot.c:8764-8818,11926 (§3, prior blocker unfixed): dt_split_sep_reservations() runs on every SoC and deletes memory-region/memory-region-names and /reserved-memory/sep-firmware whenever any apple,dcp-os-log node overlaps the SEP range. Those OS-log nodes are also created on T6030/T8132 (src/kboot.c:4328) and T6040/T6041/T6050 (dcp6_reserve_oslogs()), where removing sepfw is only proven safe on J614s/J616s. Gate the split on an explicit ADT/hardware property proving the warm SEP range is already active and shared, or prove a working SEP after split on each SoC family that can reach this path.
  4. PR body (§4): delete the trailing attribution footer on the last line of the PR body (zero tool/AI attribution anywhere; do not replace it with an Assisted-by: line). Commit trailers are now clean (6e93b9be, 149ff327 have human author/committer and Signed-off-by only).
  5. PR body / evidence (§5): add Tested: and Risk: lines, update the stale PR description (still documents the removed t6040_m4pro_laptop() gate), and post hardware + regression rows at the exact head SHA (J616s on the 27.2 / 26B123 stub showing camera stream, Touch ID, retained warm SEP range, 0 reserved-memory overlaps, 0 SELinux denials, 0 failed units, 0 new kernel errors; plus a J614s boot and a T8132/T6030/T6041 regression check).
    Checked: interdiff 98847814..149ff327a5f9 (identical code diff; commit trailers cleaned and DCO added), §1–§6 of pre-PR checklist (§1/§2/§6 code pass; §3/§4/§5 blocked), CI at 149ff327a5f9.
Evidence
  • Interdiff (98847814 -> 149ff327a5f9): zero code or test changes; both commits (6e93b9bed5e2, 149ff327a5f9) dropped tool trailers and added Signed-off-by: Scott Jones <scottajones@gmail.com>.
  • CI at 149ff327a5f9: Pytest (macos-26 + llvm-brew) FAILED (ld: 2 duplicate symbols: _fdt_size_cells, _fdt_address_cells in test_sep_dcp_log_split.py); Pytest (ubuntu-latest + gcc), Pytest (ubuntu-latest + llvm), Pytest (macos-15 + llvm-brew) CANCELLED; readiness QUEUED; build, format-check, policy, selftest, pr-text (3 warnings: Tested:, Risk:, body footer), ESP stage 2 vital size, stage1-size (gcc, clang-macos, fedora, alarm, nix), and Pytest (ubuntu-24.04-arm, native start.S) PASSED.
  • Nit (non-blocking): dt_isp_node() now writes apple,firmware-version/-compat to disabled ISP nodes on T8132 trees; harmless while disabled, confirm no new ISP log lines in a T8132 boot row.

@RyanTheTide

Copy link
Copy Markdown
Contributor

@scottjones, what is still open from Dj's review of 149ff327 (11-24):

  1. CI is red: Pytest (macos-26 + llvm-brew) fails to link test_sep_dcp_log_split.py with duplicate _fdt_address_cells/_fdt_size_cells. run_c() on main already links src/libfdt/fdt_addresses.c, so please drop the local stubs at tests/python/test_sep_dcp_log_split.py:47-49 and merge main in.
  2. src/kboot.c:8733-8809,8840-8843: dt_split_sep_reservations() still turns validation errors into goto keep and returns 0. Return 0 only when there is nothing to do. Structural, overlap and sepfw-binding failures should return -1, and the test should be updated to match.
  3. src/kboot.c:8764-8818,11926: the split runs on every SoC and deletes sepfw whenever an apple,dcp-os-log node overlaps. Those nodes also exist on T6030/T8132 and T6040/T6041/T6050. Gate the split on an ADT property showing that the warm SEP range is active and shared, or show a working SEP after the split on each of those families.
  4. PR body: please remove the trailing attribution footer, add the Tested: and Risk: lines, and update the description (it still describes the removed t6040_m4pro_laptop() gate).
  5. Rows at the new head: a J616s on the 27.2 stub (camera stream, Touch ID, warm SEP range kept, 0 reserved-memory overlaps, 0 AVC denials, 0 failed units, no new kernel errors), a J614s boot, and a T8132/T6030/T6041 regression boot.

Once these are in, Dj will re-review.

run_c() now links src/libfdt/fdt_addresses.c, so the test's own
fdt_address_cells() and fdt_size_cells() are duplicate symbols, and the
macOS llvm build fails to link the test.

Signed-off-by: Scott Jones <scottajones@gmail.com>
dt_split_sep_reservations() returned 0 on every refusal, so a tree it
did not expect booted on with the SEP reservation whole. On main the
J614s split fails the handoff on those trees instead.

Return 0 only when there is nothing to split: no sep-firmware, or no
DCP OS log inside the SEP range, where the whole range stays reserved.
When there is a split to do, a sep-firmware range that is not 16 KiB
aligned, a reservation this code cannot place, a reservation inside the
range that is not a no-map coprocessor region, a SEP node that does not
take sep-firmware as sepfw, and overlapping regions now return -1, and
kboot_prepare_dt() bails as it does on main. A sep-firmware this code
cannot read at all (reserved-memory cells other than 2, a reg other
than one range, or an empty range) returns -1 on any tree; dt_set_sep()
always writes it in the shape this code reads.

The split now looks at every tree, so a problem with another
reservation, or the alignment of a range this boot's ADT reported, only
refuses it when a DCP OS log lies inside the SEP range. Elsewhere the
boot goes on as before: one unusual reservation on another Mac does not
fail its handoff.

The test expects the bail on the refused trees, and adds an unaligned
sep-firmware beside an OS log (refused) and without one (kept), and a
malformed reservation beside an OS log (refused) and without one
(kept).

Signed-off-by: Scott Jones <scottajones@gmail.com>
@scottjones
scottjones requested a review from a team as a code owner November 27, 2026 15:01
@scottjones
scottjones requested review from a team as code owners November 27, 2026 15:01
@scottjones

Copy link
Copy Markdown
Contributor Author

Merged main (26c1a85) in, with two new commits on top. The new head is af837e9, with no force push. Numbers follow your 04:12Z list.

  1. tests/python/test_sep_dcp_log_split.py: dropped the local fdt_address_cells/fdt_size_cells stubs, since run_c() now links fdt_addresses.c.
  2. src/kboot.c: dt_split_sep_reservations() returns 0 without changing anything only when there is nothing to split: no sep-firmware, or no DCP OS log inside the SEP range. When there is a split to do, these now return -1, so kboot_prepare_dt() bails as on main:
    • a sep-firmware range that is not 16 KiB aligned;
    • a reservation it cannot place;
    • a reservation inside the range that is not a no-map coprocessor region;
    • a SEP node that does not take sep-firmware as sepfw;
    • overlapping regions.
      A sep-firmware it cannot read at all returns -1 on any tree. The test expects the bail on those trees and adds kept and refused cases for an unaligned sep-firmware and for a malformed reservation.
  3. The body is updated: no attribution footer, Tested: and Risk: lines, and the description matches the head.

Host at af837e9: gcc and clang stage 1 and ESP stage 2 build. Pytest with gcc and clang gives the same results as main apart from the new test.

Still open: item 3 (gating the split on an ADT property) and item 5 (hardware rows at the new head).

@github-actions github-actions Bot added blast:all Macs affected, from Merge risk (bot) and removed needs-hw-row No hardware row at the PR head (bot) needs-template PR body lacks required sections (bot) labels Nov 27, 2026

@RyanTheTide RyanTheTide 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.

Verdict: FINISH, then merge at af837e990696

Blockers:

  1. src/kboot.c:10751 (dt_split_sep_reservations()) and :11503 (dt_isp_node()): this head takes about 2 KiB of Stage 1 .text and pushes the stage1 flavour well below main and the 4096 B floor. CI at this head: gcc 1648 B (main 3696 B), fedora 1960 B (main 4008 B), nix 1104 B (main 3152 B). Those three jobs fail on main too, but this PR makes them worse by 2048 B each. We see the same 2048 B drop locally with clang 22 (main 3744 B, this PR 1696 B). Fix: mark the new and grown functions AURA_XTEXT (src/types.h:74, as #281 and #282 do), then check that stage1 headroom is back at or above main's.
  2. src/kboot.c:10857-10858 and :14471 (Dj's item 3 from 149ff327, still open, as your 11-27 note says): the split runs on every SoC. Once any apple,dcp-os-log reservation lies inside the SEP range, it deletes the SEP node's memory-region/memory-region-names and sep-firmware. Those nodes are also made on T6030/T8132 (src/kboot.c:4950) and on T6040/T6041/T6050 (DCP6_OSLOG_PROP, src/kboot_display_handoff.c:211). Gate it on an ADT property showing that the warm SEP range is live and shared. If you can't, show a working SEP after the split on each family that can reach this path.
  3. Rows at this head (item 5): none yet. Needed: the J616s on the 27.2 stub (camera stream, Touch ID, the "retained warm SEP range" line, 0 reserved-memory overlaps, 0 AVCs, 0 failed units, no new kernel errors), a J614s boot showing the split, and one T8132/T6030/T6041 boot showing "SEP reservation left whole" or a working SEP.

Checked: Re-checked against @DjDeveloperr's review at 149ff327.

  • Item 1 is fixed. The local fdt_address_cells/fdt_size_cells stubs are gone, and all five Pytest jobs pass at this head.
  • Item 2 is fixed. With a DCP OS log inside the range, every structural, placement, overlap and sepfw-binding check now goes to refuse, which bails. The split returns 0 unchanged only when there is no sep-firmware or no OS log inside the range, which is the shape Dj suggested.
  • Item 4 is fixed. The description has Tested:/Risk:, no attribution footer, and matches the code. Commits carry only your Signed-off-by.
  • Not blocking: a DCP OS log node with a malformed reg is skipped before it is counted, so a tree with only that log keeps the range whole instead of refusing.

@DjDeveloperr: items 1, 2 and 4 look fixed here, and items 3 and 5 are still open. Please re-review once those are in.

Evidence
  • CI at af837e99, run 46021127539: gcc stage1: headroom 1648 B, fedora stage1: headroom 1960 B, nix stage1: headroom 1104 B. secure-audit/enforce are unchanged from main (11992 / 12392 B).
  • Local, af837e99 merged into main 2c8fa8d8, tools/stage1_size.sh with clang 22.1.6 (USE_CLANG=1 BUILTIN_LOGO=aurora BUILDSTD=1): stage1 text room 1696 B vs 3744 B on main.
  • Local pytest -q tests/python/test_sep_dcp_log_split.py tests/python/test_t6041_isp_handoff.py: 2 passed.
  • Read the full source diff against main.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
@RyanTheTide

Copy link
Copy Markdown
Contributor

@scottjones, you've been quiet since 11-27, so I pushed a main merge to your branch as 3b48e1b1 (signed off; maintainers can edit). Your commits are unchanged.

On @RyanTheTide's 11-28 review:

  1. Stage 1 growth / AURA_XTEXT: fixed by the main merge. Since aura-raw.ld: one read-execute region on 16 KiB steps #551, Stage 1's .text and .rodata share one read-execute region, so moving code into AURA_XTEXT no longer saves room. With this merge, the clang Stage 1 link has 94,704 B of headroom. The fedora/gcc/nix reds at af837e99 were main's old layout failure.
  2. Still open: gate the SEP split on an ADT property, not the board. Which property tells the J616s/J614s layout apart? If you have it, a short follow-up commit closes this.
  3. Still open: rows. We'll run the J616s row once the J616s is free. A J614s row from you would cover the second family.

Local: build OK. Host pytest passes except the two main-caused failures that #570 fixes (T6041 typedef test, DT fuzz link).

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: FINISH at 3b48e1b.

Checked: The owner reports 94,704 bytes of Stage 1 headroom on the new layout. The remaining review findings concern the SEP reservation change. A DCP log overlap by itself does not establish that the SEP firmware reservation can be replaced across all reachable SoC families. Please gate the split on evidence that the warm SEP range is live and shared, or supply SEP validation on the affected families. Keep the current J616s and J614s camera/SEP checks, peer regression and hosted CI.

@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) and removed ci-failing A check failed at the PR head (bot) labels Nov 29, 2026
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
…shared

The split ran on any tree with a DCP OS log inside the SEP range. That
was inferred from the tree; nothing showed the SEP no longer needs its
firmware there. Read both facts from the ADT instead, with no board or
SoC list:

- shared: /chosen/memory-map RTBuddySeg (the RTKit buddy segment that
  holds the DCP __OS_LOG buffers and the AOP segment) lies inside SEPFW;
- warm: /arm-io/sep sepfw-booted is set.

Without both, sep-firmware stays whole, and a line says why. With both,
the range is split around every no-map coprocessor reservation in it
(DCP OS log or asc-mem), as main did on the J614s, so an AOP segment
alone is split out too. A reservation with an unreadable reg on a
shared range now refuses the split, including a DCP OS log, which was
skipped before it was counted.

Live 27.x ADTs (J413, J473, J615, J616s, J713) have sepfw-booted = 1
and RTBuddySeg ending at or below SEPFW (J413: none), so the split does
not run on them; the 26.6.2 J616c tree has RTBuddySeg running into SEPFW.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
After the merge of main, two host tests fail at 2390f45 (both pass on
main):

- test_sep_t8152_gate counts every "dt_set_sep()" in kboot.c as a call
  that must be fatal; the split's comments named it that way. They now
  say dt_set_sep.
- test_t8132_isp_absent builds dt_set_isp() from its source, which now
  calls dt_isp_node(); the test takes that function along.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>

@aurora-silicon-review aurora-silicon-review Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: HOLD at 8d358c4

Blockers: The J616s one-shot exercises the camera handoff and the unchanged-SEP path. The new warm-SEP split still needs a hardware row on either J616s or J614s under overlapping firmware, or a maintainer disposition that explicitly covers that path. Earlier human change requests still need reconciliation.

Checked: Both replacement macOS Pytest jobs passed. Verified the exact-head J616s report records camera streaming, SEP and Touch ID binding, zero reserved-memory overlaps and a clean return. The live ADT did not meet the split predicate, so the hardware evidence covers the refusal-to-split path. Local fixtures cover the positive split and malformed reservations. The author reports Stage 1 and ESP Stage 2 headroom matching main under GCC and Fedora Clang.

The proposed J614s gap explicitly covers the positive split. J614s already uses the split on main, and an unexpected reservation on the changed path can stop the handoff. Please retain an exact-head positive hardware row or have the boot maintainer explicitly disposition that failure mode before landing.

@RyanTheTide

Copy link
Copy Markdown
Contributor

@scottjones, you're still quiet, so I pushed three commits on top of 3b48e1b1. The head is now 8d358c42. Your commits are unchanged.

I've updated the description to match.

On the open findings:

  1. App FINISH at 3b48e1b1 / @RyanTheTide item 2 / @DjDeveloperr item 3: gate the SEP split on an ADT property, not the board. Done in eebd8e0e. The split now runs only when the live ADT shows the warm SEP range is both live and shared:

    • shared: /chosen/memory-map RTBuddySeg lies inside SEPFW. That segment holds the DCP __OS_LOG buffers and the AOP segment, which are exactly the no-map nodes that overlapped sep-firmware.
    • live: /arm-io/sep sepfw-booted is set, meaning iBoot has already booted the SEP from that range.

    If either is missing, sep-firmware stays as dt_set_sep() made it, and Stage 2 prints why: FDT: SEP reservation left whole (ADT RTBuddySeg not inside SEPFW) or (ADT: SEP firmware not booted). There is no board or SoC list.

    This replaces the "DCP OS log inside the range" inference. As on main for the J614s, a shared range is split around every no-map coprocessor reservation in it, including an AOP segment on its own. The ADT evidence:

    • The live 27.x ADTs we hold (J413, J473, J615, J616s, J713) all have sepfw-booted = 1. Their RTBuddySeg ends at or below SEPFW (the J413 has no RTBuddySeg), so the split does not run on any of them.
    • The 26.6.2 J616c tree has RTBuddySeg running into SEPFW.
    • The 26.6.2 J616s layout already in the test (OS logs plus the AOP segment from 0x10005f3c000, with the retained range starting at 0x10005fd4000) fits one RTBuddySeg running into SEPFW.
  2. App non-blocking note: a DCP OS log with a malformed reg was skipped before it was counted. Fixed in eebd8e0e. On a range the ADT shows shared, any reservation whose reg can't be read now refuses the split, and the handoff fails. That includes a DCP OS log.

  3. Host tests broken by the merge. Fixed in 8d358c42. At 2390f45a, two tests failed; both pass on main:

    • test_sep_t8152_gate counts every dt_set_sep() in kboot.c as a call that must be fatal, and the split's comments used that form.
    • test_t8132_isp_absent builds dt_set_isp(), which now calls dt_isp_node(), so the test now includes that function.
  4. Rows (@RyanTheTide item 3, App item 3).

    • J616s (T6041): passes at 8d358c42. This was a one-shot ESP Stage 2 aura-try. Only the aura head was swapped onto the live boot-ctxr; Stage 1, LocalPolicy and NVRAM were untouched.
      • Camera: Stage 2 filled the ISP from the ADT (FDT: ISP __TEXT at 0x10000c44000; the default Stage 2 prints FDT: 'isp' not found). apple-isp bound, found sensor 0x958, and /dev/video0 streamed 60 frames of 1920x1080 NV12 at about 19-21 fps, with 0 kernel errors.
      • SEP: on this boot the ADT has RTBuddySeg 0x1000ee2c000-0x1000eec8000 below SEPFW 0x10012174000-0x10012720000, with sepfw-booted = 1. Stage 2 printed FDT: SEP reservation left whole (ADT RTBuddySeg not inside SEPFW). sep-firmware is reserved whole and there are 0 reserved-memory overlaps. apple_sep is bound with 0 errors, and the Touch ID sensor (apple-mesa, spi1.0) is bound and seen by fprintd.
      • System: Enforcing, 0 AVCs, 0 failed units, 0 kernel error lines (the default Stage 2 has one brcmfmac ring line).
      • Afterwards, the default (Stage 2 1.0.0b17, boot-ctxr a98f3d09) was restored and checked.
      • This boot's firmware doesn't place the buddy segment inside SEPFW, so the split itself didn't run on hardware here. That path is covered by the host tests. A J616s or J614s boot whose ADT shows the overlap would show retained warm SEP range instead.
    • J614s: we don't have one. I'll file it as a known-gap follow-up. @scottjones, a J614s boot at this head would close it.

Tested: J616s one-shot ESP Stage 2 at 8d358c42 (above). Host checks at 8d358c42:

  • full pytest: 1660 passed, 28 skipped. The new test cases fail on 2390f45a; the first failure is the AOP-segment-only split.
  • clang-format 20.1.8: clean.
  • Stage 1 / ESP Stage 2 headroom (current main in parentheses):
Toolchain Stage 1 dev-audit ESP Stage 2
gcc 2.42 43,472 B (43,472) 26,896 B (26,896) 10,104 B (10,104)
fedora clang 125,904 B (125,904) 92,944 B (109,328) 109,016 B (109,016)
clang 22 125,904 B 92,944 B 109,016 B

@DjDeveloperr: items 1, 2 and 4 were already fixed, and 3 and 5 are now answered at 8d358c42. Please re-review.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Nov 30, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

Boot disposition for the J614s row (answers the App hold at 8d358c42: "positive row or explicit boot-maintainer disposition of that failure mode").

The concern is that the changed path can stop the handoff on an unexpected reservation, and that we have no J614s to show it doesn't. On the J614s, this head can refuse in no case where main doesn't already refuse. Main's dt_split_j614s_sep_reservations() runs on every J614s boot that has a sep-firmware node, and it returns -1 (the handoff bails) in all of these cases, before it looks at what lies inside the range:

  • the cells are wrong;
  • there is no /sep@406600000 (apple,sep);
  • sep-firmware is not asc-mem, or is no-map;
  • the reg is bad, or the range is not 16 KiB aligned;
  • the phandle or sepfw name doesn't match.

In its loop, main also refuses any reservation in the tree with a malformed reg, and any reservation inside the range that is not a no-map coprocessor region.

At 8d358c42, dt_split_sep_reservations() refuses only on the same conditions. It reaches them only when the live ADT shows RTBuddySeg inside SEPFW with sepfw-booted set. It checks alignment and the SEP node only when there is something to split. So on a J614s the refusal set is a subset of main's. A J614s that boots on main can't fail the handoff here.

The one behaviour that can differ on a J614s goes the safe way. If its ADT did not show the buddy segment inside SEPFW while tree nodes overlapped sep-firmware, the split would not run, and the kernel would print its non-fatal overlap warning (as every Mac other than the J614s does on main). The boot would not stop.

On other Macs the split is new, and it runs only where their own ADT shows the shared, booted range. There it fails closed, as @DjDeveloperr asked at 149ff327. That matters only for a tree with a malformed or foreign reservation inside the SEP range.

Disposition: the J614s positive row is tracked as a known-gap follow-up when this merges; no boot-failure mode is added on the J614s. The J616s row at this head is in the comment above, and the split path is covered by the host tests.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: MERGE at 8d358c4

Blockers: None from this review following the boot-maintainer disposition. Reconcile earlier human change requests before landing.

Checked: All 18 hosted checks passed. The J616s one-shot covers camera and unchanged SEP reservations. The boot maintainer documented the J614s failure-mode comparison and accepted the positive split as a known gap. Linux main's shared J614/J616 tree supplies the SEP alias to the same node the old path used. Keep the positive J614s split in the follow-up issue.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging at 8d358c42 (merge) under the 6-point rule. (1) The review App's verdict at this head: APPROVED. (2) CI is green at this head (readiness excluded). (3/4) Rows: J616s one-shot ESP Stage 2 row at 8d358c4 PASS (camera found + streaming, SEP whole per ADT rule, Touch ID up; traces/boot/20261201-293-j616s); main-merged head, pytest 1660, size same as main; J614s row = known-gap. (5) No blocking review is open. (6) Dj was pinged with no objection. The remaining rows are tracked in the known-gap issue linked below. Revert: git revert -m 1 <commit>.

@RyanTheTide
RyanTheTide merged commit 42243c6 into aurora-silicon:main Nov 30, 2026
31 of 33 checks passed
@RyanTheTide

Copy link
Copy Markdown
Contributor

Known-gap issue: #620

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks @scottjones, merged. The SEP split is now gated by the ADT (RTBuddySeg inside SEPFW, and sepfw-booted). The J614s row is tracked in the known-gap issue linked above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blast:all Macs affected, from Merge risk (bot) changes-requested A reviewer requested changes (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants