Skip to content

drm/asahi: g16: admit 25G83 on every T8132 Air with one normalized entry - #2672

Merged
DjDeveloperr merged 1 commit into
aurora-silicon:mainfrom
kazuhidet:j715/g16-one-normalized-25g83
Nov 26, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-silicon:mainfrom
kazuhidet:j715/g16-one-normalized-25g83

Conversation

@kazuhidet

@kazuhidet kazuhidet commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

What: admit the 25G83 GPU firmware on every T8132 Air with one normalized boot_filled entry, instead of one entry per board. With it the J715's GPU comes up.
Tested: J715 M4 Air, 10 cores, OS firmware 26.6.2, with this entry as the only one in the table, in the J715's own kernel build: firmware identity accepted, READY, Hyprland session. Not booted from ad87173b itself.
Risk: two-way · M4 (T8132) Airs; the J713 entries stay
Not yet: a boot at this head; J713 8-core and 10-core.

Follow-up to the review of #2667: describe the block iBoot fills in boot_filled, so that one normalized entry admits every T8132 Air.

What iBoot writes

I compared the 25G83 TEXT from the 26.6.2 IPSW (Firmware/agx/armfw_g16g.im4p, rkosftab image b000, whose entropy records are at 0x5c8df/0x5c9c2) with the TEXT loaded on a J715. Besides the entropy, all the differing bytes fall into three ranges, and the image itself describes each one:

Range What it is Where the image describes it
(0x23c, 8) header field —
(0x5c8df, 0x231) record block (GKTS … ECAP …) header at 0x22c/0x230
(0x5cb10, 0x6a0) tunables block TUNS (pointer) and TUNZ (size) records

With these zeroed, the file's TEXT and the J715's loaded TEXT give the same digest (3a41e477…), and no differing byte is left outside the ranges. The digest can therefore be derived from the public firmware file alone.

Change

Adds one normalized 25G83 entry with boot_filled, ahead of the per-board entries. The G17 tables already work this way.

The three J713 entries stay after it until both J713 variants have booted on 26.6.2 with only the normalized entry (see the review). They can then go in a follow-up. The normalized entry has its own name, so the identity line shows which entry admitted the image. With this PR, #2667 (a J715 entry) is no longer needed.

Testing

Machine Result
J715 (Mac16,13, 10 cores, OS firmware 26.6.2), table with only this entry pass: GPU firmware build: Apple GFX 25G83 (normalized loaded image), firmware identity accepted, READY, Hyprland session
J713, 8-core and 10-core not tested: no J713 here

Could someone with a J713 boot this, so the 8-core and 10-core images are covered before the old entries go? If a J713 doesn't match, its identity line will show which digest it measured, and I'll look at it again.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Nice work. Deriving the three ranges from the image's own header and its TUNS/TUNZ records, and showing the result matches the IPSW TEXT, makes the identity reproducible from the public file. That is better than a digest per board.

One risk before it lands: the three J713 entries are removed, and this has only run on a J715. If a J713's iBoot writes anywhere outside these three ranges (the 10-core entry was added separately in #1704 for that kind of reason), its GPU stops at "unsupported GPU firmware build" after this merges. Two options: keep the old J713 entries next to the new one until someone runs an 8-core and a 10-core J713 on 26.6.2 with only the new entry, or check offline against the J713 loaded-TEXT digests the old entries were made from, if those dumps still exist. A 27.2 J713 doesn't load 25G83, so it can't prove this.

Assisted-by: LLM (Claude:Opus 5.5)

@kazuhidet

kazuhidet commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks. I took the first option in ae30d1a: the normalized entry is now added ahead of the per-board entries, and the three J713 entries stay. I don't have a J713 or its loaded-TEXT dumps, so I can't run the offline check. The new entry is named Apple GFX 25G83 (normalized loaded image, boot-filled ranges), so a J713 boot shows directly which entry admitted it.

A build of integration/aurora with this table is clean. The J715 result from the description (normalized entry only) still holds, since that entry is unchanged.

