Repository navigation
Conversation
DjDeveloperr
left a comment
There was a problem hiding this comment.
M5 Pro (J714s, T6050) validation of 4189e41. The J714s cold-boot path still works with this change. I'm requesting changes for the merge conflict.
What I checked
Code read. I read both commits on this branch (#1746's d927a32 and 4189e41) for J714s and for the other H17 staged SoCs.
- J714s admission. The J714s 27.0 hand-off (TEXT 0xc0000 at 0x100_0000_0000, DATA 0x2ac000 at 0x100_000c_0000) matches the "27.0" entry on layout and on TEXT digest, so it gets the same pin as before.
- The J716c and 27.3 entries. The "27.0 J716c" entry has the same layout but a different pin, so a J714s TEXT can't select it. The 27.3 entry has a different layout.
- Reload path.
ane_fw_reload_segment()now readsb->text_pin. Only a successfulane_fw_preload()sets it, so the sleep/wake reload never sees NULL. - T8140 and T8142. They have no build table, so they keep the single layout-and-pin check.
- All H17 staged SoCs. Two things change for every one of them:
- the IPC mapping grows from 64 KiB to 80 KiB (up to
ANE_FW_HEAP_DVA); - the size written at init+0x50 now comes from the firmware's request instead of the fixed 0xc441. On 27.0 the value is the same.
- the IPC mapping grows from 64 KiB to 80 KiB (up to
Compile. I built pull/1957/head on our Ryzen build server (arm64 defconfig + asahi.config, Image modules dtbs). make rc=0. ane_fw_cold.o, ane_fw_platform.o and ane_t6021.ko were rebuilt, with 0 warnings in drivers/accel/ane.
M5 Pro hardware: pass.
- Build. I applied the two commits to the M5's default kernel tree, where
ane_fw_cold.[ch]andane_fw_platform.[ch]are identical to this PR's base.ane_t6021.kowas built natively on the M5.- Against a control build of the unchanged sources, only
ane_t6021.kodiffers. The other ANE modules are byte-identical. - Its imports, depends and aliases match the stock module's.
- Against a control build of the unchanged sources, only
- Boot. I rebooted the unchanged default set once, with only that module swapped in. That boot sat between two boots on the stock module.
- PR module:
- The log shows
loader hand-off verified (27.0 build, TEXT sha256 93ae3a37…),READY; IPC 0xc441 bytes requestedandup at boot, accel node ready, and/dev/accel/accel0exists. - H17 add-128 passed 1000/1000 runs exact (128/128 lanes, 0 ulp), p50 132 us. I used
ane-run.pywith every run compared to the expected output; stock compares only the first and last runs. - There was no ANE or DART fault, oops or warning, either during the boot or during the runs.
- The log shows
- Stock module, before and after: the same hand-off, and 1000/1000 exact (p50 175 and 166 us).
- Restore. I restored and verified the default boot afterwards.
- Not tested:
- system sleep with the ANE running;
- the 27.3 entry (this M5 boots 27.0).
Findings
-
Blocking: the branch conflicts with integration/aurora in
ane_fw_handoff_present()(drivers/accel/ane/ane_fw_cold.c:2137-2188on this branch). Because of the conflict, GitHub runs no CI on this PR.- What changed on the tip. 79e1e9f ("accel/ane: Describe the T8142 (M5) ANE on the H17 staged backend") changed the same function after this branch's base. It now hashes the handed-off TEXT even when the layout isn't this SoC's, and adds a second line with both segments' physical and DVA ranges, so one boot of a new SoC or firmware reports both.
- What this branch does. It hashes only under
if (layout), so taking this side would drop that diagnostic again. - Suggested fix. Please rebase #1746 and this PR onto the tip and keep the tip's behaviour:
- compute
layout; - hash whenever
regions_ok; - pick the build with the digest;
- print
h.text_digestin the tip's two diagnostic lines (the tip's localdigest[]no longer exists here).
- compute
- The other files.
ane_fw_platform.[ch]merge cleanly.
-
Ryan's open point on #1746 still applies to this branch's copy of d927a32.
ane_fw_boot()passes the whole 80 KiBb->ipcwindow toane_fw_transport_init()(ane_fw_cold.c:1748-1749). The channel table is therefore bounded by the window, not by theipc_bytesthe firmware asked for, which is now also written at init+0x50. -
Nit.
H17 ANE: READY; IPC %#llx bytes requested(ane_fw_cold.c:1727) is adev_info.ane_fw_boot()also runs in every cold cycle (:789): each resume, and each wake of a parked engine on SoCs with macos_sleep. So the line repeats on every wake.dev_dbgwould fit, like the "ANE boot: READY" line above it, or printing it once per boot.
Once the branch is rebased and CI is green, I'll re-run the M5 check on the new head.
|
The production boot stub pins at macOS 27.2 (26B123), so please retarget this to 27.2. This pins the J716c 27.0 ANE preload; please add the J716c 27.2 build. |
8402290 to
09ebba3
Compare
|
@DjDeveloperr: this is now one commit on current
Re-tested on the J716c with #1956 and #2162: hand-off verified, 1000/1000 add-128 bit exact, no faults. @RyanTheTide: understood on 27.2. This PR only adds the J716c's 27.0 pin; the J714s's pin and the selection are unchanged. A J716c 27.2 entry needs the preload measured on a J716c booted through the 27.2 stub (layout and TEXT digest; on the J815 the 27.2 layout differs). This one isn't on the 27.2 stub yet. I'll add the 27.2 entry once it's measured, here or as a follow-up, whichever you prefer. 🤖 Generated with Claude Code |
The macOS 27.2 (26B123) stub's iBoot preloads a different ANE build on the M5: TEXT 0xbc000 and DATA 0x2b0000, DATA at 0x100_000b_c000 (27.0: 0xc0000 and 0x2ac000 at 0x100_000c_0000); both end at the same IOVA. macOS 27.2.1 (26B131) ships the same image byte for byte. The TEXT pin so far is the digest of TEXT as loaded, which can only be measured: iBoot fills environment sections in TEXT, so no IPSW image hashes to it. Add a code pin beside it, the TEXT digest with those sections zeroed, which is computed from the image, and accept TEXT matching either. The 27.0 build has one such section, text_env (32 bytes, a fixed 00 01 .. 07 pattern in the image). The 27.2 build adds __TEXT,ce_env (0x4000 bytes at 0xb4f80, zero in the image but its first byte) ahead of text_env, and iBoot fills it too, so a platform lists its environment sections as ranges. On a code pin miss the driver logs the digest of the TEXT before the first of them, which tells a loader write elsewhere from a different build in one boot. Let a platform name further builds (next_build), each with its preload layout and pins, and select the one whose layout the loader handed over. T8142 gets the 27.2 build, pinned by its code digest from h17_ane_fw_theia_j73y (RTKit 3514.41.1), and 27.0 keeps its measured pin with its code pin added. A reload after sleep now compares TEXT with the digest it had at boot. Each boot logs the build and its code digest. Tested on J815 with the 27.2 stub: "firmware 27.2 26B123, TEXT code sha256 9b574867... (code pin)", loader hand-off verified, and an H17 program's output matches macOS's (1080p frame, luma 100% within 1). The ANE KUnit suites pass. Not re-run on 27.0: its code pin is computed from the 27.0 image and hasn't been checked against a live preload, and its measured pin is kept unchanged. Signed-off-by: Nick <nekreshen@yandex.ru> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit e862711)
The T6050 27.0 (26A428) TEXT has two sections iBoot fills: ce_env (0x4000 at 0xb8280) and text_env (0x20 at 0xbc280). The J716c (M5 Max) boots the same build as the J714s with the same layout, but its TEXT as loaded matches no pin, so the driver left the engine off. Give the 27.0 build the firmware's code pin: the image's TEXT digest with both sections zeroed. A board's TEXT is admitted if its digest with those sections zeroed matches; the J714s's measured pin is kept. Add the macOS 27.2 (26B123) build: TEXT 0xbc000 and DATA 0x2b0000 with DATA at 0x100_000b_c000, its two loader-filled sections at 0xb4f80 and 0xb8f80, and its own code pin. The handed-over layout selects the build. KUnit: each T6050 build admits its own preload layout and refuses the other's, and has a code pin over two ordered sections inside TEXT. Developed with Claude Code. Signed-off-by: Erik Bourget <erik@ebourget.net>
09ebba3 to
c2b4683
Compare
|
@RyanTheTide: done. The J716c 27.2 (26B123) build is in, and checked on the J716c booted through the 27.2 stub: admitted by its code pin, 1000/1000 add-128 bit exact. The 27.2 preload layout differs from 27.0's (TEXT 0xbc000, DATA 0x2b0000 at 0x100_000b_c000), so this now uses #1899's per-build entries and code pins and is stacked on it. The code pin also covers the J716c's 27.0 TEXT, so the per-board pin list is gone. 🤖 Generated with Claude Code |
Lets the T6050 ANE start on the J716c (M5 Max) and on the macOS 27.2 (26B123) firmware build.
Stacked on #1899 (T8142 27.2 build): this branch carries its commit, rebased onto current
integration/aurora, and uses its per-build entries (next_build, selected by the handed-over preload layout) and code pins (text_code_pin, TEXT digest with the loader-filledtext_envsections zeroed). Merge #1899 first.Change
ce_env(0x4000 at 0xb8280) andtext_env(0x20 at 0xbc280). The J716c loads different bytes there than the J714s, so its TEXT as loaded matched no pin. The 27.0 entry gets a code pin over the image with both zeroed, which admits either board; the J714s's measuredtext_pinstays.ANE_T6050_PLATFORM, as accel/ane: T8142: admit the macOS 27.2 (26B123) firmware build #1899 does for T8142. Nothing else changes for T8140, T8142 or H16.Both code pins are computed from the firmware image in the restore image (
h17_ane0_fw_hyperion_j71y).Testing
On a J716c (M5 Max, 128 GB), one kernel (this branch, #1956, #2162 and #2177 on
integration/aurora59b02d5), through both stubs:firmware 27.0 26A428, TEXT code sha256 f8141439… (code pin), hand-off verified,/dev/accel/accel0, H17 add-128 1000/1000 runs bit exact, no DART fault, oops or warning.firmware 27.2 26B123, TEXT code sha256 9f3cc82b… (code pin), same results. Before this change, 27.2 was refused (layout differs).ane-fw-platform5/5 including the new case; every ANE suite passes exceptane-h16-program'sprogram_add128_slots_test, which fails the same way on the base.🤖 Generated with Claude Code