Repository navigation
iommu/apple-dart: gate the firmware table handoff on its DT property - #2474
Conversation
apple_dart_fw_handoff_enabled() required the DART to be locked, to carry apple,firmware-root-handoff = <1>, and to be an apple,t8140-dart. The property is the boot loader's statement that it reserved the locked root and leaf table pages; the compatible check added nothing a loader could not already say, and it would silently drop the handoff on any other SoC whose loader sets the property. Gate on the property and on the one hardware condition the table walker depends on: the DART uses the APPLE_DART2 page-table format, which apple_dart_pte_to_paddr() decodes. T8103-format DARTs never take the handoff. No in-tree DT sets the property; only the boot loader adds it, so DARTs without it are unchanged. The host fixture replaces its "other SoC" case with a DART1-format case. Fixes: e47d06c ("iommu/apple-dart: reserve retained firmware tables and root slots") Suggested-by: Chris Kearney <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
Three probe-time conditions tested of_machine_is_compatible("apple,t8132")
next to a check that already implies it:
- the J713 radio DART and the off-qualified-firmware display DARTs also
require an apple,t8132-dart node, which only T8132 device trees have;
- the live MTP bypass retention also requires apple_t8132_live_mtp(),
which is true only on T8132 boards (J713, J715, J604).
Drop the machine checks. No behaviour change.
Credit to Eryk Wieliczko and Diljit Singh, who wrote the conditions.
Signed-off-by: Ryan Murray <[email protected]>
|
J700 (MacBook Neo) row, from one combined test kernel (integration b4cd7b3 plus this PR, #2477, #2370 and #2299), one-shot boot on the production Stage 2, compared against the production kernel:
|
|
Blockers: 1.
The T8132 commit (2561bf8) is a no-op as stated: HW row: J700 (T8140) on 2561bf8 + integration, booted by a Stage 2 that sets Assisted-by: LLM (Claude:Opus 5.5) |
|
Merge-train adversarial review (MERGETRAIN-LINUX2) at 2561bf8: BLOCKERS. Not merging until the blockers below are fixed or answered; the details give file:line and a failure case. Full review#2474 iommu/apple-dart: gate the firmware table handoff on its DT property @2561bf89VERDICT: BLOCKERS Blockers
Nits
Missing rows
|
apple_dart_fw_handoff_enabled() admitted any locked DART with the APPLE_DART2 PTE layout. That includes the T6000 DARTs (M1 Pro/Max display and DCP DARTs), which never set dart->version. The paths that keep a handed-off table away from firmware-owned slots (retire, the per-slot invalidate and the locked map/unmap) all require version 0x0202 or later, so on such a DART a loader that set apple,firmware-root-handoff = <1> would get a whole-SID TLB flush under the running DCP on the first unmap. Require dart->version >= 0x0202 as well. Only the T8110 family reports a version, so this keeps T6000 and pre-2.2 DARTs on the existing no-handoff path. The host fixture gains two refusing cases: a DART with no version, and one at 2.1. Both fail on the previous predicate and pass with this one; all 88 cases pass. Signed-off-by: Ryan Murray <[email protected]>
|
Pushed ab6115c for review blocker 1 (one push): Testing:
Still to run: the J700 row under a Stage 2 that sets the property (the handoff branch itself has never run), and an M1 Pro no-change boot. This needs a fresh adversarial pass and Dj's verdict at the new head. |
|
Merge-train re-review (MERGETRAIN-LINUX3, a different reviewer than the fix author) at ab6115c: NO BLOCKERS. Our earlier T6000 blocker is resolved. apple-dart.c:1050-1051 now requires Nits:
Still owed by us before merge: a J700 row under a Stage 2 that sets |
There was a problem hiding this comment.
Adversarial review against pre-pr-checklist.md (§1–§6) at verified live head ab6115c5c0461fb544b4187ba5c448b6b90dbcab: 0 code blockers, but requesting changes for a §5 hardware evidence blocker before merge.
Blocker (§5 Evidence)
- Handoff-enabled branch is untested on hardware, and no hardware boot has been run at
ab6115c5c046:- The core runtime behavior change in
drivers/iommu/apple-dart.caltersapple_dart_fw_handoff_enabled()(addingdart->hw->fmt == APPLE_DART2 && dart->version >= 0x0202in place ofapple,t8140-dart). All posted hardware rows (J413, J316s, J700) ran at the earlier head2561bf89and took the no-handoff path (the J700 boot used a Stage 2 that did not setapple,firmware-root-handoff). - Please post hardware results at
ab6115c5c046covering:- J700 (T8140) under a Stage 2 that sets
apple,firmware-root-handoff = <1>(exercising the positive handoff path): handoff/mirror dmesg matching production, internal display up through s2idle, 0 new DART faults, 0 AVC denials, 0 failed units. - M1 Pro (T6000, J316s) regression boot at
ab6115c5c046: confirming 0 DART faults, 0 AVC denials, and 0 failed units.
- J700 (T8140) under a Stage 2 that sets
- The core runtime behavior change in
Code & Checklist Summary (§1–§4, §6 — all clear)
- Code (
drivers/iommu/apple-dart.c,tools/asahi/apple-dart-fw/fixture.c,tools/asahi/apple-dart-fw-tests.py):- The prior T6000/pre-v2.2 blocker is cleanly resolved at
ab6115c5c046. Verified every assignment todart->versioninapple-dart.c(line 5681 tunneled T8132 PCIe-C wheredart->locked = falseat line 5859, and line 5717case DART_T8110:).apple_dart_hw_t6000leavesdart->version == 0and pre-2.2 T8110 DARTs faildart->version >= 0x0202, matching all three handoff-aware TLB/retire guards (lines 1579, 2082, 2735). - Verified commit
2561bf89removing three redundantof_machine_is_compatible("apple,t8132")checks is a true no-op (apple,t8132-dartis T8132-only at lines 5379/5386, andapple_t8132_live_mtp()is true only on J713/J715/J604 perinclude/linux/soc/apple/t8132.h). - Host fixture covers
handoff-dart1-format,handoff-unversioned, andhandoff-version-0201;host-testsgreen (88/88) and branch clean againstintegration/aurora.
- The prior T6000/pre-v2.2 blocker is cleanly resolved at
- §1–§3, §6: Clean — replaces
apple,t8140-dartmodel gate with hardware format/version + DT handoff property; no hacks or safety regressions. - §4 Attribution: Clean — all three commits (
76a8a2a1,2561bf89,ab6115c5) carry human author/committer (Ryan Murray) and humanSigned-off-by:with zero AI trailers; PR body ends withAssisted-by:.
Non-blocking Nits
drivers/iommu/apple-dart.c:1042: comment says "Only the T8110 family reports a version"; tunneled T8132 PCIe-C DARTs also set0x0202at line 5681 (harmless sincetunneledforcesdart->locked = false), so "Only probed T8110-family DARTs report a version" would be slightly more exact.- PR body
## Change/## Testingstill describe the pre-ab6115c5predicate and86/86fixture count; worth refreshing to matchab6115c5(dart->version >= 0x0202,88/88).
RyanTheTide
left a comment
There was a problem hiding this comment.
Review at ab6115c. The handoff requires the DT opt-in, hardware lock and the supported PTE format plus the probed version. That is narrower than a per-board choice. The existing MTP-specific path remains separate; verify it stays unaffected. Please record both a T8112 legacy probe without the opt-in and a positive locked opt-in row that performs map, unmap and resumed DMA. The host cases cover the admission edges but don't establish that live DMA survives adoption.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at ab6115c5c046: the code is ready; it needs only a row at this head.
Blockers: none in the code. Missing row: the change is about the handoff branch, and only the paths without the handoff have run. Needed at the updated head: the J700 under a Stage 2 that sets apple,firmware-root-handoff = <1>, with the handoff and mirror lines in dmesg, the internal display up through s2idle, and no new DART faults. The branch also conflicts with main; update it first.
Checked: no Apple material. This removes a chip gate: the firmware table handoff is now chosen by the DART's apple,firmware-root-handoff DT property, and the host fixture covers a DART1-format case instead of the "other SoC" case (86/86). The J413 (and other) boots without the property show no regression: 3 s2idle cycles, 0 DART errors. CI green before the conflict. This replaces my earlier review.
Evidence
Read ab6115c5 (apple-dart.c, the fixture). Other SoCs come after the merge.
Superseded by the review at ab6115c
Retain main's live internal-display DART admission check while forwarding the DT handoff selection and removal of redundant guards from the radio and retained MTP paths. Signed-off-by: Ryan Murray <[email protected]>
|
Forwarded the branch to current main at The DART host fixture passed 88/88, and the ARM64 16 KiB DART object built at |
satchlj
left a comment
There was a problem hiding this comment.
Gemini 4 Neon on @satchlj's behalf
Verdict at ae07b8eb53e5
APPROVE — Clean forward-merge preserving main's internal display admission block while gating firmware DART table handoff on the explicit DT property (apple,firmware-root-handoff == <1>), APPLE_DART2, and dart->version >= 0x0202, with all 4 CI checks green.
Blockers
None. (Note: exact-head hardware boot/IOMMU row at ae07b8eb53e5 remains owed before merge per repo readiness checks.)
Checked
- Diff audited (3 files, +20/-9):
drivers/iommu/apple-dart.c,tools/testing/selftests/apple/apple-dart-fw-tests.py,tools/testing/selftests/apple/fixture.c.- Confirmed
apple_dart_fw_handoff_enabled()requiresdart->locked && dart->hw->fmt == APPLE_DART2 && dart->version >= 0x0202plusof_property_read_u32(dart->dev->of_node, "apple,firmware-root-handoff", &handoff) == 0 && handoff == 1, preventing false matches on T6000/DART1/unversioned/v0201 nodes. - Confirmed redundant
of_machine_is_compatible("apple,t8132")guards are removed cleanly fromj713_radioandapple_t8132_live_mtp(). - Confirmed host selftest fixture covers
handoff-dart1-format,handoff-unversioned, andhandoff-version-0201.
- Confirmed
- CI checks at
ae07b8eb53e5: 4/4 successful, 0 failing, 0 pending (Host tests/host-tests6m25s,pr-text,pr-readinessx2). - Untested scope: Static diff review and CI verification only; no kernel build or live Apple Silicon IOMMU/DART hardware boot was performed in this userspace review.
Evidence
head: ae07b8eb53e5 (3 files, +20/-9)
CI: 0 cancelled, 0 failing, 4 successful, 0 skipped, 0 pending
Host tests/host-tests: PASS (6m25s)
pr-text, pr-readiness x2: PASS
|
ae07b8e Neo (T8140) + J616s (T6040) + J615 (T8122) (batched 0-diff merge onto main) PASS: all apple-dart IOMMUs probed cleanly, Borealis VK + GL OK on Neo/J616s, external DP-3 + eDP-1 OK, 2/2 rtc s2idle OK on all 3 Macs, Enforcing, 0 failed, 0 AVC on Neo/J616s, 0 DART/IOMMU kernel errors; fleet defaults restored. |
Problem
apple_dart_fw_handoff_enabled()(drivers/iommu/apple-dart.c:1043, e47d06c) took the reserved firmware table handoff only onapple,t8140-dart, even though the boot loader'sapple,firmware-root-handoff = <1>property is what says the tables were reserved. Three other probe conditions also checkedof_machine_is_compatible("apple,t8132")next to anapple,t8132-dartcompatible or a T8132-only board helper.Change
apple_dart_pte_to_paddr()decodes. T8103-format DARTs never take it.No in-tree DT sets the property; only the boot loader adds it. DARTs without it are unchanged on every SoC.
Testing
Host fixture
tools/asahi/apple-dart-fw-tests.py: 86/86 pass. The "other SoC" case is replaced with a DART1-format case.Built with the lane release config (arm64, LLVM=1):
apple-dart.owith W=1, no new warnings.Hardware (one-shot test kernel 7.3.0-aurora-swl1 or -swl2 = integration 0abc2f3 + this and the other open sweep PRs, 2026-11-20):
Hardware (one-shot test kernel 7.3.0-aurora-swl1 or -swl2 = integration 0abc2f3 + this and the other open sweep PRs, 2026-11-20):
Still to run
dmesg | grep -i dartshows no new faults. Hardware rows: pending.Credit and reach
Chris Kearney wrote the handoff; Eryk Wieliczko and Diljit Singh wrote the T8132 conditions. SoCs reached that we cannot boot: any SoC whose loader sets the property on a DART2-format DART. Without that property, nothing changes.