Skip to content

arm: apple: let the J713 import take a 192 KiB m1n1 tree - #15

Merged
RyanTheTide merged 2 commits into
aurora-silicon:aurora-wipfrom
erikwb:j713/fdt-source-limit
Oct 30, 2026
Merged

RyanTheTide merged 2 commits into
aurora-silicon:aurora-wipfrom
erikwb:j713/fdt-source-limit

Conversation

@erikwb

@erikwb erikwb commented Oct 25, 2026 •

Copy link
Copy Markdown

The J713 per-kernel import refuses a source tree (m1n1's handoff tree) larger than J713_FDT_MAX_SOURCE, which is 128 KiB. On a 7.3 J713 that tree is already close to the bound.

m1n1 tree handed to U-Boot Size Under 128 KiB by
7.3 J713 DTB (bundled boot capture) 126,328 B 4.7 KiB
the same + the SEP node and its two boot manifests (linux#457, u-boot#14) 136,997 B over by 5.8 KiB

With the second tree, the import returns -EINVAL and the boot stops after m1n1's logo with no console. That happened on hardware with a boot.bin carrying linux#457's DTBs. Ordinary device-tree growth would reach the same cliff.

Change

  • Bound: raise J713_FDT_MAX_SOURCE to 192 KiB. The derived SYS_FDT_PAD minimum becomes 208 KiB, which apple_m1_defconfig's 256 KiB already covers, so no config change is needed. The #error text, the doc sentence and the padding-guard test follow.
  • Tests: size the host harness's source buffer from the constant, and add test_j713_large_source, which imports a ~160 KiB source. It fails with the old bound.

Testing

  • Host: all J713 importer tests pass (private_captures skipped). checkpatch is clean, and apple_m1_defconfig builds.

  • Real trees: the production importer, built on the host, was run against the bundled capture of m1n1's tree, with the SEP node and the two real manifests added, into a real J713 per-kernel DTB.

    • At 128 KiB: -22.
    • At 192 KiB: 1, with both manifests in the OS tree byte-identical.
  • Hardware: a J713 boot.bin with this, arm: apple: carry the J713 SEP boot manifests into the OS tree #14 and linux#457's DTBs boots, and the import carries the manifests. The same boot.bin without this change stopped after the m1n1 logo.

u-boot#14 depends on this for J713 trees that carry the SEP.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Reviewed 733d8f2. The 192 KiB source/used-tree bound is confined to the opt-in J713 importer; both trees must identify J713 and T8132 before allocation or copying. The fixed 1 MiB importer capacity ceiling, 256 KiB SYS_FDT_PAD, Apple load addresses and relocation code are unchanged. The new minimum is 192 + 16 = 208 KiB, leaving 48 KiB within that existing pad. At the largest accepted used OS tree, the normal padded buffer is 448 KiB; scratch is malloc(capacity), checked for failure and freed, with no new static, stack or fixed-address buffer. EFI checks the caller's allocated size before setting totalsize. I found no new overlap or relocation risk from this change. The source relocation reservation uses the actual DT size already. Please also update the APPLE_J713_FDT Kconfig help's stale 144 KiB minimum to 208 KiB.

The contributor's current #14/#15 evidence includes the over-limit refusal without this change and a J713 boot with #15, #14 and #457 DTBs carrying both manifests and matching an existing enrolment. Keep #15 before #14 in the merge order, with #457's control DTB and the separately reviewed SEP activation/calibration requirements. #13's AOP import must remain present when rebasing the loader stack.

The exact-head Apple build and public host tests, plus composition with #13/#14, are queued in an ordinary buildslot. I will update this same comment with their results.

For Neo, M1 Pro and M2 the normal importer path returns before this bound is used when the opt-in property is absent; an opt-in non-J713 tree is still refused. This changes the shared Apple binary, so byte-for-byte binary identity is not claimed. The requested check is unchanged execution and unchanged tree contents on those boards. No hardware test was performed here.

The per-kernel import refuses a source tree larger than 128 KiB. m1n1's
J713 tree is the OS DTB plus its handoff additions: 126,328 bytes with a
7.3 J713 DTB, so 4.7 KiB under the bound. A tree that also carries the
SEP node and its two boot manifests (about 10 KiB more) was refused
with -EINVAL, and the boot stopped with no console.

Raise the bound to 192 KiB. The required SYS_FDT_PAD becomes 208 KiB,
which apple_m1_defconfig's 256 KiB already provides. Add a regression
for a source of about 160 KiB.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb
erikwb force-pushed the j713/fdt-source-limit branch from 733d8f2 to f5cd324 Compare October 26, 2026 14:30
@erikwb

erikwb commented Oct 26, 2026

Copy link
Copy Markdown
Author

Fixed in f5cd324. The APPLE_J713_FDT help now gives 208 KiB of SYS_FDT_PAD as the minimum, matching j713_fdt.h. Nothing else changed.

Keep the AOP handoff and SEP manifest tests from aurora-wip next to the
large source regression from this branch.

Assisted-by: LLM
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@RyanTheTide
RyanTheTide merged commit badc1de into aurora-silicon:aurora-wip Oct 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants