Skip to content

accel/ane: T8132: admit the macOS 27.2 firmware build (Mac mini J773g) - #2642

Open
DjDeveloperr wants to merge 1 commit into
integration/aurorafrom
djdev/t8132-ane-272
Open

DjDeveloperr wants to merge 1 commit into
integration/aurorafrom
djdev/t8132-ane-272

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Problem

On a Mac mini M4 (J773g) booted from the macOS 27.2 (26B123) firmware, the Neural Engine never starts:

platform 500000000.ane: error -EINVAL: H16 requires bootloader-reserved no-map TEXT/DATA preload ranges

aura hands the preload over correctly (no-map reserved-memory, apple,firmware-iovas from the ADT segment-ranges). But 27.2 ships a new M4 image with a different layout, and the T8132 platform pins the 26.6.2 one:

TEXT DATA DATA IOVA
26.6.2 (25G83) 0xc0000 0x2ac000 0x100_000c_0000
27.2 (26B123) 0xbc000 0x2b0000 0x100_000b_c000

The image is h16_ane_fw_leto_j7x, LC_UUID fd35429f-6556-353e-b863-a26a02a71cdf (= the ADT ane uuid). 27.2.1 (26B131) ships it byte-identical. Both layouts end at the same IOVA, as on the M5's 27.2 build (#1899).

Change

  • T8132 gets a 27.2 build (next_build, as T6050 and T8142 have), selected from the layout the loader handed over. Preflight (which the module init also runs) and the H16 probe now take the build that was preloaded.
  • H16 preload rules carry their own TEXT/DATA sizes. 0 keeps the 26.x/27.0 sizes, so existing rules are unchanged.
  • New profile H16 T8132 27.2 26B123:
    • it reuses the 25G83 boot values (the firmware span still ends at TEXT + 0x36c000, and the host windows lie past it), as T6041 27.2 reuses its 27.0 values;
    • its patchbay records and the zeroed _rtk_tunables range sit 0x4480 earlier in DATA;
    • it refuses protected DARTs, like T6041 27.2.
  • The digest comes from the live preload. Compared with the IPSW image, iBoot changes only:
    • the CE script in __TEXT,ce_env, which stays in the identity, as on T6041 27.2;
    • fixed patchbay values (_COS = 0x8132, RCOS, dApC, dArW, GLFp);
    • GKTS, ECAP and ARcM, which are normalized;
    • _rtk_tunables, which is zeroed.
  • KUnit: the T8132 build pair admits only its own layout; the 27.2 profile is well framed and differs from every other digest.

Testing

Mac mini J773g, macOS 27.2 (26B123) firmware, kernel 7.3.0 (m4drv8), with this driver built as modules for it:

  • H16 preload identity H16 T8132 27.2 26B123 accepted, DART protect bit clear, READY, startup acks 4/0/3/0x22, ABI 3 accel node.
  • Pinned H16G add-128 HWX (tools/testing/selftests/drivers/ane/h16-run.py --runs 20): 20/20 runs exact (16384/16384 fp16 values) on each of two boots.
  • The digest was read on one boot and matched on the next two.
  • Host tests pass. The ANE KUnit suites compile but were not run.

Not covered: system sleep with the 27.2 image (it uses the same cold sleep path as 26.6.2), and other M4 boards on 27.2 (they should take the same image).

🤖 Generated with Claude Code

The macOS 27.2 (26B123) iBoot preloads a new M4 Neural Engine image
(h16_ane_fw_leto_j7x, LC_UUID fd35429f-6556-353e-b863-a26a02a71cdf, the
ADT ane uuid): TEXT 0xbc000 and DATA 0x2b0000, DATA at 0x100_000b_c000
(26.6.2: 0xc0000 and 0x2ac000 at 0x100_000c_0000). Both end at the same
IOVA, as on the M5's 27.2 build. The T8132 platform pins the 26.6.2
layout, so on a Mac mini (J773g) booted from 27.2 the module init refused
the hand-off aura made from the ADT segment-ranges: "H16 requires
bootloader-reserved no-map TEXT/DATA preload ranges". macOS 27.2.1
(26B131) ships the same image.

Give T8132 a 27.2 build (next_build, as T6050 and T8142 have), selected
by the handed-over layout. Preflight, which the module init also runs,
and the H16 probe now take the build the loader preloaded. H16 preload
rules get their own TEXT and DATA sizes; 0 keeps the 26.x/27.0 ones, so
existing rules are unchanged.

The 27.2 profile keeps the 25G83 boot values: the firmware span still
ends at TEXT + 0x36c000, and the host pool, IPC, heap and shared windows
lie past it, as on T6041, whose 27.2 build boots with its 27.0 values.
Its DATA has the 25G83 patchbay records and the rewritten _rtk_tunables
range 0x4480 earlier. As preloaded on a J773g it differs from the IPSW
image only in the CE script (__TEXT,ce_env), which stays in the identity
as on T6041 27.2; in fixed patchbay values (_COS 0x8132, RCOS 0x11, dApC,
dArW, GLFp); in GKTS, ECAP and ARcM, which normalize as before; and in
_rtk_tunables, which is zeroed. The digest is that normalized preload,
read on one boot; it matched on the next two boots. Like T6041 27.2,
the profile refuses DARTs with TTBR/TCR protection set.

Tested on a Mac mini (J773g), macOS 27.2 (26B123) firmware, kernel
7.3.0-m4drv8 with these modules: "H16 preload identity H16 T8132 27.2
26B123 accepted", the DARTs unprotected, READY, startup acks 4/0/3/0x22,
the ABI 3 accel node, and the pinned add-128 HWX (h16-run.py) run 20
times on each of two boots, 16384 of 16384 fp16 values exact every run.
The ANE KUnit suites were compiled, not run.

Signed-off-by: Diljit Singh <hey@djdev.me>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RyanTheTide

Copy link
Copy Markdown
Contributor

This overlaps with #2630, which admits the same T8132 27.2 build in the same six files. The two agree on the values that matter: TEXT 0xbc000 / DATA 0x2b0000, the same digest bytes, and the same patchbay offsets. Two independent readings matching is good evidence, but only one of them should land. #2642 additionally carries per-rule TEXT/DATA sizes in the preload rules and the protected-DART refusal. #2630 is already in a J713 (M4 Air, 27.2) lab kernel, so a J713 ANE run will cover the shared values whichever PR is kept.

Code-wise: picking next_build from the handed-over layout, with 0 meaning "keep the 26.x/27.0 sizes" in the preload rules, keeps the existing rules unchanged, and the KUnit pair checks that each build admits only its own layout.

Assisted-by: LLM (Claude:Opus 5.5)

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