Repository navigation
Conversation
|
Tested
The new On the interaction with #501, which the description mentions: #501 puts This review was AI-assisted. |
|
Hardware check of Tested
Regression run PR ( Not tested
AI use
|
…xcl-dev#626) ClzeroLoop used a single VirtualQuery that treated PAGE_READWRITE|PAGE_GUARD as writable and skipped lazy physical pages still in MEM_RESERVE. Walk every region like dstorage::writable, reject guards, checked_add the end, and ensure lazy pages before answering. Assisted-by: Cursor (Composer)
056cb61 to
ed2f33c
Compare
|
Test report for Tested
Not tested
AI use
|
Fixes #626 (item 3 of #278:
is_writableguards). Items 1–2 are already onmain; item 4 is #321. Complements #501 (sparse-window fast path) — this PR fixes the VirtualQuery fallback that #501 still uses.Emulated
CLZERO/ClzeroLoopasked whether the destination was writable with a singleVirtualQuery. That was wrong in four ways:PAGE_GUARD.PAGE_READWRITE | PAGE_GUARD(0x104) passed& (PAGE_READWRITE | PAGE_EXECUTE_READWRITE) != 0, so the VEH would write through a guard page instead of letting the real fault happen.ClzeroLoopcan cover adjacent committed runs with different protect; one query only sees the first.va + bytes. A wrapping end was undefined.MEM_RESERVE(lazy map) madeis_writablefalse →0xC000001D, instead of committing vialazy::ensureand zeroing.What is in it
eh::is_writablenow matches the shape ofdstorage::writable:checked_add→lazy::ensure→ UMA coherent-window fast path → walk everyVirtualQueryregion covering[va, end), requiring a writable protect (READWRITE/WRITECOPY/EXECUTE_*) and noPAGE_GUARD.VirtualProtect;PAGE_NOACCESSand wrapping end; span across two differently-protected committed pages; reserved hole fails; lazy page commits throughensure; CLZERO on a guard page returns 0 without clearing the guard.Tested
rust-toolchain.toml.cargo test -p xcl --lib eh::tests -- --nocapture: 8 passed, 0 failed.cargo test -p xcl --lib -- --test-threads=4: 648 passed, 0 failed, 21 ignored; 0 GPUSKIPPED.ed2f33c.Regression run
Same title and wall time on
mainand on this PR's head (clean tree):Not tested
sparse::known_writablefast path (not onmainyet); merge order should be fine — both can sit above the VirtualQuery walk.AI use
Implemented, tested, smoke runs, and PR description with Cursor (Composer). Plan posted on #626 / #278 before landing the complete PR.