Skip to content

drm/asahi: g17: map the fragment status page and parameter-buffer graph firmware-only - #3245

Open
DjDeveloperr wants to merge 1 commit into
mainfrom
fix/g17-fw-only-pass-state
Open

DjDeveloperr wants to merge 1 commit into
mainfrom
fix/g17-fw-only-pass-state

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What: Map two more render objects firmware-only in the kernel's upper half, which every execution context includes:

  • the G17P fragment status page of each render generation. The firmware reads it there, and the GPU writes it through its client alias (register 0x14080).
  • the parameter-buffer graph of each render pair (G17P and M5). The firmware takes its state, scene and trailer addresses from the descriptors, and the GPU reaches its page list through the client alias.

Until now GPU work from any client could rewrite another client's render status or parameter-buffer state through these mappings. The client aliases keep their access. This follows the review of #3225, and M5's fragment status page is already firmware-only.

Tested: Built at f04367d79322 (asahi profile, GPU module). Host tests: G17 220/220, Neo 14/14 (the auxiliary test now requires the fragment status page's kernel mapping to be firmware-only), M5 97/97, T6040/T6041.

Risk: Two-way · G17P (A18 Pro, M4 Pro/Max) and M5 render paths; shared drm/asahi G17 code.

Not yet

  • Neo J700: confirm the firmware-only pass-state mapping with CTS draw and renderpass coverage. Thomas J813: run the shared-path smoke and render A/B. Rerun canceled CI.

No hardware rows yet. The plan is a J700 smoke with hard faults on (fault_control=0), so that a GPU access the firmware-only mapping refuses shows up as a fault rather than being dropped, then J700 and J714s rows with CTS draw and renderpass vs base plus a gpubench-vk render A/B. It's independent of #3225 and #3242 and queues after their rows.

…ph firmware-only

Two more kernel objects in the upper half every execution context
includes still gave the GPU write access:

- the G17P fragment status page of each render generation. The firmware
  reads the status there; the GPU writes it through the client alias
  that register 0x14080 names.
- the parameter-buffer graph of each render pair, on G17P and M5. The
  firmware takes its state, scene and trailer addresses from the
  descriptors; the GPU reaches its page list through the client alias.

GPU work from any client could rewrite another client's render status or
parameter-buffer state through them. Map them firmware-only. The client
aliases keep their access. M5's fragment status page is already
firmware-only.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr
DjDeveloperr marked this pull request as ready for review November 30, 2026 20:46
@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 30, 2026 20:46
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) blast:m5 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Merge readiness at f04367d7: not ready yet

Check Detail
CI at head ok 20 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok in the PR body at f04367d7
Conflicts ok none
PR text ok Risk: two-way · G17P (A18 Pro, M4 Pro/Max) and M5 render paths; shared drm/asahi G17 code.

Areas: area:gpu

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

@aurora-silicon-review aurora-silicon-review Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Superseded 12-01: not a hold under the merge bar (no shown failure). Only metadata checked; follow-ups: rerun cancelled Apple build/KUnit, J700/J714s render rows

Verdict: HOLD at f04367d7

Blockers:

  1. Apple build and KUnit CI was cancelled at f04367d7. Re-run Apple build and KUnit so full CI passes at head (Host tests, pr-text, and pr-readiness passed).
  2. Missing exact-head hardware rows. No hardware rows have been posted yet; per the PR's Not yet section, J700 (G17P, including fault_control=0 hard-fault check + CTS draw/renderpass) and J714s (M5) shared-path render rows are required before merge.

Checked:

  • Metadata and diff summary (+10/-3, 3 files), MERGEABLE against main.
Evidence
  • Apple build and KUnit completed as cancelled at f04367d7, and zero hardware rows are posted yet.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) and removed ci-failing A check failed at the PR head (bot) labels Nov 30, 2026

@DjDeveloperr DjDeveloperr 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: MERGE at f04367d79322 once the cancelled CI has rerun green and the J700 and J714s rows below pass at this head.
Blockers: none in the code.
Checked: only the kernel's mapping in the shared upper half changes, and the GPU keeps its access through the client aliases. For the fragment status page that is compact_alias(..., PROT_GPU_SHARED_RW) in g17/queue/render/memory.rs; for the graph it is the page-list alias in g17/buffer.rs. The graph's other addresses (state_va(), scene_va(), trailer_va()) go only into firmware command records (fw/render.rs, fw/m5/render.rs) and the queue configuration. Main already maps the scheduler page firmware-only in the same way. Main still maps both objects GPU-writable, so this isn't superseded. It merges with current main 1262f9e1 without conflicts. The KUnit and host-tests runs at this head were cancelled, so I ran the full host-test suite on that merge in the CI's Ubuntu 24.04 image: 998/998 pass, including neo-auxiliary-tests, whose stand-in now requires the firmware-only mapping, and the asahi-m4 selftests. apple-build passed at this head. No Apple material, no gates.

Rows still owed at this head: J700 (G17P), CTS draw and renderpass vs base with hard faults on, so that a GPU access the firmware-only mapping refuses shows up as a fault, with 0 GPU faults. J714s (G17S), a render smoke as the second generation (the graph change reaches M5 too).

Evidence
  • git merge-tree --write-tree of this head with main 1262f9e1 (merge base 7be48f37) has no conflicts and gives tree f35a0dac. Main touches g17/buffer.rs and memory.rs in other places, and both allocations are still PROT_GPU_FW_SHARED_RW on main.
  • tools/asahi/run-host-tests.py --jobs 20 on that tree, rustc 1.96.0, Python 3.14.10, no network: 998/998 passed in 330 s.

@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Dec 2, 2026

This branch has not been deployed

No deployments
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) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant