test(libkernel): cover the SCE sceKernelMlock and sceKernelMunlock next to their POSIX twins #11577
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11577"
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 milescoviello on 2026-10-26T21:04:27Z.
What
GuestMlock.cppcheckedmlockandmunlockbut not the SCE exports with the same page logic. Next to the POSIX overflow checks, the SCE pair now returnsSCE_KERNEL_ERROR_EINVAL(0x80020016) for a range that wraps past the top of the address space, 0 for a zero length, and 0 for an unaligned one-page lock and unlock of the mapped range.Until now no test called it.
Changed:
core/libs/tests/GuestMlock.cpp. Test only, no change to the library.Tested
Linux (Ubuntu 26.04, GCC 15.2), Release:
cmake --build build --target guest_mlock_testsandctest -R '^guest_mlock$' --repeat until-fail:3pass on this branch, which is currentmainplus the test.tools/check_conventions.py --base upstream/mainpasses.guest_mlockpasses 3 of 3 at this head (379d9d6615) and on its basemaine61a7c7e24.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T22:18:25Z.
Review: APPROVED
The added assertions exercise the SCE exports’ overflow error mapping, zero-length success, and an unaligned page-length lock/unlock request. (Because the implementation rounds the address range to page boundaries, the
bytes + 1request can cover two pages.) I manually checked #11042’s overlap warning: it removesmlockallexpectations at other lines, not this SCE test block. The author reports three passing Linux runs and conventions; hosted eligibility, conventions, intake and labels pass. Product jobs are skipped by path policy. I did not rerun the test locally.Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-28T12:36:00Z.
Review: APPROVED
Reviewed
379d9d661570891c401fcb5beea44d2ea091828f— approve. The SCE memory-lock wrappers are checked for overflowing ranges, zero length and unaligned valid ranges alongside the existing POSIX cases. SCE error codes remain distinct from errno-style returns.Windows/GCC 15.3 Release native validation from pinned sources: head: 1 passed, 0 skipped;
guest_mlock; author base was source-compared: production sources are unchanged; its runtime was not built or executed for this review. This changes test coverage, not production behavior, so an old-production failure is not required. The build reuses matching dependency source pins and the existing FFmpeg package; no full product or game execution is claimed.