Once someone boots an 8-core and a 10-core J713 on 26.6.2 with only the normalized entry, I can remove the old entries in a follow-up.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks. Checked ae30d1a: the normalized entry is first, and both J713 entries (8-core, 10-core) are still there below it, so nothing a J713 boots today loses admission. With the entry name telling which one admitted a boot, removing the old entries later is easy to justify from a J713 row. Resolved from my side.

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 at ae30d1aeca6c. Requesting changes for a KUnit regression introduced by shifting t8132::CONFIG.firmware indices.

Blocker

  • Broken KUnit test (drivers/gpu/drm/asahi/fwid.rs:547-572): asahi_fwid::tests::j713_accepts_all_loaded_images() checks the three existing J713 25G83 digests and asserts:
    assert!(core::ptr::eq(found, &builds[i]));
    Prepending the new normalized FirmwareBuild at index 0 of crate::g16::hw::t8132::CONFIG.firmware (drivers/gpu/drm/asahi/g16/hw.rs:41-57) shifts the three existing J713 entries to builds[1..=3]. Because measured() will now return &builds[i + 1], j713_accepts_all_loaded_images() will panic under KUnit (this was missed by CI because host-tests does not run kernel KUnit tests).
    • Please update j713_accepts_all_loaded_images() in drivers/gpu/drm/asahi/fwid.rs to cover the new normalized entry at builds[0] (including verifying its boot_filled ranges lie within text_size) alongside the shifted per-board fallback entries at builds[1..=3].

Non-blocking Suggestion

  • Consider squashing d8bf1a092dd1 and ae30d1aeca6c together with the fwid.rs KUnit update so git bisect does not pass through an intermediate commit that removes the J713 fallback entries.

Checklist Summary (§1–§6)

  • Firmware entry (drivers/gpu/drm/asahi/g16/hw.rs:41-57): All three boot_filled ranges (0x23c, 8), (0x5c8df, 0x231), (0x5cb10, 0x6a0) fit within text_size (0x60000), and fwid::digest_at() verifies intact GKTS/ECAP records at 0x5c8df/0x5c9c2 before zeroing boot_filled, matching the G17 boot_filled pattern. Keeping the three J713 entries below the normalized entry preserves J713 admission until confirmed.
  • §1–§4, §6: Clean — moves away from per-board gating, no cmdline hacks, clean-room structural offsets + SHA-256 digest, human-only commit metadata with Signed-off-by:.
  • §5 Evidence: J715 (Mac16,13, 26.6.2) boot with only the normalized entry is reported; on the updated head, please also include regression counts (0 SELinux denials, 0 failed units, 0 new kernel errors). J713 8-core and 10-core 26.6.2 rows remain needed before a follow-up drops the fallback entries.

The T8132 table pins the same 25G83 image (build 2 of armfw_g16g.im4p) three
times, one TEXT digest per J713 variant, and aurora-silicon#2667 would add a fourth for the
J715. The images differ only in what iBoot writes into TEXT at load time.

Comparing the TEXT of the 26.6.2 firmware file with the TEXT loaded on a J715
shows that iBoot writes three ranges besides the two entropy records. The
image describes each of them itself:

  - 0x23c, 8 bytes: a header field.
  - 0x5c8df, 0x231 bytes: the record block (GKTS ... ECAP ...). The header
    states this offset and length at 0x22c/0x230.
  - 0x5cb10, 0x6a0 bytes: the tunables block. The block's TUNS record points
    at it, and its TUNZ record gives the size.

With these ranges in boot_filled, the file's TEXT and the J715's loaded TEXT
hash to the same digest. Every byte that differs between the two lies inside
the ranges. Add that single entry ahead of the per-board ones, as the G17
tables already do, and name it so the identity line says which entry admitted
the image.

Keep the J713 8-core and 10-core entries after it for now. Only a J715 has
booted with just the normalized entry; if a J713's iBoot writes anywhere
outside the three ranges, removing its entries would stop its GPU at
"unsupported GPU firmware build". They can go once both J713 variants have
booted on 26.6.2 with only the normalized entry.

j713_accepts_all_loaded_images() now expects the J713 digests at builds[1..=3],
and checks that the normalized entry at builds[0] is found by its own digest
and that its boot_filled ranges lie inside TEXT.

Tested on J715 (Mac16,13, 10 cores, OS firmware 26.6.2) with only the
normalized entry in the table: "firmware identity accepted", READY, Hyprland
session. Not tested on J713.

