fix(libkernel): honour MAP_FIXED in sceKernelReserveVirtualRange and sceKernelMemoryPoolReserve #198
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/198"
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 MichonGoddijn231849 on 2026-09-30T22:00:32Z.
What
sceKernelReserveVirtualRangeandsceKernelMemoryPoolReserveignored their flags and the requested address, and reserved wherever the arena had room. A title that reserves a range withMAP_FIXEDthen uses the address it asked for, not the one returned. Marvel's Wolverine passes 0x400010 (MAP_FIXED | MAP_NO_COALESCE) for its heaps and later maps and writes at those addresses, memory that was never reserved.DoReserveVirtualtakes the flags. WithMAP_FIXEDand an address, it checks the range is free (RequireAvailable, as the fixed maps do) and reserves exactly there, keepingMAP_NO_COALESCE.sceKernelMemoryPoolReservestarts fromaddr_in, as the fixed case needs.Tested
Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0.
guest_memory: newCheckFixedVirtualReservationreserves a known free range withMAP_FIXEDthrough both functions and requires the requested address back. It fails onmainand passes with this change.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🤖 Generated with Claude Code