startup: allocations the title makes itself can land above 2^40; add an opt-in launcher mode that keeps them low (#1758) #2858
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#2858
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@tedin7 on GitHub · 2026-11-26 14:38 UTC · original
Part of #1758 (under #874)
Problem
The package acceleration-structure builder refuses a destination address that has bits set above bit 39 (documented in docs/experiments.md, "Startup blocks below 2^40"). It receives the title's CPU address of the block, not a desktop GPU virtual address, so the shim cannot move it.
X2W_XMEM_STARTUP_BELOW_40=1already places the large-page startup blocks (XMemVirtualAlloc, attribute0x283) below 2^40. That covers only blocks the shim allocates. The title also allocates memory itself withVirtualAlloc. By default a 64-bit Windows process gets bottom-up allocations from a random start (bottom-up ASLR), which is often far above 2^40, so a placed buffer inside such a block hands the builder an address with high bits set. The shim never sees that allocation, so it cannot place it.What would fix it
tools/startup/launch.pyandtools/startup/debug_launch.pystart the title withPROC_THREAD_ATTRIBUTE_MITIGATION_POLICYset toPROCESS_CREATION_MITIGATION_POLICY_BOTTOM_UP_ASLR_ALWAYS_OFF, so the title's ownVirtualAllocblocks come from the low end of the address space. Opt in withX2W_LOW_ADDRESSES=1(run.ps1 -LowAddresses). If the attribute list cannot be built the launcher says so and starts the title as before.Acceptance
startup_launchruns a source-built probe that reserves blocks of several sizes. WithX2W_LOW_ADDRESSES=1every block ends below 2^40. Without it, at least one of eight runs gets a block above 2^40 (the control).X2W_XMEM_STARTUP_BELOW_40.Source: Microsoft documentation of
UpdateProcThreadAttribute,PROC_THREAD_ATTRIBUTE_MITIGATION_POLICYandPROCESS_CREATION_MITIGATION_POLICY_BOTTOM_UP_ASLR_ALWAYS_OFF; docs/experiments.md "Startup blocks below 2^40".@tedin7 on GitHub · 2026-11-26 14:38 UTC · original
Claiming this; a Draft PR follows shortly.