Repository navigation
xmem: roll back failed physical page mapping batches - #7331
WebsiteStealer wants to merge 3 commits into
Conversation
…t startup XMemAllocatePhysicalPages, XMemFreePhysicalPages, XMemMapPhysicalPages and XMemMapPhysicalPagesScatter, with the shapes of the executable's call sites. A page is a 64 KiB slot of a pagefile-backed section; a 64 KiB-page reserve-only XMemVirtualAlloc is a placeholder reservation, and mapping a page replaces its placeholder with a view of the slot, so one page can be mapped at several addresses as on the console. The title's VirtualFree releases such a reservation whole. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent Windows test of Setup: Windows 11 x64, MSVC 19.44.35220 (
AI-assisted review/test. |
|
FAIL-class: rebase and shrink, do not close as-is. You merged cleanly through 5cf3daf, but main's #6919 (042c5f3) landed a physical-page implementation directly inside xmem.cpp and now conflicts with this PR's parallel xmem_physical.cpp — reconfirmed against current main 9177299. The page store, map/unmap placeholders and docs section are all superseded. The one piece main lacks is your atomic rollback of failed batch maps — and main documents the opposite explicitly (xmem.cpp:560: "A failure part-way leaves the pages before it mapped"), with no test asserting either behavior. If Win32 MapUserPhysicalPages atomicity motivates the rollback, that argument belongs against #6919: rebase keeping just that diff plus xmem_test cases for both paths, or close in favor of an issue. Also: draft PR with no CI checks. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
Claimed in the coordination issue as XMem physical mapping rollback.
Depends on: #6995. This is a draft stacked on that PR. The follow-up is commit 6b55bc1. The other commits in the comparison come from the dependency.
What and why
If Windows refuses a view after a physical page mapping call has already changed earlier views, restore the previous mappings and CPU page protections and return the original Windows error. Apply the same rollback to contiguous and scatter requests, including scatter requests that list an address more than once. This ports the rollback behavior we tested in WinDurango.
Tested
Windows 11 Pro build 26200, MSVC 19.50, RelWithDebInfo. Both Windows CPU tests,
xmemandxmem_physical, passed. With the new test linked against #6995 alone, four rollback checks fail. With the fix, all 74 physical-page checks pass. The test uses synthetic memory, including a native placeholder replacement that forces the last mapping operation to fail. No GPU is required for these tests.AI-assisted: yes (Codex).
Checklist