fix(libkernel): ignore unrecognised virtual memory mapping flags #1392
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1392"
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 authurtabo-byte on 2026-10-08T01:37:19Z.
What
sceKernelMapNamedFlexibleMemory(via_mapFlexible→DoMapAnon→MapPlaced) threwUnsupported memory mapping flagsfor flag bit0x8000, which the guest libc sets on its heap mappings, so titles aborted at startup.0x8000is not a documentedSCE_KERNEL_MAP_*flag: the flag set is taken from GPCS4 and fpPS4, and no console flag is defined at0x8000.MapPlacednow accepts0x8000alongside the flags that change behaviour (SCE_KERNEL_MAP_FIXED0x10,SCE_KERNEL_MAP_NO_OVERWRITE0x80,SCE_KERNEL_MAP_NO_COALESCE0x400000); any other unrecognised bit is still rejected. Recorded in technical debt, updating the existingsceKernelMapNamedFlexibleMemoryInternalentry.Tested
Windows 11, Pure Pool Pro (PPSA28502). Before: the title aborted in
MapPlacedon its first libc heap mapping. After: it maps its heap, opensOut.logand/app0/, allocates 1 GiB of direct memory and starts its engine thread pool.guest_memorypasses.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 repositoryImported from boykopovar/AnyPS5. Originally posted by 6639835 on 2026-10-08T02:32:16Z.
Review: COMMENTED
Reviewed three patches at
cbf4c50. MapPlaced removes unknown-bit rejection while retaining FIXED handling/known constants. Tests map observed 0x8000 and separate 0x10000000 flags, unmap both and restore flexible memory. No defect found within this patch scope. Guest-memory tests/builds and console behavior were not verified; other flags depend on stated compatibility assumptions.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T03:26:22Z.
Please accept 0x8000 only and keep the throw for other unknown bits: add it to
SupportedFlagsinMapPlaced(DirectMemory.cpp:454on main) instead of removing the check, and keep a test that expects a throw for 0x10000000. Main already has a TechnicalDebt line for 0x8000 (undersceKernelMapNamedFlexibleMemoryInternal); update that one instead of adding a new entry. The branch also needs a rebase forTechnicalDebt.md.Imported from boykopovar/AnyPS5. Originally posted by authurtabo-byte on 2026-10-08T04:53:50Z.
Done — rebased onto current
mainand applied the requested change:MapPlacednow adds0x8000toSupportedFlagsand keeps the throw for every other unrecognised bit; the rejection check is back.GuestMemory.cppkeeps the0x8000success case and restores the expectation that0x10000000throws.sceKernelMapNamedFlexibleMemoryInternalTechnicalDebt line is updated instead of adding a new entry, and the rebase conflict inTechnicalDebt.mdis resolved.guest_memorypasses. Thanks for the precise review.Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-08T05:24:41Z.
This looks like the same change as #957: both make
sceKernelMapNamedFlexibleMemoryInternalaccept flag0x8000, here by adding it toSupportedFlagsinDirectMemory.cpp, there by masking it inDirectMemory/Export.cpp(IgnoredInternalFlag). Both extendtests/GuestMemory.cpp. Linking so they can be compared.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T06:37:10Z.
Closing: #957, merged this morning, already accepts 0x8000 in
sceKernelMapNamedFlexibleMemoryInternal. If PPSA28502 still stops on main, please reopen with the log line.Pull request closed