memory: refactor #1941
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!1941
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1941/head"
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?
@Nmzik on GitHub · 2026-10-27 19:25 UTC · original
KytyPS5:memory-refactor→main· +1442 −1247 · 6 files · 3 commits · merged 2026-10-27 20:14 UTCNo description provided.
@coderabbitai[bot] on GitHub · 2026-10-27 19:33 UTC · original · edited 2026-10-27 19:50 UTC
No actionable comments were generated in the recent review.
5347c7cd-01b8-4fac-9bb8-802ed58c54d7Reviewing files that changed from the base of the PR and between
57c4b93ca8andd0027b4b31.src/kernel/memory.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
Walkthrough
Physical, flexible, and pooled memory mappings now use ordered interval maps. Unmap and release operations support partial ranges and restore mappings and metadata when operations fail. Flexible backing tracks its high-water mark and clears previously exposed backing when reused. Pool decommit validates the full span and retains reservations. ASan shadow tracking records covered guest bytes. Tests add coverage for fragmented ranges, rollback, pool operations, backing zeroing, and ASan shadow lifetime.
Suggested reviewers:
brandostrong,claxten10Priority:
Normal
Change: Refactor
Merge Risk:
Low · up to
d0027A failed direct-memory release may leave a read-only mapping writable. This is a bounded risk worth fixing or explicitly accepting before merge.
Pre-merge checks:
2 ·
1 ·
2
Full details: Docstring Coverage
Explanation
Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 72 functions across 4 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
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
Comment
@coderabbitai helpto get the list of available commands.@ -2860,0 +2305,4 @@VirtualMemory::Mode mode = VirtualMemory::Mode::NoAccess;EXIT_IF(!DecodeMemoryProtection(it->protection, &mode));EXIT_IF(!g_guest_address_space->MapBacking(it->start, it->size, it->offset, mode));@coderabbitai[bot] on GitHub · 2026-10-27 19:33 UTC · original
Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 2540
Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 23936
Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 10796
Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 11496
Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 19268
Restore and retain read-only protection on every direct-view rollback.
KernelMprotectapplies host protection and then updatesVirtualRanges. A failed release can rebuild a read-only alias throughMapBacking, which converts it toReadWriteorExecuteReadWrite.GuestBackingStore::Unmapcan also rebuild a partially unmapped alias with that writable stored mode.The all-alias
Protectpass is correct for the immediate rollback. Apply it torestore_mappingsandrestore_chunksas well. Also update the stored backing-view mode whenProtectchanges a mapping. Otherwise, a later failedUnmapcan widen the protection again.This is a functional-correctness issue because host protection can differ from the recorded guest protection.
🛡️ Immediate rollback fix
@coderabbitai[bot] on GitHub · 2026-10-27 19:33 UTC · original · reviewed
Actionable comments posted: 1
25ea51c8-a5a9-4b9d-93e6-18bb3ecb5389Reviewing files that changed from the base of the PR and between
0685bffb2fandfc918fcde3.src/kernel/memory.cppsrc/kernel/memory.hsrc/kernel/memoryAddressSpace.incsrc/libs/libDbgAsan.cpptests/VirtualMemoryAllocationTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.