Signed-off-by: Kazuhide Takahashi <[email protected]>
@kazuhidet
kazuhidet force-pushed the j715/g16-one-normalized-25g83 branch from ae30d1a to ad87173 Compare November 22, 2026 16:29
@kazuhidet

Copy link
Copy Markdown
Contributor Author

Thanks, you're right: with the normalized entry first, measured() finds the J713 digests at builds[1..=3], so j713_accepts_all_loaded_images() would fail under KUnit.

Updated, squashed into one commit:

  • The test now expects the J713 digests at builds[i + 1].
  • It also checks that the normalized entry at builds[0] is found by its own digest, and that its boot_filled ranges lie inside text_size.
  • The two commits and the test fix are now one commit, so bisect never passes through a table without the J713 entries.

Checked locally:

  • rustfmt is clean for the changed lines. The file's other rustfmt differences are already on the base.
  • KUnit: an arm64 build of drivers/gpu/drm/asahi/ at this head with CONFIG_KUNIT=y and the J715 config compiles cleanly, with the test in aurora.o. It has not been run.
  • Not run on hardware or under QEMU: there is no arm64 KUnit runner here.

§5 counts: I don't have them for the J715 boot with only the normalized entry. That record covered the GPU only. The J715's everyday kernel admits the GPU through its own per-board 25G83 entry, the one #2667 proposed. Its boots show:

  • SELinux: not applicable, since this install has no SELinux.
  • Failed units: 2 local services (j713-owner-assets, m4-j715-backlight).
  • Kernel errors: the known set.

That kernel isn't this table. If you want exact counts for this head, I can boot the J715 with it once more.

J713 8-core and 10-core rows are still needed before the per-board entries can go.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-checked at ad87173. The squash leaves g16/hw.rs identical to ae30d1a. The only change is the test, and it is right: lookup() returns the first entry whose digest matches, so the J713 digests now land on builds[1..=3] and the normalized digest on builds[0] (fwid.rs:566-583). The boot_filled ranges end at 0x5d1b0, inside the 0x60000 TEXT. Admission is still keyed on the image's sizes, entropy records and digest only, and an unknown T8132 image is now reported with the same three ranges zeroed, which is the digest a J713 follow-up will need.

One thing left: the J715 row in the description was taken with the entry's earlier name and with a table holding only that entry, so it isn't at this head. Yes please to the boot you offered at ad87173 with the full table: the "GPU firmware build: Apple GFX 25G83 (normalized loaded image, boot-filled ranges)" line, plus failed units and new kernel errors. A KUnit run of asahi_fwid under arm64 QEMU would also close the test change, if someone with a runner can do it. The J713 rows are only needed for the follow-up that removes the per-board entries.

Assisted-by: LLM (Claude:Opus 5.5)

@kazuhidet

Copy link
Copy Markdown
Contributor Author

KUnit run of asahi_fwid at ad87173b under arm64 QEMU with KVM. This corrects my last reply: an arm64 KVM host was available after all.

Setup

  • Kernel: this PR's head (ad87173b), built with clang/LLD 21.1.8 and rustc 1.93.1.
    • Config: the J715 kernel config plus CONFIG_KUNIT=y, with DRM_ASAHI, DRM_ASAHI_G16 and DRM_APPLE built in.
    • Plus the PL011 console for virt. ARM64_16K_PAGES.
  • Host: QEMU 11.1.3 on a Cortex-A720/A520 host.
    • -machine virt,gic-version=3 -cpu host -enable-kvm -smp 2 -m 2048.
    • kunit.filter_glob=asahi_fwid* kunit_shutdown=poweroff.

Result: 10/10 pass

    # Subtest: asahi_fwid
    1..10
    ok 1 entropy_is_normalized_without_changing_the_image
    ok 2 every_role_is_normalized
    ok 3 boot_filled_ranges_are_normalized
    ok 4 a_record_without_its_entropy_bytes_is_refused
    ok 5 malformed_records_are_refused_without_changing_the_image
    ok 6 t6040_accepts_all_loaded_images
    ok 7 t6041_builds_admit_only_their_own_images
    ok 8 j713_accepts_all_loaded_images
    ok 9 t6050_admits_only_its_pinned_image
    ok 10 t8142_identifies_each_build
