Skip to content

kboot_gpu26: run the bounded T8122 identity read on the 27.2 handoff (follow-up to #393) - #396

Merged
DjDeveloperr merged 1 commit into
mainfrom
j615/t8122-gpu-272-handoff
Nov 20, 2026
Merged

DjDeveloperr merged 1 commit into
mainfrom
j615/t8122-gpu-272-handoff

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

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.

  • Host: tests/kboot_gpu_g15_host.c adds the t8122-27-identity and t8122-27-no-identity scenarios. Both pass and clang-format is clean (run by J615-GPU).
  • Hardware: J615 (15" MacBook Air, M3) on the 27.2 stub. The Stage 2 was the lab form of this exact patch: aura 0d67655d, whose diff is identical to this commit's (only the base differs), with the switch set, and kernel 7.3.0-aurora-j615d1. Result in /chosen/asahi,t8122-gpu-powered-identity:
    • probe-result 1 (PASS);
    • ID_VERSION 0x07022000 (G15G, as the admission gate requires);
    • ID_COUNTS 0x0011010a / 0x00040404;
    • core-mask-0 0x3ff (10 of 10 cores, the 15" Air's 10-core GPU);
    • power released afterwards, GPU node still disabled, 0 failed units.

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)
stage2 1.0.0b13-g0d67655d, kernel 7.3.0-aurora-j615d1
schema-version=00000001
probe-result=00000001
id-version=07022000
id-counts-1=0011010a
id-counts-2=00040404
core-mask-0=000003ff
core-mask-1=00000000
core-mask-2=00000000

Lab evidence: traces/gpu/20261121-j615-g15g-272-identity/ (our own register readback, not tainted).

Assisted-by: LLM (Claude:Opus 5.5)

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 DjDeveloperr left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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). Without asahi,t8122-gpu-power-diag=1 it 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.sh passes and make USE_CLANG=1 BUILDSTD=1 CHAINLOADING=1 builds.
  • Nothing in MCC changes, so there is no overlap with #392.

Non-blockers:

  1. kboot_gpu26.c:480: this reuses the existing V27_2 gate 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.
  2. kboot.h:32: kboot_gpu_t8122_power.h might 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.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Hardware row, J615 (MacBook Air 15" M3) on the 27.2 stub, chosen.asahi,t8122-gpu-power-diag=1, Stage 2 = v1.0.0b13.1 + the 27.2 DCP picks + #393 + this commit. Three boots, three kernels:

boot kernel probe-result ID_VERSION ID_COUNTS_1 / _2 core masks GPU node
60832b51 7.3.0-aurora-j615d1 1 (PASS) 0x07022000 0x0011010a / 0x00040404 0x3ff 0 0 disabled, handoff v2
c4c8b338 7.3.0-aurora-j615k3 1 (PASS) 0x07022000 0x0011010a / 0x00040404 0x3ff 0 0 disabled, handoff v2
5e73d8bd 7.3.0-aurora-j615io2 1 (PASS) 0x07022000 0x0011010a / 0x00040404 0x3ff 0 0 disabled, handoff v2

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)

@DjDeveloperr
DjDeveloperr merged commit a5a88df into main Nov 20, 2026
16 checks passed
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.

2 participants