docs(libkernel): record flexible memory flag 0x8000 as measured on a PS5 #10305
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10305"
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 orezraey on 2026-10-23T16:58:22Z.
What
Flag 0x8000 of the flexible memory maps, measured on a retail PS5 (firmware 13.60) through
libkernel_sys.sprxfrom a payload process. The source and console log are in this gist (pflex8000). The debt entry said only that its meaning is not established.On the console:
sceKernelMapNamedFlexibleMemoryInternalaccepts 0x8000, and the mapping's address,sceKernelVirtualQueryrecord andsceKernelQueryMemoryProtectionanswer are the same as without it, so it has no visible effect there;sceKernelMapFlexibleMemoryandsceKernelMapNamedFlexibleMemoryfail 0x8000 withEINVAL(0x80020016);sceKernelMapFlexibleMemorydoes so for every size and protection tried, and fails every other single flag tried from 0x1 to 0x100000 except 0x80 (0x10,MAP_FIXED, was not tried).AnyPS5 accepts and ignores 0x8000 in
sceKernelMapFlexibleMemoryandsceKernelMapNamedFlexibleMemoryInternal, and throws for it insceKernelMapNamedFlexibleMemoryand for the other rejected flags in all three, as before. It keeps accepting 0x8000 in the first two: PPSA22520 01.000.011 passes 0x8000 tosceKernelMapFlexibleMemory, so a title is likely allowed what this payload process is not (its SDK version is the probable difference, which this probe could not show). Only the debt entry changes, to record the measurement and why the rejection is not reproduced.Tested
main(504ea3b53b, with #10794):0850552608. Kept #10794'spthread_main_np and scePthreadMainentry and this PR's measured 0x8000 entry;check_conventionspasses.main(cf528e78c6, with #9160):336a738f91. Kept #9160'spthread_main_npentry and this PR's measured 0x8000 entry. Documentation only;check_conventionsandpr_overlappass.Not tested: documentation only (head
8ed4ce86cb).tools/check_conventions.pypasses.tools/pr_overlap.py: #9160 edit nearbylibkernel.mdlines; whichever lands second keeps both.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)pthread_main_npline, has merged andmainis merged in)Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-24T15:44:35Z.
Review: COMMENTED
Checked against main
c9b75825f3and the linked gist (pflex8000.c/pflex8000.log), plusDirectMemory/Export.cppandDirectMemory/DirectMemory.cppon main:MapPlaced(DirectMemory.cpp:789-799) throwsinvalid_argument("Unsupported memory mapping flags …")for any flag outside0x10 | 0x80 | 0x400000, so the other flags in that list throw in all three functions. AndsceKernelMapNamedFlexibleMemorypasses flags through unchanged (Export.cpp:288-292), so it throws on 0x8000 as well; onlysceKernelMapFlexibleMemoryand the Internal variant strip it.sceKernelMapNamedFlexibleMemory, throw. 0x8000 is accepted in the other two because PPSA22520 01.000.011 passes it tosceKernelMapFlexibleMemory."GUEST_MAP_UNKNOWN_8000) and sharpemu references, and the note on how the libc.prx heap uses the mapping. Was that intended? They seem like useful support for keeping 0x8000 ignored.Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-24T16:37:24Z.
Review: APPROVED
Re-checked head
8ed4ce86cbagainst mainfeb5059ac4:sceKernelMapNamedFlexibleMemory, throw (MapPlacedin DirectMemory.cpp; the named variant passes flags through), and 0x8000 is accepted only insceKernelMapFlexibleMemoryand the Internal variant, with PPSA22520 given as the reason.Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T21:16:24Z.
Review: DISMISSED
I checked the referenced probe log. It supports the stated distinction:
sceKernelMapFlexibleMemoryandsceKernelMapNamedFlexibleMemoryreturn0x80020016for0x8000; the Internal variant succeeds, and its address,VirtualQueryspan/tail, and reported protection match the zero-flag call. The caveat for the untried0x10flag and the payload-process scope are also retained.The remaining step is integration: #9160 is still open, and this branch is based on
e93ec68, 7,529 commits behind currentmain;docs/dev/debt/libkernel.mdhas changed since. Please refresh after the stated merge-order dependency lands, keep the measured distinction intact, and rerun conventions/overlap checks on the final head. This is documentation-only, so no runtime test is needed.