Commit Graph
2586 Commits
Author SHA1 Message Date
Adrià bcee950a9c Merge pull request #12467 from Buraddomoon/fix/udp-disconnect-local-address
fix(libkernel): clear reported local address after UDP disconnect
2026-10-30 10:18:49 +01:00
Adrià e4f5516fd6 Merge pull request #12974 from MarcZX10/feat/host-game-mode
feat(libkernel): opt-in host game mode request (APS5_GAME_MODE)
2026-10-30 06:36:04 +01:00
Adrià 0a2cda921d Merge pull request #12933 from heditrigui/feat/libc-dprintf
feat(libc): implement dprintf and vdprintf
2026-10-30 06:33:00 +01:00
Adrià 5ba6b2b917 Merge pull request #12963 from JJenkx/windows/libkernel-raise-pending-until-resume
fix(libkernel): keep sceKernelRaiseException pending on a suspended thread on Windows
2026-10-30 06:32:05 +01:00
Adrià 8f21dd5a6a Merge pull request #12897 from AdnanKhan-ak47/fix/libkernel-thread-exit-signal-mask
fix(libkernel): leave other threads' signal masks alone when a thread exits through scePthreadExit
2026-10-30 06:30:49 +01:00
Adrià ad9001f9d2 Merge pull request #12865 from heditrigui/feat/libkernel-posix-madvise
feat(libkernel): implement posix_madvise
2026-10-30 05:52:23 +01:00
Adrià 0c9c5db748 Merge pull request #12690 from MarcZX10/feat/host-system-report
feat(agc): host system report and an actionable missing-Vulkan-feature message
2026-10-30 02:52:18 +01:00
Adrià 87d938c650 Merge pull request #12556 from babyhuey/fix/sched-efault
fix(libkernel): return EFAULT from rtprio_thread and sched_rr_get_interval for a bad pointer
2026-10-30 02:32:23 +01:00
Adrià 2485cdefa3 Merge pull request #12538 from babyhuey/fix/utimes-efault
fix(libkernel): return EFAULT from the utimes family for an unreadable times array
2026-10-30 02:31:43 +01:00
Adrià ec709cede3 Merge pull request #12436 from milescoviello/fix/vm-loadavg
fix(libkernel): answer vm.loadavg with the host's load averages
2026-10-30 02:31:30 +01:00
Adrià 365f857609 Merge pull request #12427 from simnJS/feat/kernel-is-neo-mode
feat(libkernel_sys): answer sceKernelIsNeoMode from the param.sfo Neo-mode attribute
2026-10-30 02:30:27 +01:00
Adrià 28b490ea5c Merge pull request #12296 from JJenkx/windows/kernel-shm-mmap-checks
fix(libkernel): map Windows shared memory with the regular file checks
2026-10-30 02:04:04 +01:00
Adrià f9a8813b11 Merge pull request #12179 from p3n1cillin/claude/kernel-executable-module-handle
feat(libkernel): add sceKernelGetExecutableModuleHandle
2026-10-30 02:01:01 +01:00
Adrià 4725feb152 Merge pull request #11431 from p3n1cillin/claude/pthread-getaffinity-set-size
fix(libkernel): answer pthread_getaffinity_np for the console's 8- and 16-byte sets
2026-10-30 01:20:44 +01:00
Adrià 96613bba67 Merge pull request #12060 from Ragbie/fix/windows-directory-flock
fix(libkernel): lock directories with flock on Windows as FreeBSD does
2026-10-30 01:04:03 +01:00
Adrià 438cebf361 Merge pull request #10544 from maximilianfv/fix/libkernel-macos-datagram-disconnect
fix(libkernel): count a dissolved datagram association as disconnected on macOS
2026-10-30 01:03:08 +01:00
Adrià 5a3c1a2f81 Merge pull request #10627 from maximilianfv/fix/libkernel-dlerror-long-messages
fix(libkernel): keep dlerror messages whole
2026-10-30 01:02:55 +01:00
Adrià 83861d9909 Merge pull request #12068 from dantdmdarealguy/fix/relinker-cli-off-test-registrations
fix(build): skip the core/libs relinker CLI tests when ANYPS5_RELINKER_CLI is OFF
2026-10-30 00:28:20 +01:00
Adrià 788e5531a1 Merge pull request #12163 from slopgobblercobbler/fix/libkernel-windows-descriptor-socket-classification
fix(libkernel): classify guest sockets on Windows and align errno parity
2026-10-29 23:46:12 +01:00
Adrià d820fef182 Merge pull request #12503 from babyhuey/fix/kevent-efault
fix(libkernel): return EFAULT from kevent for an unreadable changelist or timeout or an unwritable eventlist
2026-10-29 22:49:08 +01:00
Adrià cfbca30026 Merge pull request #12206 from XairRrR/fix/libkernel-tsc-time-scale
fix(libkernel): scale the reported TSC frequency under APS5_TIME_SCALE
2026-10-29 21:20:59 +01:00
Adrià 1aff97d3c8 Merge pull request #12093 from dantdmdarealguy/fix/kqueue-windows-snapshot-times
fix(libkernel): read a watched file's times again after its size on Windows
2026-10-29 21:20:39 +01:00
Adrià 184afa49ad Merge pull request #12563 from babyhuey/fix/setrlimit-efault
fix(libkernel): return EFAULT from setrlimit for an unreadable limit
2026-10-29 20:35:45 +01:00
Adrià 43332e5f3b Merge pull request #11865 from ionut27001/fix/libkernel-sched-own-pid
fix(libkernel): sched_getparam reads out-of-range priorities, sched_setparam EPERM outside 256-767, own pid on the main thread
2026-10-29 20:34:52 +01:00
MarcZX10 79fb3bae75 fix(libkernel): link the host performance session test with the host test helper on MinGW
host_performance_session_tests uses no guest library, so the guest unwind helper leaves the C++ runtime unlinked on MinGW and the link fails with an undefined __gxx_personality_v0. The host test helper links the runtime statically, as the other host-only tests do.
2026-10-29 18:49:17 +00:00
JJenkxandClaude Opus 5.5 db14f7a49d fix(libkernel): keep sceKernelRaiseException pending on a suspended thread on Windows
On Windows, sceKernelRaiseException threw for a thread created suspended
and not resumed yet. FreeBSD libthr starts such a thread with signals
blocked and restores its mask on resume, so the signal stays pending and
is delivered on that thread once it runs.

