Skip to content

kboot_gpu26: keep the 27.2 GPU off without its ADT start values - #455

Merged
DjDeveloperr merged 1 commit into
mainfrom
j615/t8122-gpu-272-require-values
Nov 22, 2026
Merged

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

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On macOS 27.2 the T8122 GPU start (#448) copies gpu-fast-die0-target and coredump-copy-buffer from the ADT onto the GPU node only when the ADT has them, and hands the GPU over either way. On a Mac whose ADT lacks either value, aura still enables the GPU node and its mailbox and sets apple,no-auto-pm on the GPU power domain. Only the kernel's own check then keeps the firmware from starting without its thermal target. The two values were also checked only after calibration had powered the GPU up and down once.

Change

  • Both values are now required. They are read and checked from the ADT before anything is powered.
  • An absent, malformed (wrong length) or zero value refuses the 27.2 start. The transaction rolls back, the GPU node and mailbox stay disabled, and the GPU is never powered.
  • With both values present, the GPU node gets the same properties as before, written after calibration through the same GPU node lookup as the rest of the 27.2 start.
  • One stale comment in dt_set_gpu() is updated; it still said 27.2 leaves the GPU disabled.

Testing

  • G15 host harness (tests/kboot_gpu_g15_host.c, arm64): every scenario was run on this branch and on main dff1235d, and each scenario's output (DT, PMGR/bus traces, log) was compared. The positive 27.2 start (t8122-27-start, the J615 case) is byte-identical to main. The changed scenarios are the refusals: absent values (both together, and each alone), malformed, and zero. All of them now refuse with no power cycle. Pass counts: this branch 102, main 99, with the same 12 pre-existing failures on both (25G83/stand-in fixtures, unrelated to this change).

  • pytest (the CI set): 864 passed, 27 skipped, same as main.

  • ESP Stage 2 build with the CI flags (-Wstack-usage=2048 -Os): links, no new warnings. clang-format is clean.

  • J615 aura-try one-shot on the default kernel (7.3.0-aurora-g15g272a, default command line). Production Stage 2 is aura main dff1235d exactly; the trial is dff1235d + this commit with the same DTB/U-Boot tail (byte-compared). The trial booted and GPU firmware was ready at 1.32 s with renderD128. All 76 GPU and mailbox DT properties are identical to production (apple,fast-die0-target 88, apple,coredump-copy-buffer 0x8000, both okay), and apple,no-auto-pm is on the GPU power domain in both. The boot had 0 SELinux AVCs, 0 failed units, 0 oops and the same error-level count as production.

  • Adversarial review (someone other than the author): no blockers, 4 nits, see the comment below.

Still to run

  • Nothing on the J615. No J613 or J504 row: the change only refuses earlier on machines whose ADT lacks the values.
Review notes

This came from an adversarial review of #448 after it merged. The same review raised two more points that this PR does not change:

  • The 27.2 path runs the calibration's stand-in GPU power model (calc_power_t8122_standin(), not ADT values). The kernel turns that model into the firmware's power target. A machine-sourced source is still needed.
  • 27.2 enablement still depends on the existing J613/J615 board checks (t8122_full_identity_prepare(), m3_air_boards). Replacing them with ADT facts is drafted separately. It waits on the power-model point, so the stand-in model does not reach more machines first.

Assisted-by: LLM (Claude:Opus 5.5)

The 27.2 GPU start copied gpu-fast-die0-target and coredump-copy-buffer
from the ADT onto the GPU node only when the ADT had them, and handed
the GPU over either way. A Mac whose ADT lacks either value then got an
enabled GPU node, an enabled mailbox and apple,no-auto-pm on the GPU
power domain, and only the kernel's own check kept the firmware from
starting without its thermal target. The values were also checked only
after the calibration had powered the GPU up and down once.

Require both values and read them from the ADT before anything is
powered. An absent, malformed or zero value now refuses the start: the
transaction rolls back, the GPU node and its mailbox stay disabled and
the GPU is never powered. The values are written to the GPU node after
the calibration, as before, through the same GPU node lookup as the
rest of the 27.2 start.

The host tests change to match: absent values (together and each on
its own), a malformed value and a zero value all refuse with no power
cycle.

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

Copy link
Copy Markdown
Contributor Author

Adversarial review of a9c1917e by someone other than the author: no blockers.

  • The only 27.2 enable path (t8122_gpu_publish_27 → t8122_gpu_enable_27) now reads both values before the first step that can power SGX. If a value is absent, the wrong length or zero, the draft DT is discarded: GPU node and mailbox stay disabled, no apple,no-auto-pm, no PMGR enables. The other T8122 enable paths can't run on 27.2.
  • With both values present the DT is unchanged: same properties, values and log line. t8122_gpu_node() and the old gpu alias lookup can't pick different nodes at the write, because a mismatched alias is refused earlier.
  • No caller of the removed dt_gpu_t8122_27_machine_values() remains anywhere in the tree. pytest (CI set) 864 passed, 27 skipped.

Nits, left for a later change so CI doesn't run again for wording:

  • A zero value logs "malformed … (len 4)".
  • The value table is exported through kboot.h only for the property-name loop.
  • "Never powered" excludes the opt-in chosen.asahi,t8122-gpu-power-diag=1 probe, which runs after a refusal as before.
  • Possible extra tests: a zero coredump-copy-buffer, a missing iop-gfx-nub, and !mmio_reads on the refusal paths.

Assisted-by: LLM (Claude:Opus 5.5)

@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.

Reviewed live head a9c1917e4687527f07bd6fda4b93ef8741a6036e against pre-pr-checklist.md (§1–§6).

Code, safety, and CI audit: 0 code blockers

  • §1 Scope & no new model gating: Adds no chip, board, or firmware-version gates; decides solely from the machine's ADT properties. Verified across all GPU paths in src/kboot_gpu.c, src/kboot_gpu26.c, and src/kboot_gpu_m4.c that t8122_gpu_publish_27() -> t8122_gpu_enable_27() is the only 27.2 GPU path consuming gpu-fast-die0-target and coredump-copy-buffer (M4/M4 Pro/M4 Max T8132/T6040/T6041, G17 T8140/T8142/T6050, and T8152 use separate handoff paths; no other T8122 enable path can run under V27_2).
  • §2–§3 Fail-closed ordering & no regression: Moving dt_gpu_t8122_27_machine_values_read() ahead of dt_gpu_t8122_26_calibrate() closes a genuine §3 gap from #448. An absent, non-u32, or zero gpu-fast-die0-target or coredump-copy-buffer now aborts inside t8122_fdt_transaction() before SGX is ever powered, discarding the draft FDT so GPU and mailbox stay disabled without apple,no-auto-pm, apple,gpu-power-model, or partial start values (while preserving chosen.asahi,t8122-gpu-power-diag=1 as before). On boards with both valid non-zero ADT values, t8122_gpu_node() matches the gpu alias validated by calibration, re-resolves the FDT offset per write, and emits the exact same DT properties and log line as main.
  • §4 & §6 Attribution & naming: Commit a9c1917e4687527f carries human author/committer + human Signed-off-by: with zero AI trailers; PR body carries Assisted-by:. Naming is clean.
  • CI & host tests: 15/15 CI checks green on a9c1917e (build, ESP stage 2 vital size, format-check, policy, all 5 stage1-size and 5 Pytest jobs), and the updated G15 host scenarios cover both-absent, each-absent, malformed-length, and zero-value refusals with !pmgr_enables && !pmgr_disables.
  • Non-blocking nits (no change required for merge): A zero ADT value currently logs malformed ... (len 4) rather than distinguishing zero from wrong length, and tests/kboot_gpu_g15_host.c only checks gpu-fast-die0-target = 0 (not coredump-copy-buffer = 0).

Blocker before merge (§5 Hardware Evidence)

This PR is marked ready for review (OPEN, non-draft), while ## Still to run notes that the J615 aura-try Stage 2 one-shot on the default kernel has not run yet. Per pre-pr-checklist.md §5 (and the bar applied on #448), please either:

  1. Run the queued J615 aura-try Stage 2 one-shot on a9c1917e4687527f07bd6fda4b93ef8741a6036e (default kernel & cmdline) and post the build/SHA binding, verified GPU node properties (apple,fast-die0-target, apple,coredump-copy-buffer), GPU firmware ready, and explicit regression counts (0 SELinux denials, 0 failed units, 0 new kernel errors), or
  2. Convert the PR to draft until that run completes.

No code changes are required — once the J615 §5 run is posted on this head, this is ready to flip immediately to APPROVE.

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J615 §5 row on this head (a9c1917e4687527f07bd6fda4b93ef8741a6036e), aura-try one-shot, default kernel 7.3.0-aurora-g15g272a and default command line:

  • Binding: production Stage 2 = aura main dff1235d exactly (payload SHA-256 05df4aa8…). Trial = dff1235d + a9c1917e (aura.bin SHA-256 c87a34e4…, built from this tree just before the commit, so the version string reads 1.0.0b14-gdff1235d-dirty) + the same DTB/U-Boot tail, byte-compared (payload 60a9aed8…). The booted DMI string confirmed the trial build.
  • GPU node: apple,fast-die0-target 88 and apple,coredump-copy-buffer 0x8000. GPU and mailbox both okay, and apple,no-auto-pm is on the GPU power domain. All 76 GPU and mailbox properties are identical to the production boot.
  • GPU firmware ready at 1.32 s, renderD128 present.
  • Regression counts: 0 SELinux denials, 0 failed units, 0 oops, 0 new kernel errors (12 error-level lines, the same as the production baseline).
  • Restored afterwards to production Stage 2 05df4aa8 and verified; the trial payload was removed from the ESP.

Assisted-by: LLM (Claude:Opus 5.5)

@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.

Re-reviewed live head a9c1917e4687527f07bd6fda4b93ef8741a6036e against pre-pr-checklist.md (§1–§6).

Re-review verification

  • Head & mergeability: Live head is unchanged at a9c1917e4687527f07bd6fda4b93ef8741a6036e (0 code blockers from the prior §1–§4/§6 audit). The 4 commits landed on main since merge-base dff1235d only touch build/release metadata (Makefile, VERSION, .github/workflows/stage1-size.yml, docs/releases/1.0.0b15.md) with zero overlap; PR is MERGEABLE / CLEAN.
  • §5 Hardware evidence (J615 row resolved): Audited #issuecomment-7081143597 and the updated PR body:
    • J615 aura-try one-shot on default kernel 7.3.0-aurora-g15g272a and default command line.
    • Explicit SHA-256 binding between production Stage 2 (dff1235d, payload 05df4aa8…) and trial (dff1235d + a9c1917e, aura.bin c87a34e4…, byte-identical DTB/U-Boot tail, payload 60a9aed8…, confirmed via booted DMI string; -dirty suffix from pre-commit build documented; restored to 05df4aa8 and trial payload removed).
    • GPU & mailbox DT parity confirmed: all 76 properties identical to production (apple,fast-die0-target = 88, apple,coredump-copy-buffer = 0x8000, both okay, apple,no-auto-pm on the GPU power domain); GPU firmware ready at 1.32 s with renderD128.
    • Regression counts: 0 SELinux denials, 0 failed units, 0 oops, 0 new kernel errors (12 error-level lines, matching production baseline).
  • CI: 15/15 checks green on a9c1917e.
  • Open blockers: None.

Ready to merge.

Assisted-by: LLM (Gemini 4 Neon)

@DjDeveloperr
DjDeveloperr merged commit 18eab30 into main Nov 22, 2026
15 checks passed
@RyanTheTide
RyanTheTide deleted the j615/t8122-gpu-272-require-values branch November 27, 2026 13:21
fbalazsy pushed a commit to fbalazsy/aura that referenced this pull request Dec 2, 2026
…Airs

Since aurora-silicon#604 (0ed3c1e) the full T8122 recipe (display, GPU, stand-in
power model, leakage fuse) goes in by default only on a board list
(J613, J615); every other T8122 board, the J504 14" MacBook Pro
included, gets the display switch only, and its GPU node stays
disabled ("GPU: not armed (no chosen.asahi,t8122-gpu=1)").

The list stood in for "the stand-in power model was run on these
boards", but the inputs the GPU setup acts on are this Mac's own on
every T8122: its ADT perf states and power values, its leakage fuse,
its powered identity (G15G, one cluster of 8 or 10 cores) and, on 27.2,
its ADT start values (aurora-silicon#455). The J504's 27.2 ADT describes the same
sgx and gfx-asc properties as the J613's, and the J504 loads the same
G15G images. Every check behind the switch still fails closed.

Drop the board list: every T8122 board gets the one recipe.
chosen.asahi,t8122-gpu=0, chosen.asahi,t8122-dcp=0 and
chosen.asahi,m3-defaults=0 still turn it off.

Link: aurora-silicon#583
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
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