Fix DLSS initialization with staged guest address reservations #2443
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!2443
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2443"
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?
@OlaiFG7 on GitHub · 2026-11-20 07:44 UTC · original
OlaiFG7:fix-dlss-guest-reservations→main· +600 −71 · 6 files · 7 commits · openContinues the work from #2274, preserving its commits and adding hardening for staged guest address reservations. The change delays part of the reservation until after GPU initialization and improves synchronization, host mapping handling, and reservation coverage.
Validation: not run; CMake and project submodules were unavailable in the local environment.
@coderabbitai[bot] on GitHub · 2026-11-20 07:55 UTC · original · edited 2026-11-20 08:17 UTC
No actionable comments were generated in the recent review.
Walkthrough
The change reserves available guest address ranges around existing host mappings. It reserves guest region 0 during memory initialization and schedules reservation of regions 1 and 2 after GPU initialization. It adds alignment and reservation tests, checks that an existing Linux mapping remains intact, and checks repeated reservation. Memory ownership checks in the changed operations now run under the shared state lock.
Suggested reviewers:
nmzik,nikosszzzChange: Bug fix
Merge Risk:
Minimal · up to
8b362Guest address space reservation on Linux now retries with a fresh view of host mappings, so a concurrent host mapping no longer ends startup on the first collision. No concrete merge-blocking issue remains. The author reports that no build or test run was done, so a normal CI pass is still worthwhile.
Pre-merge checks:
4
#2274, adds hardening for staged guest address reservations, delays part of the reservation until after GPU initialization, and improves sync…Full details: Title check
Explanation
The title names the main change: a DLSS initialization fix that relies on staged guest address space reservations. The changeset delays part of the reservation until after GPU initialization (agc.cpp, memory.cpp, memoryAddressSpace.inc), which matches the title's subject. The title is specific and concise, and it matches the PR objectives.
Full details: Description check
Explanation
The description states that the change continues work from
#2274, adds hardening for staged guest address reservations, delays part of the reservation until after GPU initialization, and improves synchronization and host mapping handling. These points match the changeset. It also notes that validation was not run.Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
cbc52821-ee29-4e6b-9f1f-de96f2b8cb67Reviewing files that changed from the base of the PR and between
949a7d3b28and8b362f5c8b.src/kernel/memoryAddressSpace.incIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
@ -1013,0 +1227,4 @@segment->segname, errno);}AddFreeUnlocked(expected_start, segment->vmsize);m_owned.emplace_back(expected_start, segment->vmsize);@coderabbitai[bot] on GitHub · 2026-11-20 07:55 UTC · original · edited 2026-11-20 08:09 UTC
Keep linked-segment ownership consistent with merged free ranges.
On linked macOS builds,
SYSTEM_MANAGEDandSYSTEM_RESERVEDare adjacent.AddFreeUnlockedmerges their free ranges, but this insertion leaves separate ownership entries.A two-page allocation across
HOST_SYSTEM_MANAGED_MAX + 1can therefore succeed inCommitand then failKernelMprotector fixed replacement.Ownsrequires the entire span to fit in one entry. Coalesce adjacent owned intervals, or makeOwnscheck contiguous coverage.✅ Addressed in commit
8b362f5@coderabbitai[bot] on GitHub · 2026-11-20 07:55 UTC · original · reviewed
Actionable comments posted: 1
7eb686be-104a-4a4d-b60e-efa6565e18f1Reviewing files that changed from the base of the PR and between
a1fc5ae438and949a7d3b28.src/emulator.cppsrc/kernel/memory.cppsrc/kernel/memory.hsrc/kernel/memoryAddressSpace.incsrc/libs/agc.cpptests/VirtualMemoryAllocationTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.