Repository navigation
fix(libkernel): fail _umtx_op operation 1 with EOPNOTSUPP as measured on a PS5 - #7842
Merged
oneandonlydean merged 1 commit intoOct 19, 2026
Conversation
… on a PS5 Operation 1 threw as unverified, so a title whose call_once path reaches it stopped. In a payload process on a PS5 (firmware 12.70) operations 0 and 1 fail with EOPNOTSUPP and leave the word unchanged for every word tried, as FreeBSD 11's __umtx_op_unimpl does. Answer operation 1 like operation 0.
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
fogydes
approved these changes
Oct 19, 2026
fogydes
left a comment
Contributor
There was a problem hiding this comment.
Built and verified locally on Windows 11 with WinLibs MinGW-w64 GCC 15.2.0, Release (-DBUILD_TESTING=ON):
- Target
guest_umtx_op_testsbuilds cleanly with Ninja. ctest --test-dir build-libs -R "guest_umtx_op" --output-on-failure:guest_umtx_op: Passed (0.94s)
- Hardware probe evidence on a PS5 (firmware 12.70) validates that uncontended
_umtx_opoperation 1 fails withEOPNOTSUPPrather than throwing, and that the word value is preserved. - Diff in
core/libs/prx/libkernel/SyncOnAddress/src/SyncOnAddress.cppis minimal (+2 / −3 lines), replacing the artificial exception throw withGUEST_EOPNOTSUPPwhenoperation <= UMTX_OP_RESERVED1. docs/dev/debt/libkernel.mdupdated cleanly with hardware measurements.- Zero code comments added;
tools/check_conventions.py --base origin/mainpasses with 0 findings.
Ready to merge.
AI-assisted: yes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
_umtx_opoperation 1 threwNotImplementedas unverified, so a title whosecall_oncepath reaches it stops; the debt entry names PPSA12544'slibc.prxand Unity'sPS5Util.prx(PPSA18194) as callers that wait for a runningcall_oncewith it.Measured in a payload process on a PS5 (firmware 12.70; payload SDK v0.44, clang 18.1.8), calling
_umtx_opresolved fromlibkernel_sys.sprx: for operations 0 and 1 the object is a word of the probe's own andvalthe calling thread's id fromscePthreadGetthreadid; the semaphore operations get ausemorusem2of the probe's own,val0, and for the waits a 100 ms relativetimespecwith size argument 16 (probep78_libkernel, source and log attached: p78-umtx-ops.zip; lines quoted unchanged with ap78:prefix):Operation 1 fails with
EOPNOTSUPP(45) and leaves the word unchanged whether it holds 0, the calling thread's id, that id with bit 63 set or another value, and operation 0 does the same for a word of 0, with a null time argument and with a 100 mstimespec. That is FreeBSD 11's__umtx_op_unimpl, which the operation table assigns to operations 0 and 1. The change answers operation 1 like operation 0 (error = GUEST_EOPNOTSUPP), with no other operation touched.guest_umtx_opnow requiresEOPNOTSUPPand an unchanged word from operations 0 and 1 for the words 0, 123456 and 123456 with bit 63 set, withval123456, instead of a throw from operation 1; operation 0 was measured only with a word of 0, and the test's expectation for the other two words rests on__umtx_op_unimplignoring the word.The same run also answered the semaphore operations, which still throw here and are recorded in the debt entry without a code change:
UMTX_OP_SEM_WAIT(19) returned 0 for a count of 1 and set_has_waiters, andETIMEDOUTfor a count of 0 with a 100 ms relative timeout, andUMTX_OP_SEM_WAKE(20) returned 0 without a waiter, the answers FreeBSD 11'sdo_sem_waitanddo_sem_wakegive when built underCOMPAT_FREEBSD9orCOMPAT_FREEBSD10;UMTX_OP_SEM2_WAIT(23) returned 0 for a count of 1, leaving the count 1, as FreeBSD 11'sdo_sem2_waitdoes, and 0 (notETIMEDOUT) for a count of 0 with the same timeout, leaving the count 0, where FreeBSD 11 would setUSEM_HAS_WAITERSand time out. The log ends before the result line ofUMTX_OP_SEM2_WAKE(24) without a waiter: within the runner's 120 s the process printed nothing more and no crash line (the probe's guard reports SIGSEGV, SIGBUS, SIGILL and SIGFPE), so whether that call blocked or the process ended another way was not determined, and operations 27, 100 and -1 were not measured in this run.Not measured: what
libc.prxorPS5Util.prxdo afterEOPNOTSUPPfrom operation 1 (no title was run), a contended operation 0 or 1, and a game process.Overlaps:
tools/pr_overlap.pyreports no open PR that changes the same lines or exports; it could not compare 23 PRs that conflict withmainand share a file with this branch: #2528 (SyncOnAddress.cpp), #6044 (GuestUmtxOp.cpp) and, for the libkernel debt file, #5021, #6149, #6446, #6469, #6519, #6825, #6908, #6936, #6977, #7039, #7049, #7075, #7088, #7105, #7121, #7129, #7149, #7192, #7299, #7332 and #7509. #2528 does not touch the operation switch, #6044 only moves the test file, and none of the 21 changes the_umtx_opentry. No open PR implements_umtx_opoperation 1 (the closed #6447 answered it withEOPNOTSUPPwithout a measurement).Tested
Windows 11 Pro 10.0.26300, WinLibs MinGW-w64 GCC 15.2.0 r7 (posix, UCRT), Ninja, Release,
-DBUILD_TESTING=ON, branch built and tested onmain83bf557, then rebased on 36f60df (six pull requests merged since, 16 files: AGC driver, Videodec2, libc file and heap code, the relinker and shader recompiler, and the libc and Videodec2 debt files; none touchesSyncOnAddress.cpp,GuestUmtxOp.cppor the libkernel debt file);guest_umtx_oprebuilt and rerun after the rebase, passed.guest_umtx_oppasses with the change (four runs, including the one after the rebase).SyncOnAddress.cppfrommainand the new test kept,guest_umtx_opaborts with "unhandled exception 'St13runtime_error' ... what(): _umtx_op operation 1 not implemented"; restored, it passes.guest_sync_on_address,guest_once,guest_execute_once,guest_std_execute_once,guest_cond_timedwait,guest_pthread_mutex_errorsandguest_umtx_op: 7 of 7 pass with the change.python tools/check_conventions.py --base origin/mainpasses.p78_libkernelbuilt with the payload SDK v0.44 and clang 18.1.8 (-target x86_64-sie-ps5), launched once through the payload manager; the log in the attachment ends at operation 24 with no further output within the runner's 120 s.Not tested: Linux (the change is one branch of a
switchwith no host-specific code), PPSA12544 and PPSA18194.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)