Repository navigation
feat(libkernel): handle sysctl queries for pathname, physmem and cacheline size - #3779
Conversation
Implementation Details & Expedited Testing RequestHi @adriadam10, @MarcZX100, @blawesom, This PR addresses the startup crashes in XPSemu (PPSA97358) and PS5MC (PPSA99420) as reported in #3722:
Could you please run expedited maintainer testing for XPSemu and PS5MC with this PR? Thank you! |
|
Rebased on current main (only a TechnicalDebt adjacency conflict with the Notes: the design and wording match the fix branch @screamm posted in #3722 ( |
354f242 to
931aaa2
Compare
What
This pull request implements missing
sysctlandsysctlbynamehardware and process queries inlibkernel:kern.proc.pathname(MIB{1, 14, 12, pid}):/app0/eboot.binfor pid -1 and the calling process (getpid()), matching FreeBSD 11.4sys/kern/kern_proc.csysctl_kern_proc_pathnameand the sandbox filesystem layout.ESRCH(3) for any other pid.EINVAL(22) when invoked viasysctlbynameor when the MIB does not have exactly one pid argument (nameLength != 4).qemu_initqueries{CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1}).machdep.cacheline_size:ENOENT(2), matching FreeBSD amd64 where this powerpc-specific sysctl OID is not defined. Leaves the caller buffer untouched so XPSemu falls back cleanly to its built-in CPU cacheline default.mainonwhat(): sysctlbyname_nid_postfix: unsupported name machdep.cacheline_size).hw.physmem(name and MIB{6, 5}):sysconf(_SC_PHYS_PAGES) * 0x4000), matching FreeBSDkern_mib.c.oldValue.ENOMEM(12) for short buffers.EPERM(1) whennewValue != nullptron read-only sysctl variables.std::runtime_error.guest_system_configurationtesting length probes, exact buffer queries, short buffer rejections (ENOMEM), write rejections (EPERM), PID matching,ESRCHfor foreign pids,EINVALfor invalid MIB lengths, andmachdep.cacheline_sizeENOENT.Resolves #3722.
cc @adriadam10 @MarcZX100 @blawesom - kindly requesting expedited review and maintainer testing for XPSemu and PS5MC.
Tested
python tools/check_conventions.py --base origin/main(100% pass, zero errors).git diff --check.guest_system_configurationunit tests pass.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)