Repository navigation
DirectStorage: read memory sources and lazy pages through read_own - #2359
Draft
safesearch77 wants to merge 1 commit into
Draft
safesearch77 wants to merge 1 commit into
safesearch77 wants to merge 1 commit into
Conversation
ReadProcessMemory is a kernel call and fails on uncommitted lazy physical pages (kernelx::lazy) instead of faulting into the vectored handler, unlike dstorage::writable which calls lazy::ensure first. Meanwhile, execute()'s virtual memory-source branch still checked gpu::shader::readable and copied with ptr::copy_nonoverlapping: lazy physical pages and copies above 256 MiB failed with E_ACCESS_VIOLATION (0x89240009), sources above 64 KiB walked regions with VirtualQuery, and a source decommitted while queued faulted in xcl-dstorage. Commit lazy physical pages in read_own before ReadProcessMemory (while preserving 0-byte and wrapping-range rejection) and route virtual memory-source reads through read_own. Assisted-by: Antigravity (Gemini 4 Carbon)
|
Tested commit Environment
Results
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dstorage::writableand the routedReadFilehook commit lazy physical pages (kernelx::lazy::ensure) first because kernel calls fail on uncommitted lazy reservations instead of faulting into the vectored handler, butdstorage::read_own(ReadProcessMemory) did not, andexecute()still read virtual memory sources withgpu::shader::readable+ptr::copy_nonoverlapping. As a result, page arrays or memory sources overlapping untouched lazy physical pages and copies above 256 MiB failed withE_ACCESS_VIOLATION(0x89240009), memory sources above 64 KiB walked regions withVirtualQuery, and a memory source decommitted while queued faulted in thexcl-dstorageworker (0xC0000005).What is in it
crates/xcl/src/hle/dstorage.rs:read_ownchecks for overflow (keeping 0-byte rejection unchanged) and commits lazy physical pages withkernelx::lazy::ensurebeforeReadProcessMemory;executereads virtual memory sources throughread_own.crates/xcl/src/hle/dstorage.rs(tests):a_memory_source_and_page_array_in_lazy_pages_commit_instead_of_failing(deterministic red->green test) anda_memory_source_unmapped_under_the_worker_fails_the_request(decommit/commit race stress test modeled on DirectStorage: a deferred page-array entry is reread without faulting (#476) #509).Tested
x86_64, base0829441, head94fae46) withcargo check --offline --target x86_64-pc-windows-gnu --workspace --tests: 0 errors, 0 warnings indstorage.rs.Not tested
cargo test --workspace -- --test-threads=4counts and pairedscripts/smoke.ps1regression runs are attached).ReadProcessMemory, AMD / Intel GPUs, retail titles.AI use
dstorage.rsfix, unit tests, and description; reviewed with Claude Opus 5.5.