fix(libkernel): map non-fixed hints inside a reserved range in place #2667
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2667"
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?
Imported from boykopovar/AnyPS5. Originally posted by ps54all on 2026-10-10T10:30:34Z.
What
sceKernelMapDirectMemoryand the flexible/anonymous map path treat an address withoutMAP_FIXEDas a pure hint. Ratchet & Clank: Rift Apart (PPSA01474) reserves 64 GiB withsceKernelReserveVirtualRange(0x12c3000000+0x1000000000) and then maps its heaps inside that range with a hint and noMAP_FIXED(0x1307000000+0x204000, prot 0x42, flagsNO_COALESCE). The hint was not honoured: the range was mapped past the end of the reservation (0x22c3100000), the title kept using0x1307000000, andsceAmprCommandBufferSetBufferfaulted writing a command buffer object at0x1307200000.A map whose hint lies wholly inside a range that is still reserved is now placed there, as a fixed map into the reservation would be (
PlaceHintInReservation, called fromDoMapDirectandDoMapAnon). Hints outside reservations, and hints over a range that is partly mapped, keep their current behaviour.That a hint inside a reservation is taken as is comes from the title's behaviour, not from a console measurement; it is listed in
TechnicalDebt.md.Tested
BUILD_TESTING=ON, onmaina29ef592.guest_memorycaseCheckHintInsideReservation: reserve four pages, map direct memory at the second and flexible memory at the third with hints and noMAP_FIXED; both land at their hints, the fourth page stays reserved and uncommitted. A hint over the two mapped pages still moves and leaves their contents intact. Without theDirectMemory.cppchange the case fails at the first address check.guest_memoryas a whole aborts later, at the existing read-onlysceKernelPreadcheck (CheckReadsIntoSharedWriteTracking); it fails at the same check on unmodifiedmainon this machine, so it is not caused by this change. The new case runs before it and passes.-E "^agc_|^video_out|^guest_video"): 375/378. The other failures:guest_file_vector(/dev/urandomreads, also unrelated) andguest_sce_net(DNS timeout on this machine).tools/check_conventions.py --base origin/mainandtools/check_test_registration.pypass.libSceAmpron its first command buffer; with it the title runs for 150 s and issues draws. Not re-run on this exact branch.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T10:30:44Z.
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
Pull request closed