feat(libkernel_sys): implement sceKernelIsCEX, sceKernelIsDevKit, get_authinfo and sceKernelGetOpenPsIdForSystem #10524
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10524"
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 YossiYad on 2026-10-24T07:57:06Z.
What
Four libkernel_sys exports threw. They now describe a retail console running the guest:
sceKernelIsCEXreturns 1 andsceKernelIsDevKit0, as shadPS4's process.cpp does with its devkit option off.get_authinfo(pid, info)follows shadPS4's kernel.cpp: -1 withEPERMfor a null result, -1 withESRCHfor a process other than 0 or the guest's own pid, otherwise the 0x88-byte structure cleared except the first capability word,0x2000000000000000. fpPS4 gives the same 0x88-byte size.sceKernelGetOpenPsIdForSystemreturns positive 22 for null, following the firmware 13.42 module report, and otherwise returnssceKernelGetOpenPsId's value. The module reads a separate sysctl, whose value is not known here.The stubs leave
Export.Discovery.cpp; the implementations sit inExport.cppafterumask, away from the end of the file where other open PRs append and from the spot beforeforkwhere #10421 addsis_in_sandbox.Not measured on a PS5.
Tested
Current validation (2026-10-25): rebased onto main
16ff208dc3; rebuilt and passed all 14guest_kernel_systests on Bazzite 44, including null system-ID and unchanged-output regressions. Conventions pass against upstream/main.Linux (Fedora 44, GCC, Ninja,
-DBUILD_TESTING=ON), based onmain1e20650e84, rebased on5d3ab7791dafterwards (every commit builds, thekernel_systests pass):guest_kernel_sys_console_identity(core/libs/tests/GuestKernelSysConsoleIdentity.cpp): the console kind;get_authinfoerrno for a null result and for another pid, with the result left alone; for pid 0 and the guest pid the authority ID, the capability word, the cleared remainder and nothing written past 0x88 bytes; both OpenPSID queries agree and the system one writes 16 bytes. Dropping the pid check and moving the capability bit to the next word each made it fail.cteston a merge of this branch with the other four from the same day (camera, NpParty, SharePlay, libkernel_sys): 2021 of 2024 pass. The 3 failures,application_heap_scripting,application_heap_lazyandagc_driver_tessellation, fail the same way onmainon this machine and do not use these exports. Tests that need the GPU skipped themselves.tools/progress.py --compare: libraries +0.03%, 4 functions implemented, none lost.tools/check_conventions.py --base upstream/mainpasses.tools/pr_overlap.py: no open PR implements these four. Several open libkernel_sys PRs (#9156, #9160, #9161, #9187, #9284, #9293, #9297, #9302, #9693) conflict withmainand could not be compared by the tool; none of them names these exports.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T11:12:06Z.
Review: APPROVED
Reviewed the exact PR implementation and the focused console-identity tests. The output struct has the asserted 0x88-byte layout;
get_authinfochecks null and pid before writing, uses guest errno values, and the test verifies sentinel preservation on errors plus the exact cleared/capability fields on success. The PS4 emulator sources support the behavior, but this is not PS5-measured and the PR records that limit. The reported Linux test/conventions checks pass; hosted build jobs are skipped.