Repository navigation
fix(libkernel): report machdep.tsc_freq from sysctlbyname - #5387
Closed
milescoviello wants to merge 1 commit into
Closed
milescoviello wants to merge 1 commit into
milescoviello wants to merge 1 commit into
Conversation
PS5SX2 (PPSA99203) reads machdep.tsc_freq at start-up, and main
throws "sysctlbyname_nid_postfix: unsupported name machdep.tsc_freq",
which ends the title before its first frame.
FreeBSD 11.4 defines the name in sys/x86/x86/tsc.c as an unsigned
64-bit value:
SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq, CTLTYPE_U64 | CTLFLAG_RW,
0, 0, sysctl_machdep_tsc_freq, "QU", "Time Stamp Counter frequency");
sysctlbyname now answers it with the frequency sceKernelGetTscFrequency
already measures, through the same CopyOut as kern.sdk_version: a size
query reports 8 bytes, a short buffer gets the partial copy and ENOMEM,
and a write returns EPERM, as an unprivileged write to a sysctl does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 13, 2026
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
10 tasks done
Contributor
Author
|
Closing as a duplicate of #4776, which makes the same change and was opened first. I posted the PS5SX2 (PPSA99203) title evidence there. 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
PS5SX2 (PPSA99203, from the homebrew catalog) reads
machdep.tsc_freqwithsysctlbynameat start-up. Onmainthat name throws, which ends the title before its first frame:FreeBSD 11.4 defines the name in
sys/x86/x86/tsc.cas an unsigned 64-bit value:sysctlbynamenow answers it with the frequencysceKernelGetTscFrequencyalready measures. It goes through the sameCopyOutaskern.sdk_version:ENOMEM.EPERM, as an unprivileged write to a sysctl does.guest_system_configurationgainsCheckTscFrequencySysctl, covering those three cases and that the value equalssceKernelGetTscFrequency(). The libkernel debt file records that the value is the host's measured frequency; the console's value is not checked.Tested
Ubuntu 24.04, GCC 13.3 (CI's compiler), Release with CI's configure flags, on
main18c438b, RTX 4070 Ti (NVIDIA 580.142):main'sSystemConfiguration.cppand the new test,guest_system_configurationaborts; with the change it passes 20/20.guest_*tests pass in two runs.eboot.binunwrapped from its fSELF and relinked with--to-intel --trap-sdk-syscall-stubs, see Relinker: seven catalog homebrew titles stop on raw FreeBSD syscall stubs from the ps5-payload-dev SDK libc #2136):main's libraries it stops at 0 s with the lines above.tools/check_conventions.py --base upstream/mainpasses.Not checked on a console.
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