Skip to content

iommu: apple-dart: keep the firmware roots of any locked T8132 DART (J773g 27.2 dcpext0; replaces #2825) - #2867

Draft
RyanTheTide wants to merge 2 commits into
j713-disp3/dcp272-internalfrom
prfix5/dcp272-locked-t8132-roots-20261123
Draft

RyanTheTide wants to merge 2 commits into
j713-disp3/dcp272-internalfrom
prfix5/dcp272-locked-t8132-roots-20261123

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 22, 2026 •

Copy link
Copy Markdown

Problem

On macOS 27.2 the M4 Mac mini (J773g) boot loader leaves the dcpext0 firmware DART (286340000) and display DART (286300000) locked. A T8132 DART kept its firmware's locked roots (fw_mirror) only when it served an internal display processor handed over with the 27.2 image. So those two DARTs took the plain locked path, lost the firmware's root slots, and dcpext0 faulted instead of lighting HDMI. #2596 fixed that by keying on the dcpext's firmware version and one image UUID, which ties the choice to a single macOS build.

This replaces #2825. #2818's review fixes now carry that PR's TCR fix and a rename of the same flag, so this is the remaining change rebuilt on #2818's head (df2748e) as new commits, with no force push.

Change

Stacked on #2818. Two commits:

  • iommu: apple-dart: name the live-leaf protection after what it does: the flag that turns on the live-leaf protection (t8132_dcp_v27 since drm/apple, iommu: apple-dart: drive the M4 MacBook Air's internal panel on macOS 27.2 (v27 backend, on #2541's rebase) #2818) becomes fw_live_prot, and its helper becomes __apple_dart_fw_live_prot(). The selection of the 27.2 internal display DARTs (apple_dart_serves_t8132_dcp_v27()) keeps its name. No functional change.
  • iommu: apple-dart: keep the firmware roots of any locked T8132 DART: fw_mirror now comes from the DART's own state, as it already does for T6041/T6050/T8140/T8142. The DART must be locked, have no reserved-table handoff, and not be one of the display DARTs borrowed on the 26.6.2 path (preserve_display). A T8132 fw_mirror DART also gets fw_live_prot. There is no firmware-version or UUID check. An unlocked T8132 DART takes the plain path, as on every other SoC. The 27.2 internal display DARTs behave as in drm/apple, iommu: apple-dart: drive the M4 MacBook Air's internal panel on macOS 27.2 (v27 backend, on #2541's rebase) #2818: mirrored when locked, refused when unlocked or handed over with reserved tables. Any other locked T8132 DART logs T8132 DART locked by the boot loader: locked roots kept (mirror), so a boot shows which DARTs the rule picks.

Testing

  • KUnit, arm64 qemu, 16K pages: apple-dart 29/29. That includes the new apple_dart_test_keeps_fw_roots (locked, unlocked, handed-off and borrowed T8132 DARTs, the other mirrored SoCs with live-leaf protection on T8132 only, and two SoCs outside the rule) and the renamed apple_dart_test_fw_live_prot.
  • checkpatch --strict: 0 errors, 0 warnings, 0 checks on both commits. drivers/iommu/apple-dart.o at W=1 (clang, fleet82 config): no warnings.
  • J713 (M4 MacBook Air, macOS 27.2 stub), one-shot boot of integration/aurora 95a13cf + drm/apple: stop the M4 MacBook Air's internal DCP firmware on macOS 27.2 (DPMS off, deep sleep; replaces #2660) #2819 (with drm/apple, iommu: apple-dart: drive the M4 MacBook Air's internal panel on macOS 27.2 (v27 backend, on #2541's rebase) #2818) + this branch, on the default command line with Stage 2 unchanged:
    • The internal display DARTs 30a300000 and 30a340000 log "locked roots kept (mirror)" as before. The 6 firmware segments on each take their live-leaf protection, DCP boots, and eDP-1 is lit.
    • The rule picks one more DART on this Mac: 380300000, the PMP's DART. The PMP comes up the same way as without this change ("PMP firmware and endpoint ready").
    • 0 DART faults, 0 oops, 0 WARN, 0 AVC, 0 failed units. The kernel error lines are the same set as on the same base without this branch.
    • DPMS 3/3 with the same display power words; s2idle 2/2 (20 s RTC wake).

Still to run

  • J773g on 27.2, on this head with the default command line. Pass criteria: "T8132 DART locked by the boot loader: locked roots kept (mirror)" on 286340000 and 286300000, the live-leaf protection lines for dcpext0's segments, HDMI lit, 0 DART faults, 0 AVC, 0 failed units, and no new kernel errors. A list of any other DART that logs the line is also wanted. This needs an M4 mini owner.
J713 row detail
  • Kernel 7.3.0-aurora-pf5dart: integration/aurora 95a13cf, merged with 7a0110d (drm/apple: stop the M4 MacBook Air's internal DCP firmware on macOS 27.2 (DPMS off, deep sleep; replaces #2660) #2819, which carries drm/apple, iommu: apple-dart: drive the M4 MacBook Air's internal panel on macOS 27.2 (v27 backend, on #2541's rebase) #2818 df2748e), merged with this branch. Its tree matches this head.
  • Probe lines on the row boot:
    • apple-dart 30a340000.iommu: T8132 internal display DART on the 27.2 image: locked roots kept (mirror)
    • apple-dart 30a300000.iommu: T8132 internal display DART on the 27.2 image: locked roots kept (mirror)
    • apple-dart 380300000.iommu: T8132 DART locked by the boot loader: locked roots kept (mirror)
    • 12 firmware segment ...: protection 0x5/0x7 as its live leaves (asked 0x3) lines, six per internal display DART.
  • The kernel error lines are the same messages as the base-without-this-branch row: external display processors unusable (-110, the tip has no J713 dcpext stack), the G16 handoff contract, USB3 PHY -95, sn201202x cable revalidation, and the thermal_zone1 sensor. None of them come from apple-dart.
  • DPMS power words: off 0x0f000300 / 0x00002300 / 0x00000300 (DISP_CPU / FE / SYS), on 0x1000030f / 0x000023ff / 0x000003ff, in all three cycles.
  • The Mac was restored to its default kernel afterwards: the test kernel was removed, next_entry is empty, SELinux is Enforcing and no units failed.

The t8132_dcp_v27 flag selects one thing: re-exported firmware segments
take the protection of the live leaves that map them
(__apple_dart_t8132_dcp_v27_fw_prot()). Nothing in that helper is
specific to one SoC or firmware build. It reads the DART's own locked
root and leaves a region alone unless every page's live leaf maps
exactly that address with one protection.

Rename the flag to fw_live_prot and the helper to
__apple_dart_fw_live_prot(), so it can be set for other locked display
DARTs. The selection of the 27.2 internal display DARTs
(apple_dart_serves_t8132_dcp_v27()) keeps its name. No functional
change.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
A T8132 DART kept its firmware's locked roots (fw_mirror) only when it
served an internal display processor handed over with the 27.2 image,
so the J773g's dcpext0 DARTs, which the 27.2 boot loader also leaves
locked, took the plain locked path and lost the firmware's root slots.
Keying them on the dcpext's firmware version and image UUID instead
would tie the choice to one macOS build.

Whether the roots must be kept is visible on the DART itself: it is
locked and there is no reserved-table handoff. The T6041, T6050, T8140
and T8142 DARTs already decide that way. Do the same for
apple,t8132-dart, keeping out only the display DARTs borrowed on the
26.6.2 path (preserve_display), which keep their own handling. A T8132
fw_mirror DART also gets the live-leaf protection for its re-exported
firmware segments (fw_live_prot); __apple_dart_fw_live_prot() changes
a region only where every page's live leaf maps exactly that address
with one protection. The other SoCs keep their current protection.

An unlocked T8132 DART now takes the plain path like an unlocked DART
on any other SoC, as it did before for everything but the 27.2
internal display DARTs. Those are still refused when unlocked: they
are selected by their processor's handoff, which implies a lock.

The 27.2 internal display DARTs take the same path as before: mirrored
when locked, refused when unlocked or handed over with reserved tables.
Any other locked T8132 DART logs "T8132 DART locked by the boot loader:
locked roots kept (mirror)", so a boot shows which DARTs the rule picks.

KUnit: the selection for locked, unlocked, handed-off and borrowed
T8132 DARTs, the other mirrored SoCs, and two SoCs outside the rule.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Author

Review at 1651b82 (non-author, draft; reviewed the two commits on top of #2818: a50a088 and 1651b82). No blocker in the logic; two scope points.

Points to consider:

  • apple_dart_keeps_fw_roots() still decides by a SoC compatible list (t6041, t6050, t8132, t8140, t8142). The comment says "the DART's own state decides", but a locked DART on any other SoC takes the plain path. If the older SoCs' locked DARTs need the plain path for a hardware reason (DART generation, two- vs four-level roots, the DCP DART handling there), that property is what the check should test, and the comment should name it; if not, the list can go.
  • apple_dart_wants_fw_live_prot() is T8132-only "because no row has checked the change there"; fine for now, but it makes the same block behave differently per SoC. A follow-up row on one T6041/T8140 locked DART would let it apply to every fw_mirror DART.
  • On T8132 the rule now picks every locked DART, not only display ones: the J713 row shows the PMP DART (380300000) joining. That row is on the 27.2 stub; the same boards on the 26.6.2 path also boot with locked DARTs, and with this change those would be mirrored too unless they are preserve_display. A boot on the 26.6.2 path (any T8132 board), listing which DARTs log the new line, would show nothing else changes there.

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.

1 participant