Skip to content

drm/asahi: g17: blame GPU page faults on the faulting VM, and see through a stale fault reason - #2227

Merged
RyanTheTide merged 2 commits into
aurora-silicon:mainfrom
jgoyvaerts:m4pro/g17-page-fault-blame
Nov 25, 2026
Merged

RyanTheTide merged 2 commits into
aurora-silicon:mainfrom
jgoyvaerts:m4pro/g17-page-fault-blame

Conversation

@jgoyvaerts

@jgoyvaerts jgoyvaerts commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What: Two fixes to how G17 recovery blames a GPU page fault, both found with 25G83 on the M4 Pro. (1) Recovery kept the firmware's blamed queue on a page fault, which can be a bystander; it now blames the in-flight work of the UAT slots the MMU fault banks name. (2) The firmware's reason word can stay at "page fault" from an earlier real fault, which cost T3 Code and then Hyprland their devices in one deqp-vk hang; a reason-3 restart with no latched MMU fault is now judged like a timeout.

Tested: J616s M4 Pro (T6040, 25G83) with this PR's code, in our test kernel 7.3.0-m4.184 (not a standalone kernel; it adds the same lines as head f52bf1b7895a on another base, and carries other G17 recovery work), 2026-11-24 03:25 UTC: the 11-18 memory_model ... u64 ... physbuffer.frag hang case 10 times under a running compositor. deqp-vk was failed in all 9 hanging runs, and no desktop client (Hyprland, the bar, T3 Code) was failed; 0 restart-storm stops, 0 err-level kernel lines, 0 failed units, no SELinux/AppArmor loaded. In run 6 an off-screen test bystander (tvbstress) also got one EIO from the firmware's blame while foreign compute was in flight (the firmware-blame fallback for foreign compute, outside this PR's code); its VM was kept. Every recovery line read reason 0 with both fault banks clear, so this row covers containment and the bank read, not the stale reason-3 path or the slot override. KUnit at this head 725/727 (asahi_g17_recovery_sources 15/15), host tests --only g17 90/90.

Risk: two-way door · the G17 Macs: M4 (incl. Pro/Max), M5 and Neo (A18 Pro). The fault override (commit 1) runs on each of them, M5 included (same bank registers); the stale-reason check (commit 2) wherever the reason comes from the firmware's reason word (M4 family, Neo 26A428), not M5. Checked unaffected: only the J616s.

Not yet: the stale reason-3 path on hardware (no safe way found to cause a real page fault on demand on G17P; KUnit covers it); commit 1's override firing live; the M4, M4 Max, A18 Pro (26A428) and M5; a standalone integration/aurora + this PR J616s run.

Details

1. Blame a page fault on the VM the MMU fault record names. On a page fault, recovery kept the queue the firmware blamed, and that can be a bystander. On 2026-11-06, a compute test's write fault (units CMP(2) and CMP(0), UAT slot 17 in both fault banks) was blamed on a render queue of another VM. That render failed with EIO and its client lost the device. The test's interrupted compute was spared, replayed, and faulted again 0.3 ms later.

The fault banks name the UAT slot of each faulting access, and every in-flight packet carries the context ID of its slot. Recovery now collects the faulting slots while the firmware is halted. When the in-flight work in those slots does not include the blamed queue, recovery blames that work instead. The firmware's blame stands without a decodable fault, without in-flight work in those slots, or when the blamed queue is among that work.

2. Judge a page fault without a latched MMU fault like a timeout. On 2026-11-18, one deqp-vk hang cost T3 Code and then Hyprland their devices. The hang was a fragment shader spinning on a lock (memory_model ... u64 ... physbuffer.frag). Every restart in that cascade read reason 3 (page fault) with both fault banks clear. For a page fault, host_fallback keeps the firmware's blame, which was "whoever the spinner starved". The same spin, earlier on the same boot, read reason 0, and render_culprit contained it.

The firmware (25G83 here) writes the reason word only for some restarts, and nothing clears it. A real page fault at 04:30 left it at 3 for every later spin. Every other reason-3 recovery on record has a decoded fault in at least one bank, because the faulting access stays latched until the restart. A reason-3 restart with neither bank valid is now judged like a timeout. A latched fault keeps the page-fault handling. The latch is a property of the MMU, not of a firmware build, so the check is keyed on where the reason came from, not on the firmware: it runs whenever the reason came from the firmware's reason word, which includes the A18 Pro's 26A428 (Sources::settle_reason). M5 has no reason word. Its page fault comes from its latched fault register and is not checked against the banks.

Known limits:

  • If two VMs fault in one restart and the firmware blames one of them, the firmware's blame stands, and the other VM's work replays.
  • Both commits assume a latched bank belongs to the current restart.
Evidence

Hang case under a compositor, test kernel 7.3.0-m4.184 (2026-11-24 03:25-03:30 UTC)

The kernel's two commits add the same lines as 02e85f129073 and f52bf1b7895a; only context lines of the base differ (a use list), so the patch-ids are not equal. The kernel also carries other G17 recovery changes under review (#2504 and follow-ups).

dEQP-VK.memory_model.write_after_read.ext.u64.coherent.atomic_atomic.atomicrmw.queuefamily.payload_local.image.guard_local.physbuffer.frag, 10 runs in a row beside a drawing desktop:

  • Runs 1-9 hung (41 recoveries); run 10 passed without hanging.
  • deqp-vk was failed in every hanging run, and its scheduler was closed as guilty each time. It was the only failed client in 8 of the 9.
  • Run 6: an off-screen bystander (tvbstress) had a render that started just before deqp's hung one; the firmware blamed it while foreign compute was in flight, it got one EIO, and its VM was kept (it kept rendering until stopped).
  • The firmware blamed a bystander 18 times; all 18 were spared. No desktop client (Hyprland, quickshell, T3 Code) was failed; Hyprland kept its pid.
  • Every recovery line with a reason (82) read reason 0, and every MMU fault bank read "no fault".
  • 0 "storm limit" lines, 0 err-level kernel lines, 0 failed units. LSMs capability,landlock,yama: no SELinux or AppArmor loaded, 0 avc: lines.

Earlier: the 11-18 case, rerun once on a kernel with both commits (guarded)

The reason word was still 0 on that boot, so this run tests containment and the new bank read at every recovery, not the stale reason-3 path:

G17: recovery snapshot gen 0 reason Some(0) ... MMU fault bank 0: no fault ... bank 1: no fault
G17: GPU recovery (reason Some(0)): firmware blamed queue 41, failing its oldest render
asahi: GPU work of a client failed (EIO, ..., client deqp-vk[14161]); the client sees a lost device
G17: recovery gen 1 blames queues 0x30000000000
G17: recovery dropped queued work of an already failed VM; not counted as a restart storm

Only deqp-vk failed. Hyprland, the bar and T3 Code kept running. Commit 1 has run in our kernels since 11-06, and commit 2 since 11-18.

On this branch

KUnit 703 of 704 passed, one skipped (needs CONFIG_UCLAMP_TASK). The new tests in asahi_g17_recovery_sources cover the slot override, both stale-reason cases (no bank latched, either bank latched), and which reasons are checked against the banks (a firmware reason word on any firmware, never M5's fault-register reason). After the firmware gate was removed (11-21): KUnit 725 of 727 passed, one skipped, and asahi_g17_recovery_sources passed 15/15. The one failure, apple-isp-hw.isp_test_sensor_sysfs, also fails on integration/aurora. tools/asahi/run-host-tests.py --only g17 passed 90/90. CI host-tests green at f52bf1b7895a.

Why the stale reason-3 path is not reproduced on hardware

We found no safe way to cause a real page fault on demand on G17P. Unmapped shader reads return zero, unbound sparse pages are backed by scratch, and indirect dispatch goes through a helper shader. In the real faults since, the firmware already blamed the faulting VM, so commit 1's override has not fired live either.

On a page fault, recovery kept the queue the firmware blamed, which can be
a bystander. On 2026-11-06 a compute test's write fault (units CMP(2) and
CMP(0), UAT slot 17 in both fault banks) was blamed on a render queue of
another VM (context 19). That render failed with EIO and its client lost
the device, while the test's interrupted compute was spared, replayed and
faulted again 0.3 ms later.

The MMU fault banks name the UAT slot of each faulting access, and every
in-flight packet carries the context ID of the slot it runs in. Collect the
faulting slots while the firmware is halted. When the in-flight work in
those slots does not include the blamed queue, blame that work instead, so
classification spares the bystander's VM and fails the faulting one.
Without a decodable fault, without in-flight work in the faulting slots, or
when the blamed queue is among that work, the firmware's blame stands.

Signed-off-by: Jonathan Goyvaerts <[email protected]>
@jgoyvaerts
jgoyvaerts force-pushed the m4pro/g17-page-fault-blame branch 2 times, most recently from c69af9c to 7ad036e Compare November 21, 2026 06:14
@jgoyvaerts

Copy link
Copy Markdown
Contributor Author

Commit messages only, for the pre-PR checklist: the commits no longer carry Assisted-by (item 4), and the disclosure is now the PR body's last line. The tree is identical to c69af9c288 (git diff c69af9c288 7ad036ecfa is empty). New head 7ad036ecfa.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 1.

Commit 1 is sound. report_mmu_fault() builds the slot mask from decoded banks only and skips slot 0. fault_qids() matches on context.id(), which is the root ID that indexes the UAT TTB table (mmu.rs:1268, 1315), so it is the UAT slot. fault_override() only replaces a firmware blame when the blamed queue is not among the faulting slots' in-flight work, and the KUnit cases cover each early return.

  1. drivers/gpu/drm/asahi/g17/runtime/events.rs:180: the stale-reason check runs only when variant.graph == InitGraph::V25G83. The condition it tests holds on any firmware: the reason word says page fault, and neither MMU bank holds a latched fault. The latch is a property of the MMU, not of the firmware build. The commit message itself relies on it ("the faulting access stays latched until the restart"). With the gate, the same leftover reason on 26A428, or on a later M4 Pro firmware, keeps blaming bystanders. Key the check on where the reason came from instead. Run check_fault_banks() whenever sources.reason came from the firmware's reason word, i.e. it was not filled in from mmu_fault at events.rs:176. That leaves M5 out without a chip test, because there the reason is only ever set from its fault register. Drop the InitGraph import with it.

HW row: J616s (25G83) and the Neo (26A428), this head with the gate removed. Run the 11-18 deqp-vk memory_model ... u64 ... physbuffer.frag case under a running compositor. Pass: only deqp-vk gets EIO, with 0 lost devices for other clients, 0 AVC, 0 failed units and 0 new kernel errors. If a real page fault can be produced, a run with a latched bank should keep the page-fault handling.

Assisted-by: LLM (Claude:Opus 5.5)

@jgoyvaerts
jgoyvaerts force-pushed the m4pro/g17-page-fault-blame branch from 7ad036e to f8809c5 Compare November 21, 2026 16:57
@jgoyvaerts

Copy link
Copy Markdown
Contributor Author

Fixed in f8809c547d. Only commit 2 changed, and its message now describes the new rule.

The InitGraph::V25G83 gate and its import are gone from runtime/events.rs. fault_sources() now calls Sources::settle_reason (attribution.rs:142, called at events.rs:171). It runs check_fault_banks() whenever the reason came from the firmware's reason word, on any firmware. When there is no reason word, it fills PAGE_FAULT from the latched fault register instead, so M5 is never checked against the banks and there is no chip test. check_fault_banks is private now, and its doc no longer ties the stale word to 25G83.

Testing: arm64 defconfig + asahi.config build of drivers/gpu/drm/asahi, with no warnings in the touched files. KUnit on arm64 qemu: 725/727, and asahi_g17_recovery_sources passes 15/15. The only failure is apple-isp-hw.isp_test_sensor_sysfs, which also fails on integration. The new case only_a_reason_from_the_firmware_word_is_checked_against_the_banks covers four cases: a firmware page-fault word with clear banks is stale, unreadable banks keep the page fault, M5's register fault never reads the banks, and no reason stays unknown. run-host-tests.py --only g17: 90/90.

The J616s row will follow the next kernel build of our tree. The physbuffer case under a compositor stays with the owner. We'd take your offer to run the Neo (26A428) row in your lab.

Assisted-by: LLM (Claude:Opus 5.5)

… timeout

On 2026-11-18 at 16:39:57 UTC one deqp-vk hang (memory_model u64
atomics, a fragment shader spinning on a lock) cost T3 Code and
Hyprland their devices, and the desktop with them. The first restart
failed deqp-vk's interrupted render, as it should. Its next queued
render spun again, and 83 ms later the firmware blamed T3 Code's
queue 40, whose render was waiting behind it, then Hyprland's queue 36,
whose oldest render had never started. Both took EIO, which marks the
VM lost.

The checks that catch a starved bystander did not run. Every one of
those restarts read reason 3, page fault, and for a page fault
host_fallback keeps the firmware's blame. fault_override needs a
decoded MMU fault, and both fault banks read clear. The same spin on the
same boot at 03:40 UTC read reason 0. host_fallback then moved the blame
to deqp-vk's running render, and nothing else failed.

The reason word is not this restart's. The firmware (here 25G83) writes
it only for some restarts, and nothing clears it. Reason 0 shows only in
a boot's first recoveries. A real page fault at 04:30 left it at 3 for
every later spin. Every other reason-3 recovery on record has a decoded
fault in at least one bank (04:30 and two on 11-17), because the
faulting access stays latched until the restart.

Whenever the reason comes from the firmware's reason word, read the
fault banks while the firmware is halted. When the word says page fault
but neither bank holds a valid fault, treat the restart as a non-fault
restart: slot identity and the host's pass records may correct the
firmware's blame, as they do for a timeout. A latched fault in either
bank keeps the page-fault handling unchanged. The latch belongs to the
MMU, not to a firmware build, so the check runs on every firmware that
has the word, the A18 Pro's 26A428 included. M5 has no reason word: its
page fault comes from its latched fault register and is not checked
against the banks. Sources::settle_reason holds that rule in one place.

Signed-off-by: Jonathan Goyvaerts <[email protected]>
@jgoyvaerts
jgoyvaerts force-pushed the m4pro/g17-page-fault-blame branch from f8809c5 to f52bf1b Compare November 21, 2026 19:38
@jgoyvaerts

Copy link
Copy Markdown
Contributor Author

New head f52bf1b, which changes one line from f8809c5. settle_reason took over the last use of recovery::PAGE_FAULT in events.rs, so the re-export at g17/recovery.rs:14 went unused and rustc warned about it. The commit now drops it. Compile check: arm64 defconfig + asahi.config, drivers/gpu/drm/asahi/, rc 0 with no warning left in recovery.rs. No other change.

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.

Adversarial review at f52bf1b7895a against the pre-PR checklist.

No code, CI, attribution, or policy blockers remain:

  • CI & Attribution/Policy (§1–§4, §6): host-tests is green on f52bf1b7895a; both commits carry human author/committer and human Signed-off-by: only; PR body disclosure is clean. The earlier InitGraph::V25G83 firmware gate has been removed in favor of Sources::settle_reason, and the unused PAGE_FAULT re-export warning in drivers/gpu/drm/asahi/g17/recovery.rs:14 is fixed.
  • Commit 1 (02e85f129073): report_mmu_fault() (runtime/events.rs:280-306) skips firmware slot 0 and uses checked_shl; fault_qids() (recovery/attribution.rs:261-269) bounds-checks context IDs against the 64-bit slot mask; fault_override() (recovery/attribution.rs:239-256) only overrides Attribution::Firmware on an active page_fault() with a blamed queue (< 128 enforced by recovery::State::request()) when the faulting slots' in-flight work excludes blamed.
  • Commit 2 (f52bf1b7895a): Sources::settle_reason() (recovery/attribution.rs:142-170) cleanly keys the fault-bank check on whether sources.reason came from the firmware's reason word vs M5's latched fault register (mmu_fault), and fails safe when banks are unreadable.
  • Minor non-blocking nit: In Sources::settle_reason() (recovery/attribution.rs:143-146), checking if self.reason == Some(PAGE_FAULT) before calling banks() would avoid an extra fault_banks() MMIO bank-select round trip on non-page-fault recoveries (since report_mmu_fault() reads the banks right afterward anyway).

Remaining before approval (§5)

  • J616s (25G83) on current head f52bf1b7895a (default command line): the 11-18 deqp-vk memory_model ... u64 ... physbuffer.frag case under a running compositor (only deqp-vk gets EIO, 0 lost devices for other clients) plus a regression check (0 SELinux denials, 0 failed units, 0 new kernel errors).
  • A18 Pro / Neo (26A428) boot running the same case, since settle_reason now applies there as well.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-checked at f52bf1b: the InitGraph::V25G83 gate is gone. settle_reason() checks a firmware reason word against the latched MMU fault banks on every firmware, and without a reason word takes PAGE_FAULT from the latched fault register, so the stale-reason case is caught by what the hardware shows rather than by firmware build. The new KUnit case covers it, and the last commit only drops the now-unused re-export. LGTM.

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.

Formal §1–§6 pre-PR review at f52bf1b7895ace43d5e7be6af537eb7286777a20 (re-verified against live integration/aurora 70a00e583b03; formalizing the §5 hold from the earlier COMMENTED review): REQUEST_CHANGES.

Audit Summary (§1–§4, §6)

  • Code correctness & lifetimes: 0 blockers.
    • Commit 1 (02e85f129073): report_mmu_fault() (drivers/gpu/drm/asahi/g17/runtime/events.rs:280-306) skips firmware slot 0 and uses checked_shl; fault_qids() (drivers/gpu/drm/asahi/g17/recovery/attribution.rs:261-269) bounds-checks context IDs against the 64-bit slot mask; fault_override() (attribution.rs:239-256) overrides Attribution::Firmware only on an active page_fault() when the faulting slots' in-flight work excludes blamed.
    • Commit 2 (f52bf1b7895a): Sources::settle_reason() (attribution.rs:142-170) cleanly keys the fault-bank check on whether sources.reason came from the firmware's reason word vs. M5's latched fault register (mmu_fault), removes the old InitGraph::V25G83 firmware gate, and fails safe when banks are unreadable.
  • §1–§4, §6 & CI: PASS — not superseded on integration/aurora, mergeable: clean, host-tests green, human author/committer + human Signed-off-by: only on both commits, PR body carries Assisted-by:, naming clean.

Blockers (§5 Evidence)

  1. Missing exact-head (f52bf1b7895a) hardware & regression evidence:
    • J616s (M4 Pro / 25G83) on default command line with head f52bf1b7895a: rerun the 11-18 deqp-vk memory_model ... u64 ... physbuffer.frag case under a running compositor confirming only deqp-vk receives EIO (0 lost devices for other clients), plus a boot regression check (0 SELinux denials, 0 failed units, 0 new kernel errors).
    • A18 Pro / Neo (26A428): same recovery/containment run on f52bf1b7895a, since settle_reason() now applies on every firmware carrying the reason word.

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

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Merge readiness at f52bf1b7: not ready yet

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 f52bf1b7
Conflicts ok not computed yet
PR text ok Risk: two-way · the G17 Macs: M4 (incl. Pro/Max), M5 and Neo (A18 Pro). The fault override (commit 1) runs on each of them, M5 included (same bank registers); the stale-reason check (commit 2) wherever the reason comes from the firmware's reason word (M4 family, Neo 26A428), not M5. Checked unaffected: only the J616s.

Areas: area:gpu

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

@github-actions github-actions Bot added blast:m4 Macs affected, from Merge risk (bot) blast:m5 Macs affected, from Merge risk (bot) blast:neo Macs affected, from Merge risk (bot) and removed blast:none Macs affected, from Merge risk (bot) labels Nov 24, 2026

@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 f52bf1b7895a: the code is ready; it needs one more row.

Blockers: none in the code. Missing row: this is G17 recovery code shared by M4, M5 and the Neo, so before it merges it also needs the same hang case at this head on an M5 or Neo, with the faulting client blamed and no bystander lost. We'll run it on our J714s or J700.

Checked: no Apple material, no gates. The J616s run carries the same lines as this head in a batched kernel, which counts as the M4 row: the 11-18 memory_model … physbuffer.frag hang case 10 times under a compositor, with only deqp-vk failed and no desktop client lost. CI green.

@DjDeveloperr
DjDeveloperr dismissed their stale review November 24, 2026 21:01

Superseded by the review at f52bf1b

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed changes-requested A reviewer requested changes (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 24, 2026
@DjDeveloperr

DjDeveloperr commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

J714s (M5 Pro, T6050, G17S B1) row at f52bf1b7895a: PASS (on-demand GPU page fault + fragment-shader hang)

Kernel: candidate 1b2fb5add6f2ceb8ace1245569ca41c2ce0d111d = main 03b2f009dba2 + aurora-silicon/linux#2227 exact head f52bf1b7895ace43d5e7be6af537eb7286777a20 (both commits 02e85f129073 and f52bf1b7895a unchanged, merged cleanly with zero conflicts). Built natively on J714s as 7.3.0-m5-pf27 and booted with the default's DTB (1c92b1dc), Stage 2 (24fb41bacdf7), and command line (MTE on, SEP writes on). Baseline: 7.3.0-m5-cdirect15 (same Mesa / Borealis G17S B1).

On-demand fault-blame & hang verification (headless, beside Hyprland + 10 desktop DRM clients + live gpubench-vk render.light & compute.light bystanders)

Because Borealis on M5 does not support 64-bit integer buffer atomics (so the 11-18 u64 ... physbuffer.frag dEQP case is NotSupported), this row exercises both real hardware GPU MMU page faults and an infinite-loop fragment-shader hang directly via headless Vulkan clients (pf / pf2, no WSI windows):

  1. Real GPU MMU page fault (pf2 uaf-pipe, 8× pipelined 1024×1024 render submits to a freed 260 MiB render target, gen 5–gen 6):

    • Both MMU fault banks 0 and 1 latched write Unmapped faults from unit CMP(0) (0x2) in vm_slot 31 (matching the faulting render queue's ctx=31), Sources::settle_reason kept reason Some(3) from M5's latched fault register (0 false stale-reason triggers), and only the faulting client pf2[13202] received EIO / VK_ERROR_DEVICE_LOST (rc=3, stayed lost on follow-up vkQueueSubmit / vkDeviceWaitIdle):
      [  300.844014] aurora: asahi: recovery fault registers: Ok([0, 87d13e0421, 16fb7bc6a, 11000000000a, 0, 1bf6d21a1])
      [  300.844049] aurora: asahi: recovery: GPU MMU fault: write reason 0 at 0x5bedef1a80, level 0, requestor 0x2, VM slot 31
      [  300.844056] aurora: G17: recovery snapshot gen 5 reason Some(3) slot_mask 0x2 sampled 0 known_keys 0; stampless lifetime total 0 before restart
      [  300.844066] aurora: G17: recovery cause gen 5: GPU MMU page fault (firmware reason 3); firmware blames queue Some(17); slots walked 1, slot word 0x3392, detail 0x18
      [  300.844074] aurora: G17: recovery MMU fault bank 0: address 0x5bedef1a80 write Unmapped unit CMP(0) (0x2) level 0 vm_slot 31 sideband 0x22 (status 0x87d13e0421)
      [  300.844079] aurora: G17: recovery MMU fault bank 1: address 0x5bedef3900 write Unmapped unit CMP(0) (0x2) level 0 vm_slot 31 sideband 0x22 (status 0x87d13e0421)
      [  300.844434] aurora: G17: recovery gen 5 queue 17 blamed guilty cancelled: 5 retained commands, client pf2[13202]
      [  300.846971] aurora: G17: recovery gen 6 queue 17 blamed: 4 retained commands, client pf2[13202]
      [  300.846981] aurora: GPU work of a client failed (EIO, reported at g17/runtime.rs:1553, client pf2[13202]); the client sees a lost device
      
    • Note: in gen 5–gen 6 the firmware already blamed pf2[13202]'s own queue (queue 17, ctx=31), so fault_override() confirmed and kept the firmware's blame (live override onto a different queue was not triggered).
  2. Fragment-shader infinite-loop hang after the page faults (pf2 hang, gen 7):

    • Control (pf2 control-hang, 16 ALU iterations): COMPLETED in 0.009 s (rc=0).
    • Hang (pf2 hang, pf2[13219]): triggered gen 7 with clear fault banks (bank 0: no fault, bank 1: no fault, snapshot gen 7 reason None; M5 firmware record still reported firmware reason 3 from the earlier page fault). Only pf2[13219] failed with EIO / VK_ERROR_DEVICE_LOST (rc=3), while concurrent bystander gpubench-vk[13157] (queue 9, 1 retained command) was spared:
      [  302.934027] aurora: asahi: recovery fault registers: Ok([0, 0, 0, 11000000000e, 0, 1c25a17c3])
      [  302.934062] aurora: G17: recovery snapshot gen 7 reason None slot_mask 0x2 sampled 0 known_keys 0; stampless lifetime total 0 before restart
      [  302.934081] aurora: G17: recovery cause gen 7: GPU MMU page fault (firmware reason 3); firmware blames queue Some(17); slots walked 1, slot word 0x33a3, detail 0x18
      [  302.934090] aurora: G17: recovery MMU fault bank 0: no fault (status 0x0)
      [  302.934096] aurora: G17: recovery MMU fault bank 1: no fault (status 0x0)
      [  302.934139] aurora: G17: recovery gen 7 queue 9: 1 retained commands, client gpubench-vk[13157]
      [  302.934146] aurora: G17: recovery gen 7 queue 17 blamed guilty cancelled: 1 retained commands, client pf2[13219]
      [  302.934157] aurora: G17: GPU recovery (reason Some(3)): firmware blamed queue 17, failing its oldest render
      [  302.934163] aurora: GPU work of a client failed (EIO, reported at g17/runtime.rs:1553, client pf2[13219]); the client sees a lost device
      
  3. Bystanders & post-recovery GPU health:

    • Across gen 5–gen 7, both headless gpubench-vk bystanders completed with status: "ok" (render.light: 322,293 submits, 139.62 us/submit; compute.light: 329,577 submits, 136.54 us/submit, 0 lost devices).
    • Hyprland (pid 1238) and all 10 other desktop DRM clients kept their PIDs across all 8 recoveries on the boot (gen 0–gen 7).
    • Post-recovery liveness: pf2 control-hang COMPLETED (0.004 s), gpubench-vk render.light status: "ok" (3,893 submits, 128.44 us/submit), gpubench-vk compute.light status: "ok" (4,638 submits, 107.81 us/submit), vulkaninfo --summary + dispatch OK.
    • /sys/kernel/debug/aurora-g17/capacity: crashed=0, online=1, leaked_compute_queues=0, firmware_linked_render_graphs kept=0 leaked=0, drained_render_pairs unsettled=0, render_slots active=0 quarantined=0, scheduler_teardown pending=0, refusals_nonzero=0.
    • Boot & runtime health: 0 oops/WARN, 0 storm-limit lines, 0 GPU runtime stopped, 0 DART faults, 0 new boot err lines vs 7.3.0-m5-cdirect15 baseline, failed units = only tailscaled.service (same as baseline), LSMs capability,landlock (0 avc: lines).

Pre-existing M5 multi-bank observation (separate follow-up, not a #2227 regression)

In an earlier single-submit 64×64 uaf-render pass (gen 1), the fault did not appear in banks 0–1 (bank 0: no fault, bank 1: no fault, m5_fault_registers at selector 0 read 0), and the firmware blamed bystander gpubench-vk[7607] (render.light). A baseline 7.3.0-m5-cdirect14 run of the same 64×64 uaf-render latched the fault in bank 2 (0xd800 = 2, 0xd8c0 = 0x86d1360421, vm_slot 27) while banks 0–1 read 0x0. Pre-existing regs::fault_banks() only scans banks 0..2 (unlike g16/regs.rs, which scans 0..8), so expanding fault_banks() beyond 2 banks on M5 is a worthwhile follow-up so fault_override() can also catch bank >= 2 faults on G17S.

@github-actions github-actions Bot removed the ready-to-merge Meets the merge policy: merge it (bot) label Nov 25, 2026
@RyanTheTide
RyanTheTide merged commit e752818 into aurora-silicon:main Nov 25, 2026
3 checks passed
jgoyvaerts added a commit to jgoyvaerts/linux that referenced this pull request Nov 25, 2026
Conflicts, and how they were resolved:

- g17/recovery.rs: main's aurora-silicon#2227 page-fault evidence (fault_qids,
  report_mmu_fault() returning the faulting slots, fault_culprit,
  fault_override) sits next to this branch's collateral hooks
  (collateral_before, note_collateral, marks_collateral,
  note_kill_sightings). Both are kept. In service() the host fallback
  runs first and fault_override second, as on main, and the Suspects
  log line stays. Attribution stays pub(crate) for render_culprit().
- g17/recovery/attribution.rs: a aurora-silicon#2227 test called host_fallback() with
  a culprit closure returning Option<u128>. On this branch the closure
  returns the attribution, so that call now passes
  Some(Attribution::Queues(..)). The assertion is unchanged.
- g17/queue/admission.rs: try_acquire_render() keeps this branch's
  owner_released() check, with main's has_live_owner() in place of the
  owners scan.
- tools/asahi: admission harnesses extract both sides' State helpers,
  and run-host-tests.py lists both sides' mutations and main's new
  g17-m5-effort test.

One behaviour to note: fault_override() returns Queues only when the
faulting slots exclude the blamed queue. A page fault in the blamed VM
stays Attribution::Firmware, so with this branch's rule it is collateral
once, and its VM is guilty at the next fault. aurora-silicon#2500's restart charge in
classify() is unchanged: a collateral or suspect-only restart has no
guilty client and counts toward the device.

Signed-off-by: Jonathan Goyvaerts <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Post-merge J616s (M4 Pro, T6040, 25G83) verification at aurora/main 4d8a19b2e415 — PASS (non-regression; fault reproducer NotSupported on stock ICD)

  • Baseline: 7.3.0-aurora-fleet89 (645f7cd3589d, boot_id=3a3b4d03-9a06-4ab2-8707-ff2f070ea63d).
  • Candidate: aurora/main 4d8a19b2e415 (contains merged #2227 e7528180365f + #3077/#3079/#3080/#2980/#3042/#3043, guarded one-shot on exact default cmdline, boot_id=6969e904-37b1-447c-a1f4-3d79737e7b86).
  • Non-regression & timings (fleet89 -> 4d8a19b2e415): render.light -21.33% (d=1) / -27.10% (d=2), compute.light -12.38% / -15.33%, compute.edge -7.69% / -4.96% (CRC 27c79e6d valid), compute.conv2d -5.23% / -1.99% (CRC 2d55a14d valid), render.deferred -4.96% / -0.12% (CRC 2cfe9a54 valid), gl-smoke.py 32/32 PASS, dEQP-VK.glsl.loops.* 624/624 PASS, dEQP-VK.compute.pipeline.basic.* 79/0/2 NS, rtc1 s2idle 1/1 clean wake + post-sleep GPU OK.
  • Fault-blame / bystander scope note: Ran 20x concurrent bystander gpubench-vk (20/20 OK, 0 fail) alongside 3x dEQP-VK.memory_model.write_after_read.ext.u64.coherent.atomic_atomic.atomicrmw.queuefamily.payload_local.image.guard_local.physbuffer.frag; on the stock J616s Borealis ICD that case returned NotSupported (64-bit integer buffer atomics not supported) and therefore did not induce a live GPU hang/fault on this run. 0 GPU faults, 0 restart-storm stops, 0 AVC, 0 kernel errors, 0 failed units, Enforcing; restored saved 7.3.0-aurora-fleet89 (f8516a5b).

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) blast:m5 Macs affected, from Merge risk (bot) blast:neo 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.

3 participants