The raise is now recorded in the thread's pendingException with a
compare-exchange, and the thread exchanges it for -1 when it leaves the
creation wait and delivers it to itself before its start routine. Both
sides use one atomic, so a raise racing a resume is either taken by the
thread or, after it started, delivered as for a running thread. Raises
while pending are merged, as for a standard signal.

guest_pthread_create_suspended now runs the deferred-delivery case on
every host, with a second raise while the thread is suspended.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 13:39:50 -04:00
MarcZX10 05fe8ad592 feat(libkernel): start the host performance session when libkernel loads
Read APS5_GAME_MODE once at load, the same point where the Windows build
raises the scheduler tick, so an invalid value stops the title at start
with an error that names the variable and an unset one changes nothing.
2026-10-29 17:14:43 +00:00
MarcZX10 ad28df623d test(libkernel): check that exits release the process session and the environment is validated
Run the process session in a test executable linked with libc and leave
through LibcExit and LibcExitWithoutHandlers: the backend is released once
in both. Check that a refused request is never released, that off never
reaches the backend, that a second session is refused, that an unset
APS5_GAME_MODE is accepted and that APS5_GAME_MODE=bogus is rejected with
an error naming the variable.
2026-10-29 17:14:38 +00:00
MarcZX10 63cb5fbd00 feat(libkernel): start the host performance session for the process
Add CreateHostBackend (the GameMode client on Linux, the activity backend
on macOS, a backend that reports itself unavailable elsewhere),
StartProcessSession, which owns the one session of the process and
releases it from the libc shutdown callbacks that every exit path runs,
and StartFromEnvironment, which reads APS5_GAME_MODE and does nothing at
all when it is unset, empty or off. Build the files into libkernel; the
session is not started yet.
2026-10-29 17:14:12 +00:00
MarcZX10 65fb3b5a0c test(libkernel): run the macOS activity backend against a fake Objective-C runtime
Build four fixture libraries that export objc_getClass, sel_registerName,
objc_msgSend and the autorelease pool functions (complete, without
NSProcessInfo, returning no activity, without pool functions) and drive
the backend through them on any POSIX host. Check the exact message
sequence (begin with the user-initiated and latency-critical options,
retain, end, release), balanced pools on every path, a held activity ended
by the destructor, and unavailable and refused results.
2026-10-29 17:13:04 +00:00
MarcZX10 07c3fec103 feat(libkernel): add a macOS activity backend over the Objective-C runtime
macOS throttles timers and background work of a process unless it holds an
NSProcessInfo activity (Apple, Foundation, NSProcessInfo
beginActivityWithOptions:reason:, with NSActivityUserInitiated and
NSActivityLatencyCritical, which asks for the highest timer and I/O
precision available). The tree has no Objective-C sources, so call the
runtime from C++: load libobjc and Foundation with dlopen, look up
objc_getClass, sel_registerName, objc_msgSend and the autorelease pool
functions, begin one activity, retain its token, and end and release it on
End. Both library paths are injectable, and any missing piece is reported
as unavailable. Nothing uses the backend yet.
2026-10-29 17:12:09 +00:00
MarcZX10 72bec771a0 test(libkernel): run the GameMode client against fixture libraries
Build three tiny shared libraries that export the real_gamemode_* symbols
(complete, without real_gamemode_request_end, without
real_gamemode_error_string) and drive the client through them, so no
daemon is needed. Check a missing library, a fall back to the second
library name, request and release once each, a refusal with the library's
reason, a failing release, a missing symbol and a session over the client.
2026-10-29 17:11:33 +00:00
MarcZX10 1a4e30f7fb feat(libkernel): add a GameMode client backend that loads libgamemode at run time
Linux hosts running Feral's gamemoded switch the CPU governor and scheduler
for a registered game. The client the project ships is a header that loads
libgamemode.so.0 (then libgamemode.so) with dlopen and binds the library's
real_gamemode_request_start, real_gamemode_request_end and
real_gamemode_error_string symbols (FeralInteractive/gamemode at
a74b8106a2236d1f2696aa44c93bc4c8ef13b42e, lib/gamemode_client.h).

