Repository navigation
kboot_gpu26: run the bounded T8122 identity read on the 27.2 handoff (follow-up to #393) - #396
Merged
Merged
Conversation
The kernel's T8122 admission checks the SGX ID and core masks the boot loader read with the GPU powered (/chosen/asahi,t8122-gpu-powered-identity). On 27.2 nothing produced that witness. With chosen.asahi,t8122-gpu-power-diag=1, the 27.2 handoff now runs the existing bounded probe (t8122_read_powered_identity(): SGX power closure off at entry, power on, guarded ID/core-mask reads, power off, result published). The GPU and its mailbox stay disabled. Without the switch nothing powers the GPU, as before. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
approved these changes
Nov 20, 2026
Contributor
There was a problem hiding this comment.
Thanks Ryan, this looks good to me. I reviewed it against main on a host with no hardware attached:
- The identity comes from the hardware:
t8122_read_powered_identity()(kboot_gpu.c:2720) reads ID_VERSION, ID_COUNTS and the core masks from SGX and checks only generation 7, variant 2 and a nonzero mask inside 0x3ff (kboot_gpu_t8122_power.c:30). No board or version list is added. - Bounds are the existing ones: the SGX window must match between ADT and DT and cover the core-mask read (
kboot_gpu.c:2730), the power closure must be off at entry (kboot_gpu.c:2738), and every result property is reserved before power-on. An existing identity node is never replaced (kboot_gpu_t8122_power.c:48), so a second caller in the same boot can't power the GPU twice. - It runs inside the 27.2 publish transaction, after the reservations and after the GPU node is set disabled, with the offset looked up again (
kboot_gpu26.c:429). Withoutasahi,t8122-gpu-power-diag=1it returns before touching anything. - Older firmware is unchanged. I built the host G15 suite with ASan on arm64 for main and for main plus this PR: 81 passes on main, 83 on the head (your two new scenarios), and the same 12 stand-in/calibration fixtures fail on both with identical output. All 81 scenarios that pass on main give byte-identical logs on the head, the two-segment v1 scenario included.
run-t8122-gpu26-identity.shpasses andmake USE_CLANG=1 BUILDSTD=1 CHAINLOADING=1builds. - Nothing in MCC changes, so there is no overlap with #392.
Non-blockers:
kboot_gpu26.c:480: this reuses the existingV27_2gate and adds none. The #393 follow-up still stands: routing on the loaded firmware image would let 27.0, 27.3 beta and unknown 27.2.x iBoots reach this probe too.kboot.h:32:kboot_gpu_t8122_power.hmight be a more natural home for the prototype than the general kboot header.
Hardware rows after the merge (revert: git revert -m 1 <merge sha>):
- J613 on 27.2 with the switch set, from an aura main build: expect PASS and core-mask-0 0x37e, power released, GPU node disabled.
- J615 on 27.2 from an aura main build (your row was 0d67655d on the #393 base). Main carries #320, so run it with #392, or tell an MCC reset apart from this change.
- J613/J615 on 27.2 without the switch: no identity node, GPU never powered.
Contributor
Author
|
Hardware row, J615 (MacBook Air 15" M3) on the 27.2 stub,
0x3ff is the 15-inch Air's 10-core GPU. The SGX power vote was released each time, and there were 0 failed units on every boot. 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.
Follow-up to #393 (merged). This second commit was pushed to the #393 branch after the merge, so it was never part of that PR. One commit, on top of #393's head a284af1; it merges cleanly with current
main.Problem. The kernel's T8122 GPU admission checks the SGX ID and core masks that the boot loader read with the GPU powered (
/chosen/asahi,t8122-gpu-powered-identity). On the 27.2 handoff that #393 added, nothing produces that witness, so a future 27.2 G15G kernel profile would have no measured identity to admit against.Change. With
chosen.asahi,t8122-gpu-power-diag=1, the 27.2 handoff also runs the existing bounded probe,t8122_read_powered_identity(). It checks the SGX power closure is off at entry, powers it on, does guarded ID and core-mask reads, powers it off and publishes the result. The GPU node and its mailbox stay disabled. Without the switch nothing powers the GPU, as before. The switch is opt-in and off by default.Testing.
tests/kboot_gpu_g15_host.cadds thet8122-27-identityandt8122-27-no-identityscenarios. Both pass and clang-format is clean (run by J615-GPU)./chosen/asahi,t8122-gpu-powered-identity:Still to run. A 27.2 J613 (8-core: expect core-mask 0x37e). The GPU itself can't be enabled on 27.2 until a kernel G15G 27.2 firmware interface exists.
Raw readback (J615 boot 60832b51)
Lab evidence: traces/gpu/20261121-j615-g15g-272-identity/ (our own register readback, not tainted).
Assisted-by: LLM (Claude:Opus 5.5)