# asahi_fwid: pass:10 fail:0 skip:0 total:10

Control: I also ran the same kernel with only fwid.rs reverted to the previous head's (ae30d1ae: the old builds[i] expectation with the new table). It fails as you predicted:

    # j713_accepts_all_loaded_images: ASSERTION FAILED at drivers/gpu/drm/asahi/fwid.rs:568
    not ok 8 j713_accepts_all_loaded_images
# asahi_fwid: pass:9 fail:1 skip:0 total:10

The J715 boot at this head with the full table is being prepared as a module swap, and I'll post it here.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks, asahi_fwid 10/10 at ad87173 under arm64 KVM covers the KUnit side (the new entry on builds[0] and the J713 digests on 1..3). The J715 boot at this head is the remaining row.

Assisted-by: LLM (Claude:Opus 5.5)

@kazuhidet

Copy link
Copy Markdown
Contributor Author

J715 row at ad87173b with the full table (MacBook Air 15-inch, M4, Mac16,13), OS firmware 26.6.2, stage 1 → aura.

Build

  • Only the GPU module was swapped.
  • aurora.ko was built from the J715's everyday tree (integration/aurora 0abc2f3 plus local J715 patches), with drivers/gpu/drm/asahi/g16/hw.rs replaced by this PR's, byte-identical to ad87173b.
    • Between 0abc2f3 and this PR's base, hw.rs doesn't change, and fwid.rs changes only in tests. So the identity code that ran is this PR's.
  • The local J715 25G83 entry is not in this module. The table is exactly this PR's: the normalized entry first, then the three J713 entries.
  • Same compilers as the everyday kernel (clang 21.1.8, rustc 1.93.1).

Result: pass (one boot)

aurora-g16 302600000.gpu: GPU firmware build: Apple GFX 25G83 (normalized loaded image, boot-filled ranges)
aurora-g16 302600000.gpu: M4: firmware identity accepted
aurora-g16 302600000.gpu: M4 firmware accepted owned initdata root0xfffffc2000000000, NOP and policy; READY
aurora-g16 302600000.gpu: G16: firmware at READY, starting the backend
  • card0 (aurora-g16) with renderD128, plus card1 (apple-drm) with eDP-1. sddm active, and the desktop works normally.
  • No unsupported GPU firmware build.
  • Failed units: 2, both local services of this install (j713-owner-assets, m4-j715-backlight), the same without this change.
  • Kernel errors: the known set only (avd probe -2, hid-generic … no listeners, external DCP not handed over on both dcpext with this aura).
  • SELinux: not applicable on this install.

Not covered: whether the J713 entries still match (no J713 here), GPU load beyond the desktop, and suspend.

The original module went back afterwards. Its boot shows the old local entry (... (normalized loaded image, J715)) again, so this boot did run the swapped module.

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

Formal §1–§6 re-review at ad87173bf07970fae21bffb1b48c51f9d9d2d7e0 against pre-pr-checklist.md (verified against live integration/aurora 70a00e583b03: not superseded).

0 code, policy, attribution, or §5 hardware/test blockers — holding solely because live CI has not yet run green on this head.

Blocker

  1. §6 (Live CI not green — fork workflow awaiting approval):
    • Host tests (run 45044103708) is completed / action_required on ad87173bf079 (mergeStateStatus: UNSTABLE), so no live CI check has passed on the PR head yet.
    • No further code or hardware changes are requested from the author: once a maintainer approves the fork CI run and host-tests reports green on ad87173bf079, this PR is ready for APPROVE.