Do the same here with the library name list injectable: a missing library
or symbol is reported as unavailable, a failing request as refused, nothing
is linked, and the request is ended only when it was made. Nothing uses the
backend yet.
2026-10-29 17:10:52 +00:00
MarcZX10 140f7bb3ba feat(libkernel): parse the APS5_GAME_MODE setting
Accept off, on and auto, treat an unset or empty value as off so the
default stays as it is today, and reject anything else with an error that
names the variable and the accepted values.
2026-10-29 17:10:24 +00:00
MarcZX10 65fb8d72b5 test(libkernel): cover the host performance session with a fake backend
Check that off never reaches the backend, that start and stop reach it
once each and cannot restart a stopped session, that an unavailable
backend is silent in auto and logged once in on, that a refusal is logged
once in both modes, that throwing backends are contained, and that
concurrent starts reach the backend once.
2026-10-29 17:10:12 +00:00
MarcZX10 55587fef6c feat(libkernel): add a host performance session behind an injectable backend
A title that runs for hours would like the host to treat it as a game
(Feral GameMode on Linux, a latency-critical activity on macOS), but no
code owns that request. Add IBackend, the interface a host mechanism
implements, and Session, the state machine that requests once, releases
once, contains every backend failure and logs it once. Nothing uses it
yet.
2026-10-29 17:10:12 +00:00
Hedi Trigui 3dfc973fb8 fix(libc): address review feedback on vdprintf guest write path, short writes, ABI and test coverage 2026-10-29 17:30:21 +01:00
MarcZX10 3a74ce471c feat(libkernel): export the host CPU probe to other libraries through extern C helpers
The patched libkernel does not hand its plain C++ functions to the other patched libraries: every cross-library call in the tree goes through an extern C helper with a _nid suffix. The host CPU probe had none, so a library that wants the CPU model or the missing feature list cannot reach it. These helpers return plain structs, as the application metadata helpers do.
2026-10-29 14:20:35 +00:00
Adrià 01f4e342d5 Merge pull request #12525 from babyhuey/fix/pselect-efault
fix(libkernel): return EFAULT from pselect for an unreadable timeout or signal mask
2026-10-29 14:59:14 +01:00
Adrià 9036e3c9e4 Merge pull request #12126 from morten-holm/fix/macos-host-stack-above-arena
fix(libkernel): move the macOS main stack out of the guest arena
2026-10-29 14:51:57 +01:00
Adrià a12a2fcfc4 Merge pull request #12462 from babyhuey/fix/poll-efault
fix(libkernel): return EFAULT from poll for an unreadable or unwritable descriptor array
2026-10-29 14:39:55 +01:00
Adrià cba260828e Merge pull request #11864 from ionut27001/fix/libkernel-get-app-info-layout
fix(libkernel): fill 0x58-byte sceKernelGetAppInfo record, throw for other pids
2026-10-29 14:33:12 +01:00
Hedi Trigui 59c9c7cfac fix(libkernel): validate posix_madvise address against user-map minimum and add regression tests 2026-10-29 14:32:53 +01:00
Hedi Trigui bbb4d05d42 feat(libkernel): implement posix_madvise 2026-10-29 14:14:36 +01:00
Adrià efc24518bc Merge pull request #11862 from ionut27001/fix/libkernel-setrlimit-store-limits
fix(libkernel): store setrlimit RLIMIT_CORE soft limit, ignore raised DATA/STACK hard limits
2026-10-29 13:47:57 +01:00
JJenkxandClaude Opus 5.5 dc1d801c4c fix(libkernel): map Windows shared memory with the regular file checks
On Windows, mmap sent a shared memory descriptor straight to the shared
file mapper, skipping the checks and the private path that a regular
file descriptor takes. A private mapping of a named or anonymous object
then failed with EOPNOTSUPP, and a writable shared mapping of a
read-only descriptor failed with EIO instead of EACCES. Shared memory
objects are files on Windows, so they now take the same access checks
and the same private copy as a regular file; only the directory, device
and file-type refusals stay limited to other descriptors.

