Skip to content

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

Open
kazuhidet wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
kazuhidet:j715/g16-one-normalized-25g83
Open

kazuhidet wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
kazuhidet:j715/g16-one-normalized-25g83

Conversation

@kazuhidet

@kazuhidet kazuhidet commented Nov 21, 2026 •

Copy link
Copy Markdown

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

Assisted-by: LLM (Gemini 4 Neon)

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 <kazuhide.t@linux-powered.com>
@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
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)

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.

3 participants