Skip to content

drm/asahi: g16: lay out G15G GLOBALS as the G15 family's 26B123 - #3173

Merged
RyanTheTide merged 1 commit into
mainfrom
fix/g15g-26b123-globals
Nov 25, 2026
Merged

RyanTheTide merged 1 commit into
mainfrom
fix/g15g-26b123-globals

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

What

On the M3 Air (T8122 G15G, firmware 26B123), a shader write to an unmapped address kills the whole GPU context. Other Macs just drop such writes. Geekbench 6 Vulkan's Background Blur hits this on its first workload: one write lands 29 KiB past an application buffer, the VM goes into its sticky error state and the device is lost. It happens on #3163's head and on main.

The cause is the GLOBALS layout. G15G runs the G15 family's 26B123 InitData version, the same version as G15S, but #3163 gave it G16G's GLOBALS runs. In this version the 25G83 words from +0xe28 on sit 5 bytes up, not 4, so the soft-fault word (25G83 +0xe28 = 3) landed one byte low and the firmware read 0 there.

This PR gives G15G the G15S GLOBALS runs (globals: G15S_26B123.globals). One line of data, no chip or board check; nothing else in the G15G layout changes, and no other machine uses this layout.

Tested

  • J615 (15-inch M3 Air, 27.2 stub), exact head 9a1540ca on main 865cecee: non-default one-shot on the default fleet command line, Mesa from merged aurora-wip bc9c9269.
    • Geekbench 6 Vulkan: 8/8 workloads including Background Blur. Before the fix: 0/8, device lost.
    • 20-minute soak: gpubench VK+GL 99/99 and Geekbench 6 Vulkan 9/9 full runs. An earlier 8-minute run added 176/176 gpubench ops. 10/10 fresh Vulkan clients.
    • 0 GPU fault, recovery or timeout lines over the whole boot. s2idle +1, with Vulkan and GL working after resume. 0 AVC denials, 0 failed units.
  • Host tests: asahi-m4 1/1. checkpatch is clean.

Risk

Two-way (a plain revert undoes it) · T8122 G15G GPU on firmware 26B123 only. G16G, G16S and G15S layouts are untouched. The compile-time layout checks (layout_fits) cover the new runs.

Not yet

  • Full clocks still need macsmc_soc_die thermal trips; until then the GPU holds S1, so the row says nothing about performance.
  • Whether Borealis should keep that out-of-bounds write from happening at all (resize_bilinear destination). With soft faults on, M3 now behaves like M4, which drops the write.