guest_named_shm_windows_mapping covers shared mappings through two
descriptors, pread and pwrite against them, an offset mapping, a private
mapping, read-only mappings and the mappings after shm_unlink.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 08:47:28 -04:00
p3nicillinandClaude Opus 5.5 7c97d68937 fix(libkernel): throw for every set size the console was not measured with
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 12:18:00 +00:00
p3nicillinandClaude Opus 5.5 b4861eb197 fix(libkernel): answer pthread_getaffinity_np for the console's set sizes
PS5_PayloadSDK measured in a title (firmware 12.09) that
pthread_getaffinity_np answers sets of 8 and 16 bytes and returns ERANGE
for 32 bytes or more, so FreeBSD's 32-byte cpuset_t is refused. The call
accepted exactly 32 bytes and refused every other size. Sizes under 8
keep ERANGE; 17 to 31 bytes, between the measured sizes, throw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 12:18:00 +00:00
p3nicillinandClaude Opus 5.5 4cf7411a46 feat(libkernel): add sceKernelGetExecutableModuleHandle
Return the main program's handle, the first one sceKernelGetModuleList
lists and one sceKernelGetModuleInfo accepts. reSOT (PPSA99023) imports
it from libkernel and passes the handle to sceKernelGetModuleInfo to find
its own code segment; before this its eboot failed to load on the
unresolved import.

The PS5 3.20 export lists have it in libkernel as well as libkernel_sys,
and on Windows a libkernel import never reaches libkernel_sys, so the
throwing libkernel_sys stub moves to libkernel as pselect did.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 12:17:59 +00:00
Adrià 5454cd2e45 Merge pull request #11130 from imellag/perf/macos-mimalloc
feat(libs): let relinked macOS games opt into mimalloc
2026-10-29 12:58:23 +01:00