Repository navigation
fix(libkernel): return ENOENT for thirteen sysctl names, as measured on a PS5 - #7541
Conversation
|
I'm preparing a separate PR for measured kern.rng_pseudo MIB {1,50} support and its sysctlnametomib mapping. The overlap checker flags nearby insertion points in SystemConfiguration.cpp and GuestSystemConfiguration.cpp; the behavior is separate, but rebasing may need small conflict resolutions. Which PR should land first, or are you comfortable with this one landing first? |
|
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.
|
|
I opened #7556 for the four additional numeric MIBs in your probe logs: it returns |
|
Update: the separate |
|
Thanks for picking these up. Either order is fine with me; whichever lands second resolves the conflict in |
|
Windows run. Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), Windows 11 26300, WinLibs GCC 15.2.0 r7, Release,
AI-assisted |
827b578 to
3fac97b
Compare
jotitadev
left a comment
There was a problem hiding this comment.
Linux run, since the description and the existing run are Windows only.
Machine: Linux x86_64, i7-8700, Ubuntu 26.04, GCC 15.2, Release, BUILD_TESTING=ON, full build.
Head 3fac97bf6 merged onto main 84c1a4d9a (clean merge).
guest_system_configurationpasses.GuestSystemConfiguration.cpponly, onmain: aborts withsysctlbyname_nid_postfix: unsupported name hw.byteorder, so the test covers the new names.- Non-GPU suite (
ctest -E "^agc|gpu|vulkan|video_out"): 739/739, same asmain.
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
3fac97b to
ff8e19c
Compare
ff8e19c to
5e65f31
Compare
…on a PS5 In a payload process on a PS5 (firmware 12.70), sysctlbyname returns -1 with ENOENT for thirteen names that threw here, and leaves the buffer and the length alone, for a read, a size query, a null length and a null buffer with a null length. sysctl does the same for the fixed MIBs of seven of them. sysctlnametomib gives those seven MIBs and returns ENOENT for hw.cacheline_size and hw.usermem, which threw too. machdep.cacheline_size already returned ENOENT and is now tested with the others. A write to the new names and MIBs throws, as the console's answer to a write was not tried. The hw.realmem and vm.overcommit debt entries now say that a payload process gets ENOENT for them as well. AI-assisted: yes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5e65f31 to
dfa96f1
Compare
|
Rebased onto current |
What
sysctlbynamenow answers thirteen names the way the console answers a payload process on a PS5 (firmware 12.70), where it threwunsupported name.sysctldoes the same for seven of their MIBs, andsysctlnametomibfor nine of the names; the other four names still throw insysctlnametomib.mainbefore this PRsysctlbynameforhw.byteorder,hw.cacheline_size,hw.machine_arch,hw.usermem,kern.clockrate,kern.maxfiles,kern.maxfilesperproc,kern.maxproc,kern.ps_strings,kern.sched.name,kern.smp.maxcpus,kern.stackprot,kern.timecounter.hardwareENOENT, buffer and length untouched. Same for a read, a size query, a null length, and a null buffer with a null lengthsysctlfor {1, 6}, {1, 7}, {1, 12}, {1, 27}, {1, 32}, {6, 4}, {6, 11}sysctlnametomibfor the seven names with those MIBserrnois kept (measured forkern.maxproc,kern.ps_strings,hw.byteorder); a short count copies part of the MIB and returnsENOMEM(measured forkern.maxproc,hw.byteorder)sysctlnametomibforhw.cacheline_size,hw.usermemENOENT, count and the first three MIB words untouchedmachdep.cacheline_sizeENOENTWrites: a write to the new names and MIBs throws. The probes never write a sysctl, so the console's answer to a write is not known.
machdep.cacheline_sizekeeps returningENOENTfor a write, as onmain.Changes in
docs/dev/debt/libkernel.md:machdep.cacheline_sizeentry now covers all fourteen names. It lists what is still not modelled: four of the names, whose MIBs the console numbers just below 2^31 (2147482814 to 2147483182), and all other names, which still throw.hw.realmemandvm.overcommitentries said the console's values were not known. They now say that a payload process on a PS5 (firmware 12.70) getsENOENTforhw.physmem,hw.realmemandvm.overcommit, and for {6, 5} and {6, 12}.dolphin_libretrocore, PS5MC PPSA99420 through mimalloc), so changing them is left for a separate PR.How the console was measured
resolvelines show that itssysctlbyname,sysctlandsysctlnametomibare the oneslibkernel_sys.sprxexports; p10 and p13 resolve some of them the same way, and p24 prints no resolve lines. All probes link these functions the same way.0xAA(p16, p24). Lengths were preset to 64 for a read and 77 for a size query (p16); p24 passes null lengths. MIB arrays were prefilled with0xAAbytes (p13, p16, p24).last_changedis one past the last byte that changed.Console output (excerpt, lines copied unchanged)
The
pNN:prefix names the probe; the rest of each line is copied unchanged.The other names and MIBs give the same lines. All of them are in the logs.
Overlaps:
GuestSystemConfiguration.cpp, so whichever lands second only has to change the path when rebasing.main6e27fc8 conflicted with it inSystemConfiguration.cpp, where itsSystemStringsloop sat at the same place insysctlbyname_nid_postfix; the resolution keeps both blocks, feat(libkernel): answer the uname sysctl names #6220's loop first (the names do not overlap).sysconfdebt line next to thehw.realmemline; whichever lands second keeps both edits.sysctlbyname_nid_postfix,GuestSystemConfiguration.cppand the debt line abovesysconf. The two merge cleanly in either order.ENOENTfromsysctlfor the four MIBs this PR's debt entry lists as still throwing, and fix(libkernel): support kern.rng_pseudo MIB access #7554 addskern.rng_pseudotosysctlnametomib; both editSystemConfiguration.cppat the same places as this PR, so whichever lands second keeps both blocks. After fix(libkernel): return ENOENT for measured absent sysctl MIBs #7556, the debt clause "heresysctlnametomibandsysctlthrow for them" becomes "heresysctlnametomibthrows for them".kern.proc.vmmap) has landed. The rebase ontomain1e774a3 conflicted with it inSystemConfiguration.cppand in the debt file, where its entries sit next to this PR's blocks; the resolution keeps both, feat(libkernel): report the guest address-space map through kern.proc.vmmap #7070's first.Tested
Build: Windows 11 x86-64, full build with WinLibs MinGW-w64 GCC 15.2.0 (posix-seh, ucrt, r7) and
-DBUILD_TESTING=ON.Rebase (not re-tested): after #6833 landed, this branch was rebased onto
mainbbb4546. The only conflict was indocs/dev/debt/libkernel.md, where #6833 changed thesysconfline next to this PR'shw.realmemandvm.overcommitlines; the resolution keeps #6833'ssysconfline and this PR's two lines. The code and test changes are the same as before the rebase, and the tests above were not run again on the new base.Tests: with this branch on top of
main9f25d0b,guest_system_configurationand the otherguest_*tests pass: 464 of 465 pass andguest_video_out_wqhd_detection_no_vulkanis skipped on this machine. In the parallel run (ctest -j 6),guest_video_out_wqhd_detection,guest_pthread_rwlockandguest_pthread_second_jointimed out once and passed when rerun. The branch was then rebased ontomain5bf2e13 without conflicts, since upstream changed none of its code or test files, andguest_system_configurationpasses there too.Old code, new test: with
SystemConfiguration.cppreverted tomainand the new test kept,guest_system_configurationaborts.Rebase onto
main6e27fc8: after #6220 landed, the branch was rebased ontomain6e27fc8, resolving theSystemConfiguration.cppconflict with #6220 described under Overlaps; the other files merged without conflicts. With this branch and #7543's branch built in one tree on thatmain, theguest_*tests pass: 473 of 474, andguest_video_out_wqhd_detection_no_vulkanis skipped on this machine. That is the second of two full runs; the first, right after the build, timed out in four tests this PR does not touch (guest_message_destructor_unshared-decoy,guest_video_out_cursor,guest_app_info,guest_pthread_rwlock).guest_system_configurationalso passed 3 runs in a row. WithSystemConfiguration.cppreverted to thatmainand the new test kept,guest_system_configurationaborts withsysctlbyname_nid_postfix: unsupported name hw.byteorder. The branch merges cleanly withmain3259e4c.Console: behaviour measured on a PS5 (firmware 12.70), as described above.
Not tested here: Linux (a reviewer reported a Linux run in the comments), and no title.
Checklist
Based on current
main; no other open PR implements the same functionsOne topic per PR; follow-ups go in a new PR
No comments in code except technical debt
Unimplemented paths throw (
NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt fileNo notes, investigation
.mdfiles or images added to the repository (attach them to this PR)New third-party code is a submodule built from source
Generic behaviour, not specific to one title
Rebase: rebased onto
main1e774a3. feat(libkernel): report the guest address-space map through kern.proc.vmmap #7070 has landed since the last rebase (kern.proc.vmmap), so the rebase conflicted inSystemConfiguration.cpp, where itsGuestVmEntriesblock and this PR'sIsUnansweredMibandIsUnansweredNameblocks sit at the same place; the resolution keeps both, feat(libkernel): report the guest address-space map through kern.proc.vmmap #7070's first. It also conflicted indocs/dev/debt/libkernel.md, where feat(libkernel): report the guest address-space map through kern.proc.vmmap #7070'skern.proc.vmmapentry and this PR'ssysctl names a PS5 payload process gets ENOENT forentry sit together; both are kept, andmachdep.cacheline_sizestays folded into this PR's entry as before the rebase. The code and test changes are otherwise the same as before the rebase. Re-tested on the new base: full build with WinLibs GCC 15.2.0 (Windows 11), exit 0;guest_system_configurationpassed twice (1.29 s, 0.06 s); withSystemConfiguration.cpprestored frommainthe test aborts withsysctlbyname_nid_postfix: unsupported name hw.byteorder.Depends on: none
Fixes: none
Unblocks: none
GPUs tested: n/a
AI-assisted: yes
🤖 Generated with Claude Code