feat(libkernel): implement sceKernelEnableDmemAliasing #4326
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4326"
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 winstrex on 2026-10-12T06:13:05Z.
What
ProsperoEden (PPSA99008, 1.000.110 from the homebrew catalog, an Eden Switch emulator port) does not load on
maind146ec1b6:usHTMoFoBTMissceKernelEnableDmemAliasing, the title's only absent import (tools/import_audit.py: 437 implemented, 5 throwing stubs, this one absent). ProsperoEden's public source calls it before mapping the same direct memory a second time:host_memory.cpp#L164-L167, its fast-memory window;memory_pages.cpp#L159-L163, a read-only alias of JIT code that it then makes executable;memory_pages.cpp#L339-L340, sparse tables whose slots all map one zeroed block.It ignores the result ("Reports zero regardless; the self-test checks") and checks the mappings instead.
The function takes no arguments and returns
int, as in shadPS4 and ProsperoEden's declaration (memory_pages.cpp#L35). shadPS4 sets a flag that lifts theEBUSYitsMapMemoryreturns for direct memory that is already mapped. AnyPS5 has no such check:DoMapDirectonly requires the physical pages to be allocated, andCheckDirectMemoryFollowsPhysicalPagesalready maps the same pages twice. So there is nothing to turn on, and the function returns 0. It is listed under Silent stubs in TechnicalDebt.md becausecheck_conventions.pyrequires every export that only returns 0 to be listed there, but it does not hide missing behaviour: the aliasing it enables is always allowed in AnyPS5, and what differs from shadPS4, theEBUSYwithout the call, is a restriction rather than a feature (unverified on PS5).The test calls it in
CheckDirectMemoryFollowsPhysicalPagesjust before that test's second mapping of the same pages; without the export,guest_memory_testsdoes not link.Tested
mainb42ef24e0:guest_memory_testspasses; with the export removed it fails to link (undefined reference tosceKernelEnableDmemAliasing).749541f65): run 38209311400,linuxandwindows(build and full ctest) plus the relinker, register-context and write-watch jobs all pass.maine013f8c9cplus this change:--trap-sdk-syscall-stubs(#3804), which traps 3 SDK syscall wrappers. Under gdb no SIGILL is raised before the stop below, so none of them runs, and none of the 5 throwing stubs is called.EDEN_SPARSE_TABLES available=1 step=ok(the aliased sparse tables work) and reaches its launcher about 2.7 s after start (opening the launcher, GL 4.6 onPS5 AGC).AGC graphics: subgroup capability 61 is unsupported for shader stage 1: llvmpipe offers no vertex-stage subgroups, the device limit #1565 handles in the AGC tests, not a failure of 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 (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T06:14:11Z.
Progress report (
2ccbd37→749541f)➖ System libraries: 86.55% (+0.0%, +1 implemented functions)
✅ 1 implemented
sceKernelEnableDmemAliasing⚪ 1 behaviourally empty (constant return or throw)
sceKernelEnableDmemAliasingImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T10:03:28Z.
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)docs/dev/TechnicalDebt.mdL15-51