Skip to content

drm/asahi: g17: log the MMU fault banks on recovery - #1075

Merged
RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
jgoyvaerts:pr/g17-mmu-fault-banks
Nov 7, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
jgoyvaerts:pr/g17-mmu-fault-banks

Conversation

@jgoyvaerts

Copy link
Copy Markdown
Contributor

A G17 recovery reports the firmware's reason (3 is a page fault) and the blamed queue, but not which address faulted or which unit faulted on it. The G17 runtime never reads the MMU fault registers.

T6040's GPU is G16S hardware. Like G15 and G16, it exposes the fault through two banks: status at SGX +0xd8c0 and address (in 64-byte units) at +0xd8c8, under the bank selector at +0xd800 (g16::regs::Regs::engine_state). This commit reads both banks while the firmware is halted in the recovery handshake and restores the selector afterwards. It logs them through the existing G14X decoder, now shared as regs::decode_fault(). This is diagnostics only: nothing in attribution, cancellation or release depends on it.

Testing (J616s, M4 Pro)

  • This has been on our daily and test kernels since 2026-11-01, so every recovery since then logged its banks. Three examples:
    • A deliberate store into a read-only page by a test compute shader: bank 0: address 0x5bfe250900 write ReadOnly unit CMP(2) ... vm_slot 13. That matches the test's own VM and buffer.
    • A D3D12 test that read an unmapped address: bank 1: address 0x10d03021f00 read Unmapped unit gCDM_ID (0xd1) level 1 vm_slot 22, with bank 0 no fault (status 0x0).
    • A vertex-stage fault: read NoAccess unit gVDM_SSD_SP(0) in bank 0, and an Unmapped level-1 miss in bank 1.
  • Builds with no new warnings in our tree on aurora-wip 57222e0ee261, which contains integration/aurora. This branch is a clean cherry-pick onto integration/aurora 068dfce19780.

🤖 Generated with Claude Code

A G17 recovery reports the firmware's reason (3 is a page fault) and the
blamed queue, but not which address faulted or which unit faulted on it:
the G17 runtime never reads the MMU fault registers. On T6040 a Transport
Fever 3 shadow pass page-faults its fragment queue repeatably, and without
the address there is no telling whether a depth surface, a tiler heap page
or freed client memory is behind it.

T6040's GPU is G16S hardware, and G15/G16 expose the fault through two
banks: status at SGX +0xd8c0 and address (64-byte units) at +0xd8c8 under
the bank selector at +0xd800 (g16::regs::Regs::engine_state). Read both
banks while the firmware is halted in the recovery handshake, restoring the
selector, and log them decoded by the existing G14X decoder, now shared as
regs::decode_fault(). This is diagnostics only: nothing in attribution,
cancellation or release depends on it.

Signed-off-by: Jonathan Goyvaerts <[email protected]>
Assisted-by: LLM

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

Merge-train review (MTR-J, 11-07): approved, merging.

  • Review:
    • fault_banks() reads and restores the bank selector with the same 64-bit accesses as g16::regs::Regs::engine_state(): SGX +0xd800/+0xd8c0/+0xd8c8, i.e. the g16 status window at +0x1800.
    • decode_fault() is a pure move. The new fault_info & 1 == 0 early return matches what the resource method already did.
    • It is only called from recovery::service while the firmware is halted. Failures only log.
    • G15, G16 and the G18 boot path read the same D8C0 bank, so the G17P (Neo) read is the same layout.
  • Gates (integration b8ae494f + linux PRs 1073-1076 merged locally):
    • buildbox fleet-recipe build: 0 new warnings;
    • run-host-tests 193/193, apple-dcp 86/86;
    • J616s one-shot: err 0, 0 AVC, 0 failed units, GPU/vkcube/glmark/camera OK, dEQP-VK L1 slice identical to fleet19;
    • Neo (G17P): one-shot of the same kernel vs the fleet20 default; the GPU code is the same as fleet19. Both boots: CTXR window enforcing, execmem-confine 1696/0, os_uuid pin, err 0, 0 AVC, 0 failed units, vkcube/glmark equal. dEQP-VK L1 stride slice (33,463 cases) and the sync/compute slice (1,350 cases) gave identical results, 0 GPU errors. gpubench, thermally paired (3 runs each from <=66 C): compute.heavy and render.heavy within 0.2%, compute.light 3% faster at depth 16/64.
  • No recovery happened on either test boot, so the new log lines were not exercised here. Your J616s examples in the description cover that.

@RyanTheTide
RyanTheTide merged commit 58c7934 into aurora-silicon:integration/aurora Nov 7, 2026
1 check passed
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