Repository navigation
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
Conversation
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>
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:
Assisted-by: LLM (Claude:Opus 5.5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_v27since drm/apple, iommu: apple-dart: drive the M4 MacBook Air's internal panel on macOS 27.2 (v27 backend, on #2541's rebase) #2818) becomesfw_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_mirrornow 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 T8132fw_mirrorDART also getsfw_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 logsT8132 DART locked by the boot loader: locked roots kept (mirror), so a boot shows which DARTs the rule picks.Testing
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 renamedapple_dart_test_fw_live_prot.drivers/iommu/apple-dart.oat W=1 (clang, fleet82 config): no warnings.Still to run
J713 row detail
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.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)firmware segment ...: protection 0x5/0x7 as its live leaves (asked 0x3)lines, six per internal display DART.