feat(agc): DMA_DATA prefetches to DST_SEL nowhere #1709

Merged
MathiasDevelopes merged 1 commit from upstream-pr/1709 into main 2026-10-10 04:40:56 +00:00
MathiasDevelopes commented 2026-10-08 17:16:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MathiasDevelopes on 2026-10-08T17:16:50Z.


What

DMA_DATA with DST_SEL 2 (V_411_NOWHERE in Mesa's src/amd/common/sid.h) reads its source into L2 and stores nothing. libSceAgc emits it as an L2 prefetch, with the source address repeated as the destination (c0055000 60200000 8038e000 1d 8038e000 1d 8000caf0). The validator rejected it with "DMA_DATA register or prefetch destination is not implemented", so a title that prefetches aborts.

A prefetch of a memory source (SRC_SEL 0 or 3) is now accepted and writes nothing:

  • ResolveStore returns it as an empty store, so the packet stays ordered without a drain.
  • DecodeMemoryCopy still rejects it, so no buffer copy is recorded.
  • Execute returns before reading the source.

A prefetch of a register, GDS or immediate source still throws ("DMA_DATA prefetch of a register, GDS or immediate source is not implemented"), and so does a register destination (DAS).

Source of the semantics: Mesa src/amd/common/sid.h (S_411_DST_SEL, V_411_NOWHERE). Not measured on hardware: a prefetch has no visible memory effect to measure.

Tested

Windows 11, RTX 3060. agc_driver_pm4 covers the new path: a prefetch resolves as an empty store, does not decode as a copy, leaves memory unchanged, and the immediate-source and register-destination forms throw. All 183 agc_driver tests pass, and tools/check_conventions.py --base origin/main passes. PPSA07906 (Unreal Engine 5) issues these packets at startup and aborted on them; with the change it gets past them and renders its intros.

Checklist

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4790366852 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1709). Originally posted by [MathiasDevelopes](https://github.com/MathiasDevelopes) on 2026-10-08T17:16:50Z. --- ### What `DMA_DATA` with `DST_SEL` 2 (`V_411_NOWHERE` in Mesa's `src/amd/common/sid.h`) reads its source into L2 and stores nothing. libSceAgc emits it as an L2 prefetch, with the source address repeated as the destination (`c0055000 60200000 8038e000 1d 8038e000 1d 8000caf0`). The validator rejected it with "DMA_DATA register or prefetch destination is not implemented", so a title that prefetches aborts. A prefetch of a memory source (`SRC_SEL` 0 or 3) is now accepted and writes nothing: - `ResolveStore` returns it as an empty store, so the packet stays ordered without a drain. - `DecodeMemoryCopy` still rejects it, so no buffer copy is recorded. - `Execute` returns before reading the source. A prefetch of a register, GDS or immediate source still throws ("DMA_DATA prefetch of a register, GDS or immediate source is not implemented"), and so does a register destination (`DAS`). Source of the semantics: Mesa `src/amd/common/sid.h` (`S_411_DST_SEL`, `V_411_NOWHERE`). Not measured on hardware: a prefetch has no visible memory effect to measure. ### Tested Windows 11, RTX 3060. `agc_driver_pm4` covers the new path: a prefetch resolves as an empty store, does not decode as a copy, leaves memory unchanged, and the immediate-source and register-destination forms throw. All 183 `agc_driver` tests pass, and `tools/check_conventions.py --base origin/main` passes. PPSA07906 (Unreal Engine 5) issues these packets at startup and aborted on them; with the change it gets past them and renders its intros. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [[technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md)](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [[TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs)](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
copilot-pull-request-reviewer[bot] commented 2026-10-08 17:16:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-10-08T17:16:56Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5460374314 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1709#pullrequestreview-5460374314). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-10-08T17:16:56Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
fisherjoey commented 2026-10-09 04:52:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-09T04:52:34Z.


Linux results, since this was tested on Windows only. Everything passes here.

Nobara 44 (Linux 7.2), GCC 16.2.1, Release, BUILD_TESTING=ON. This PR merged onto main f1451396 cleanly.

main f1451396 main + this PR
RTX 5070 Ti, driver 595.91.07, ctest -R agc_driver -j1 207 / 207 207 / 207
RADV, Ryzen 5 7600X iGPU (gfx1036), Mesa 26.2.1, same 207 / 207 207 / 207
CPU tests (-E agc_driver) 286 / 287 286 / 287

The CPU failure is guest_dynamic_loader, which fails the same way on main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6074516025 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1709#issuecomment-6074516025). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-09T04:52:34Z. --- Linux results, since this was tested on Windows only. Everything passes here. Nobara 44 (Linux 7.2), GCC 16.2.1, Release, `BUILD_TESTING=ON`. This PR merged onto `main` f1451396 cleanly. | | `main` f1451396 | `main` + this PR | |---|---|---| | RTX 5070 Ti, driver 595.91.07, `ctest -R agc_driver -j1` | 207 / 207 | 207 / 207 | | RADV, Ryzen 5 7600X iGPU (gfx1036), Mesa 26.2.1, same | 207 / 207 | 207 / 207 | | CPU tests (`-E agc_driver`) | 286 / 287 | 286 / 287 | The CPU failure is `guest_dynamic_loader`, which fails the same way on `main`.
XairRrR commented 2026-10-09 11:55:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-09T11:55:19Z.


Uncharted: Legacy of Thieves Collection (PPSA05684) stops at this on main:

AGC driver: DMA_DATA at DWORD 55: DMA_DATA register or prefetch destination is not implemented

I fixed it independently the same way (DST_SEL 2 from a memory source writes nothing and is not ordered as a store) while bringing the title up to its main menu, so I'm not opening a competing PR. I have not run this branch itself with the title.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6080348045 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1709#issuecomment-6080348045). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-09T11:55:19Z. --- Uncharted: Legacy of Thieves Collection (PPSA05684) stops at this on `main`: ``` AGC driver: DMA_DATA at DWORD 55: DMA_DATA register or prefetch destination is not implemented ``` I fixed it independently the same way (DST_SEL 2 from a memory source writes nothing and is not ordered as a store) while bringing the title up to its main menu, so I'm not opening a competing PR. I have not run this branch itself with the title.
github-actions[bot] commented 2026-10-09 22:05:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T22:05:24Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#2156 core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp L573
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6090031024 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1709#issuecomment-6090031024). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-09T22:05:24Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #2156 | `core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp` [L573](https://github.com/boykopovar/AnyPS5/blob/80d539abcbd0f90a7b6e64f7ab4868556671f241/core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp#L573) | | |
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1709
No description provided.