perf(libkernel): look up unwind mappings with PROCMAP_QUERY #3227
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3227"
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 GustavoGamarra95 on 2026-10-11T02:08:25Z.
What
On Linux,
sceKernelGetModuleInfoForUnwind(libkernel) andsceSysmoduleGetModuleInfoForUnwind(libSceSysmodule) opened/proc/self/mapsand scanned it line by line withsscanfon every call. Unity IL2CPP titles call them on each stack walk. God of War Sons of Sparta (PPSA28997) has about 900 mappings, and 16 of 19eu-stacksamples of its main thread were in that scan.prx/libc/include/specifics/linux/HostMapping.hppasks the kernel for the mapping that covers an address with thePROCMAP_QUERYioctl (Linux 6.11), on one/proc/self/mapsdescriptor opened once. It uses the same probe and the sameAPS5_NO_PROCMAP_QUERYswitch asGuestMemory.cpp. Older kernels, and the switch, keep the line scan.sceSysmoduleGetModuleInfoForUnwindhad no test.GuestSysmodule.cppnow compares it with an independent read of/proc/self/mapsfor code, the stack and an anonymous page, and checks that an unmapped address throws. On Linux the test runs a second time withAPS5_NO_PROCMAP_QUERY(guest_sysmodule_maps_scan), so the line scan stays covered.Tested
maind31b57a4:ctest752/753 passed. The failure isagc_driver_dcc_keys_first_write, which fails onmainon this GPU too. The unwind tests pass with and withoutAPS5_NO_PROCMAP_QUERY.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-11T02:08:34Z.
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.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T05:30:21Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/tests/GuestSysmodule.cppL19-20, L39core/libs/prx/libSceSysmodule/CMakeLists.txtL8-9core/libs/tests/GuestSysmodule.cppL3, L10, L39Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T07:18:47Z.
Checked the diff,
guest_sysmoduleandguest_sysmodule_maps_scan(both pass; the new test pins equivalence with/proc/self/mapsfor code, stack, anonymous and unmapped addresses, with and withoutAPS5_NO_PROCMAP_QUERY). Returned start/end/path match the old scan. Merging once CI is green.Non-blocking: the
procmap_querystruct and the probe duplicateGuestMemory.cpp; worth sharing in a follow-up.Imported from boykopovar/AnyPS5. Originally posted by GustavoGamarra95 on 2026-10-12T00:18:43Z.
@adriadam10 Thanks for the review. The follow-up is done: #3454 moves the procmap_query struct and the probe into a shared header, and GuestMemory.cpp uses it now.
Imported from boykopovar/AnyPS5. Originally posted by GustavoGamarra95 on 2026-10-12T12:43:33Z.
Thanks for the review. The follow-up is done: #3454 moves the
procmap_querystruct and the probe into a shared header, and GuestMemory.cpp uses it now.