XMem: pin short records in tracked CPU mappings #2433

Merged
R0Y00 merged 1 commit from upstream-pr/2441 into main 2026-11-25 17:02:02 +00:00
R0Y00 commented 2026-11-25 16:56:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T16:56:13Z.


Refs #1914.

A consumer that records a short command argument can encounter a tracked XMem CPU mapping outside the graphics mirror. Version 2 of the existing in-process section lease API can pin a record within one committed physical page and verify that the same backing still covers it later. The pin keeps the original slot alive across unmapping, grant retirement and reuse of the virtual address. Version 1 retains its mirrored, potentially multi-page contract.

The CPU regression covers a 12-byte record ending at the page boundary, late writes to the original view, same-address replacement, an unleased prefix, crossing the page, holes, mismatched API versions and duplicate release.

Windows 11 build 26200, Release with MSVC x64. The local fixture and regressions passed 10/10 with zero skips, including RTX 4060 Laptop (32.0.16.1656) and WARP.

cmake --build --preset release --target xmem_section_lease_check
ctest --preset release --no-tests=error -j1 -R '^(xmem_section_lease_|xmem_page_batch_inflight_|xmem_shim_mapped_pages$)' --output-on-failure
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6609433909 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2441). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T16:56:13Z. --- Refs #1914. A consumer that records a short command argument can encounter a tracked XMem CPU mapping outside the graphics mirror. Version 2 of the existing in-process section lease API can pin a record within one committed physical page and verify that the same backing still covers it later. The pin keeps the original slot alive across unmapping, grant retirement and reuse of the virtual address. Version 1 retains its mirrored, potentially multi-page contract. The CPU regression covers a 12-byte record ending at the page boundary, late writes to the original view, same-address replacement, an unleased prefix, crossing the page, holes, mismatched API versions and duplicate release. Windows 11 build 26200, Release with MSVC x64. The local fixture and regressions passed 10/10 with zero skips, including RTX 4060 Laptop (32.0.16.1656) and WARP. ```powershell cmake --build --preset release --target xmem_section_lease_check ctest --preset release --no-tests=error -j1 -R '^(xmem_section_lease_|xmem_page_batch_inflight_|xmem_shim_mapped_pages$)' --output-on-failure ```
upstream-sync closed this pull request 2026-11-25 18:01:05 +00:00
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
R0Y00/Xbox2Windows!2433
No description provided.