Checklist Verification

  • Prior KUnit Blocker Resolved (drivers/gpu/drm/asahi/fwid.rs:566-588): j713_accepts_all_loaded_images() now validates builds[0]'s boot_filled bounds against text_size, checks measured() matches builds[0] by its digest, and verifies the three preserved J713 fallback digests at builds[1..=3]. Confirmed by arm64 KVM QEMU KUnit run (asahi_fwid 10/10 pass at ad87173b, plus negative control failing at j713_accepts_all_loaded_images when reverting fwid.rs).
  • §1–§3 (Correctness / safety / bisectability): Clean. Squashed into a single bisect-safe commit. All three boot_filled ranges (0x23c, 8), (0x5c8df, 0x231), (0x5cb10, 0x6a0) fit inside text_size (0x60000), and digest_at() verifies intact GKTS/ECAP records at 0x5c8df/0x5c9c2 before zeroing boot_filled. Keeping the three J713 entries below builds[0] guarantees zero regression for 8-core and 10-core J713 boards on 26.6.2 until confirmed in a follow-up.
  • §4 & §6 (Attribution / clean-room / naming): Clean. Single commit with human author/committer (Kazuhide Takahashi <[email protected]>) and human Signed-off-by: only (zero AI commit trailers); structural offsets and SHA-256 digest only.
  • §5 (Exact-head HW & regression evidence): Satisfied by the J715 (Mac16,13, 26.6.2) boot with the exact ad87173b full table (aurora.ko swap, no local J715 entry): logged GPU firmware build: Apple GFX 25G83 (normalized loaded image, boot-filled ranges), firmware identity accepted, READY, desktop functional (card0/renderD128 + card1/eDP-1), 0 new failed units (2 pre-existing local units), 0 new kernel errors, SELinux N/A on this install.

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) changes-requested A reviewer requested changes (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 24, 2026
@github-actions github-actions Bot added blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) and removed needs-template PR body lacks Tested or Risk (bot) labels Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Merge readiness at ad87173b: ready to merge

Check Detail
CI at head ok 1 check passed
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok in the PR body at ad87173b
Conflicts ok none
PR text ok Risk: two-way · M4 (T8132) Airs; the J713 entries stay

Areas: area:gpu
Merge: gh pr merge 2672 --merge (Owners and Core through the bypass: add --admin).

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

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

Verdict: FINISH, then merge at ad87173bf079: the code is ready; it needs only a row at this head.

Blockers: none in the code. Missing row: I've approved the waiting CI run, and it has to pass. Then one T8132 Air boot at this head admitted by the normalized entry alone (the J715 is fine), with a render node and no admission refusal. Thanks for normalizing it.

Checked: no Apple material, no board gate: the loaded image hashes the same as the firmware file's TEXT once the boot-filled ranges are zeroed, and the KUnit case checks the normalized entry first. The per-board J713 entries stay until an 8-core and a 10-core J713 boot with only the normalized entry.

@DjDeveloperr
DjDeveloperr dismissed stale reviews from themself November 25, 2026 06:10

Superseded by the review at ad87173

@github-actions github-actions Bot removed the changes-requested A reviewer requested changes (bot) label Nov 25, 2026
@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Nov 25, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

J713 check at ad87173b: not a row for this PR's path

We booted main 42d693c + this PR + #2666 on our J713 (M4 Air). It doesn't exercise the 25G83 entry:

  • It runs the macOS 27.2 stub (GPU firmware 26B123), not 25G83.
  • main has no J713 internal display driver yet, so G16 waits for the native display and never probes.

The boot itself was clean: s2idle 1/1, 0 AVC denials, 0 faults. But that says nothing about the normalized entry. A real row needs a J713 or J715 on 26.6.2, and we have none in the lab. Your J715 boot is the closest evidence.

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed ready-to-merge Meets the merge policy: merge it (bot) labels Nov 25, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

ad87173bf079 (batched cleanly in J616s Batch #3 cc59e9b94d16 over main 7c0c2fc25ffc, 0 merge-tree diffs across all 2 changed files) J616s (MacBook Pro 16" M4 Pro, T6040, Apple M4 Pro (G16S B1), macOS 26.6.2 fw, guarded one-shot 7.3.0-aurora-pr2905+, default cmdline, stock Stage 2 1.0.0b17, boot_id=01629efb) PASS: 0 failed units, Enforcing, 0 new AVC (1 matching baseline), 0 GPU faults, 0 subsystem errors, real rtc1 s2idle 2/2 (success=2 fail=0), eDP connected pre/post-sleep, 406600000.sep + 514600000.mtp RTKit v12 clean, Borealis VK dEQP-VK.api.smoke.* 8/8 (pre & post-sleep) + glsl.loops.* 624/624, Wi-Fi 3/3 ping pre/post-sleep; stock 7.3.0-aurora-fleet89 restored & verified (946097c2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants