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.

  • J700 (T8140, G17P) A/B passed at f04367d79322f6cf301d1984932a9a94c96782a8 on baseline 6985e45ab583. Both arms used the same Image and configuration, with only aurora.ko changed. All 111,162 draw and renderpass CTS statuses matched with aurora.fault_control=0, zero GPU faults and verified stock recovery. J700 receipt
  • Hosted Apple build and KUnit and host tests passed on rerun at this head. Apple build and KUnit · Host tests

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

Not yet

  • J714s (M5) shared render-path control with draw and renderpass coverage and a render A/B. The J813 shared-path smoke and render A/B are also pending.
  • Main c95c5914f207 merges cleanly and preserves the two-file patch ID 017b0b393cafefc141b781eb41d68e11b492dbf2. Main has changed g17/queue/render/memory.rs since the tested J700 baseline. Refresh the J700 control on the merge candidate before carrying that result to current main.
  • Counted non-author approval.

…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 21 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

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

The fragment status page and parameter-buffer graph now use firmware-only kernel mappings. GPU commands still reach their explicit client aliases, and the Neo auxiliary fixture checks the altered mapping. The ARM64 W=1 Asahi build linked and the Neo auxiliary suite passed all three runs. The J700 render CTS kit is already queued, followed by the J714s control. A non-author approval is still due.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J700 (T8140, G17P) PASS on Linux #3245 at f04367d79322f6cf301d1984932a9a94c96782a8. Applied the two-file GPU diff (stable patch ID 017b0b393cafefc141b781eb41d68e11b492dbf2) to the 6985e45ab583 baseline driver, candidate driver tree d3f014104ac8. Both arms used the same 7.3.0-pr3681-c1fae1db Image and configuration. Only aurora.ko differed. The base boot was e32bc4d2-a002-4241-b075-641fbbf397f8 and the candidate boot was b0c24869-fa41-45a2-aa22-4d67e3355e62.

Matched all 111,162 draw.* and renderpasses.* CTS statuses with zero changes and zero new failures. Both arms verified the hard-fault setting aurora.fault_control=0 and absence of the soft-fault feature in GET_PARAMS. Both recorded zero GPU faults, WARN or BUG lines and passed the watchdog checks. Both arm verdicts and the matched comparator exited 0. Stock ICD SHA-256 begins 2457c29aa003; the CTS binary digest begins d3ef839af652.

Returned to verified Fedora stock 7.3.0-41.fc44.aurora.aarch64 on boot 96781cdf-cf0b-4517-9775-ed039c32c8d6, with matched stock fingerprints and PMU boot-error count 00 → 00. Sealed kit d5f52be5d54b7585496d272d92f84877609ab3d0f4d1ca18e3c705c436bfa49b.

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