Evidence
  • Before (control on drm/asahi: g16: add T8122 G15G on firmware 26B123 as data rows (stacked on #3132) #3163's head ef1c9856, same Mesa): G16: fault bank 0: ... va 0x4df9f46e80 (write unmapped level 0 ...) in Background Blur, Geekbench 6 exit 134. The same fault happened with ASAHI_MESA_DEBUG=nosoft. A live-BO dump puts the faulting address 0x7300 past the end of a 576 KiB application buffer, in its guard gap.
  • The same Geekbench 6 Vulkan run completes on M4 (J713, G16G) and M4 Pro (J616s, G16S).
  • G15S, with the same InitData version 0x0c8a836f039404b8, already uses the +5 runs (run(0xe28, 0xe47, 5), 9dc11d9).

The 15-inch M3 Air (T8122 G15G) runs the G15 family's 26B123 InitData
version, the same version as G15S, but its layout took G16G's GLOBALS
runs. In this version the 25G83 words from +0xe28 on sit 5 bytes up,
not 4, so the soft-fault word (25G83 +0xe28 = 3) landed one byte low
and the firmware read 0 there. With soft faults off, an unmapped
shader write faults the whole context instead of being dropped:
Geekbench 6 Vulkan's Background Blur (resize_bilinear) wrote 29 KiB
past an application buffer, the VM went into its sticky error state
and the device was lost, on both linux#3163's head and main. The same
workload passes on G16G (J713) and G16S (J616s), whose firmware default
drops such writes.

Use the G15S GLOBALS runs for G15G. The rest of the G15G layout is
unchanged.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide requested review from a team and DjDeveloperr as code owners November 25, 2026 21:38
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Merge readiness at 9a1540ca: not ready yet

Check Detail
CI at head running running: KUnit ave, KUnit isp, KUnit jpeg, KUnit prores, KUnit scaler, KUnit macsmc
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok comment at 9a1540ca
Conflicts ok none
PR text ok Risk: two-way · (a plain revert undoes it) · T8122 G15G GPU on firmware 26B123 only. G16G, G16S and G15S layouts are untouched. The compile-time layout checks (layout_fits) cover the new runs.

Areas: area:gpu

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

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor Author

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

Blockers: Finish the current CI run.

Checked: Reviewed the full diff and the human sign-off. The G15G layout now uses the existing Globals descriptor for the same InitData format. Layout selection and every other backend are unchanged. The exact J615 target ran the default kernel options and retained native graphics after wake.

Evidence

J615 M3 Air (T8122) at 9a1540ca4453, with the existing merged Mesa overlay, passed 8/8 initial Vulkan workloads. The 20-minute run completed 99/99 graphics and compute operations and 9/9 full Vulkan benchmark runs. All ten fresh Vulkan clients passed. The same boot passed one short RTC wake and post-wake Vulkan and OpenGL, with zero GPU faults, zero SELinux denials and zero failed units. The operator verified the saved fleet85 entry, successful boot, empty next entry and overlay cleanup after the trial.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Verdict at 9a1540c: no blockers. Merge once CI at head is green. Independent review: the author lane is AIRS-FLEET89, the reviewer is PR-BURNDOWN.

Blockers: none

Checked

  • It is data only. The change adds one field (globals: G15S_26B123.globals) to the existing G15G_26B123 layout constant. The layout is still picked the same way, through the per-GPU hw data entry (g16/hw.rs:533 initdata: &initdata::G15G_26B123). There is no new if, no chip or board check, and no firmware-version branch in the code.
  • No other layout changes. G15S_26B123, V26B123, V25G83 and the G16 entries are byte-identical; the diff against main is this file, +5/-0.
  • Matches the stated cause. V26B123 (the default G15G inherited) has GLOBALS runs [0,0x38)+0, [0x38,0xe48)+4. G15S has [0x38,0xe28)+4, [0xe28,0xe47)+5. So from 25G83 +0xe28 on, G16G's runs place every word one byte low, which is where the soft-fault word was read as 0.
  • Compile-time checks still cover it: layout_fits(&G15G_26B123) and the state_bound/power-slot asserts at initdata.rs:880-884 apply to the new runs.
  • J615 row at exact head 9a1540ca, as reported in the PR body: GB6 Vulkan 8/8 (0/8 before), soak gpubench 99/99 plus GB6 9/9, 10/10 fresh Vulkan clients, 0 fault, recovery or timeout lines, s2idle +1.
Notes, not blockers
  • The out-of-bounds resize_bilinear write in Borealis is a separate follow-up, as the PR's Not yet section already says.
  • I didn't rebuild or re-run the row. This review is source-level, against main 865cecee.

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

Hardware row at 9a1540ca4453 | J615, 15-inch M3 Air, 27.2 stub

Booted 7.3.0-aurora-airs89k from main 865cecee plus this change using the default fleet kernel command line and Mesa bc9c9269.

  • Geekbench 6 Vulkan completed 8/8 workloads, including Background Blur. The preceding build lost the device before completing a workload.
  • The 20-minute run completed 99/99 Vulkan and GL gpubench operations and 9/9 full Geekbench 6 Vulkan runs. Ten fresh Vulkan clients passed.
  • One timed s2idle wake passed, with Vulkan and GL working after resume. The trial logged zero GPU faults, recoveries or timeouts, zero SELinux denials and zero failed units.

Restored the saved fleet85 kernel and verified an empty next entry, successful boot, enforcing SELinux and zero failed units. This run covers GPU correctness and stability at the current operating point.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Nov 25, 2026
@RyanTheTide
RyanTheTide merged commit f7b890d into main Nov 25, 2026
22 checks passed
@RyanTheTide
RyanTheTide deleted the fix/g15g-26b123-globals branch November 27, 2026 13:21
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:m3 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants