HLE/dstorage: a plain read the kernel refuses into guarded title memo… #552

Open
pug205gti6 wants to merge 1 commit from upstream-pr/552 into main
pug205gti6 commented 2026-11-25 02:07:28 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by pug205gti6 on 2026-11-25T02:07:28Z.


…ry is copied through a buffer

A plain DirectStorage read (options 0, file source, address destination) lands through ReadFile into title memory. kernel_will_write opens the write guard's blocks first, but the GPU side's check can make a block read-only again before the read lands; ReadFile then fails with ERROR_INVALID_USER_BUFFER (0x800706f8), the request fails, and the title stops on its own breakpoint shortly after (int3 at +0x23d8f03 here: an allocator result checked for null).

On those two errors (and ERROR_NOACCESS), when the destination is committed and accessible, read into our own buffer and store the bytes with plain writes, which fault into the guard's handler like the title's own. Anything else keeps the kernel's error.

RTX 3070 Ti 8 GB, Ryzen 5 5600X, Windows 11, Series X profile: three cold starts (fresh shader cache) in a row ended on that breakpoint, each right after "dstorage: request failed: copying ... hr=0x800706f8"; with this change three runs on new builds (shaders translated afresh) reached the world; the fallback copied one refused read in two of them, the third had none.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6595501228 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/552). Originally posted by [pug205gti6](https://github.com/pug205gti6) on 2026-11-25T02:07:28Z. --- …ry is copied through a buffer A plain DirectStorage read (options 0, file source, address destination) lands through ReadFile into title memory. `kernel_will_write` opens the write guard's blocks first, but the GPU side's check can make a block read-only again before the read lands; ReadFile then fails with ERROR_INVALID_USER_BUFFER (0x800706f8), the request fails, and the title stops on its own breakpoint shortly after (int3 at +0x23d8f03 here: an allocator result checked for null). On those two errors (and ERROR_NOACCESS), when the destination is committed and accessible, read into our own buffer and store the bytes with plain writes, which fault into the guard's handler like the title's own. Anything else keeps the kernel's error. RTX 3070 Ti 8 GB, Ryzen 5 5600X, Windows 11, Series X profile: three cold starts (fresh shader cache) in a row ended on that breakpoint, each right after "dstorage: request failed: copying ... hr=0x800706f8"; with this change three runs on new builds (shaders translated afresh) reached the world; the fallback copied one refused read in two of them, the third had none.
Headache3318 commented 2026-11-25 05:09:03 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Headache3318 on 2026-11-25T05:08:30Z.


Independent verification: PR #552 merges cleanly onto main, 68 lines added to crates/victory-hle/src/modules/dstorage.rs. Build: success (7.97s). Tests: fail to compile on Linux due to pre-existing windows_sys issues in victory-loader and victory-gpu — confirmed on unmodified main. Addresses DirectStorage guarded memory read failure. Machine: Arch Linux, kernel 7.3.5-arch1-1, 3x RTX 4090 driver 620.73.04, Proton, AI-assisted.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7153487632 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/552#issuecomment-7153487632). Originally posted by [Headache3318](https://github.com/Headache3318) on 2026-11-25T05:08:30Z. --- Independent verification: PR #552 merges cleanly onto main, 68 lines added to crates/victory-hle/src/modules/dstorage.rs. Build: success (7.97s). Tests: fail to compile on Linux due to pre-existing windows_sys issues in victory-loader and victory-gpu — confirmed on unmodified main. Addresses DirectStorage guarded memory read failure. Machine: Arch Linux, kernel 7.3.5-arch1-1, 3x RTX 4090 driver 620.73.04, Proton, AI-assisted.
Revens2 commented 2026-11-25 08:09:02 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Revens2 on 2026-11-25T07:38:16Z.


Duplicate of #426: @YeokiNoewChi opened this patch 87 minutes earlier, and gh pr diff returns the same bytes for both (+68/-0 on 1 file(s), same title).

Both PRs are CONFLICTING, so this copy does not resolve the conflict it was probably made for.

Please continue in #426 so the review history and any test data stay in one place.
Thanks.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7156084088 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/552#issuecomment-7156084088). Originally posted by [Revens2](https://github.com/Revens2) on 2026-11-25T07:38:16Z. --- Duplicate of #426: @YeokiNoewChi opened this patch 87 minutes earlier, and `gh pr diff` returns the same bytes for both (+68/-0 on 1 file(s), same title). Both PRs are CONFLICTING, so this copy does not resolve the conflict it was probably made for. Please continue in #426 so the review history and any test data stay in one place. Thanks.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/552:upstream-pr/552'
git switch 'upstream-pr/552'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/552'
git switch 'upstream-pr/552'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/552'
git switch 'upstream-pr/552'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/552'
git switch 'main'
git merge --squash 'upstream-pr/552'
git switch 'main'
git merge --ff-only 'upstream-pr/552'
git switch 'main'
git merge 'upstream-pr/552'
git push origin 'main'
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
fxceless/victory-fork!552
No description provided.