Commit Graph
1004 Commits
Author SHA1 Message Date
Dean Galvin bc87535cb0 docs(dev): name retail titles by ID instead of by title
Debt entries name the titles they were measured on. Use the title ID, or "a retail title" where the sentence needs no identification. No technical content changes.
2026-10-21 17:34:40 +13:00
bluandClaude Fable 5.1 0900ff6ff0 feat(libc): implement siginterrupt through the sigaction libkernel registers
siginterrupt is a libSceLibcInternal export (the public SDK's stub table has it there, not in the
kernel tables) and FreeBSD 11.4's lib/libc/gen/siginterrupt.c reads the signal's disposition,
sets or clears the signal's bit in _sigintr and SA_RESTART, and installs the disposition again.
libc cannot call libkernel, so, as the pthread hooks do, libc keeps a registered sigaction and
the address of the _sigintr set, and libkernel registers both from a static initializer when it
loads. A call before that throws; the set is written without libkernel's registration lock, as
FreeBSD's libc does. Builds on #8866, which adds the set.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-20 20:53:14 -07:00
bluandClaude Fable 5.1 e38179eaab feat(libkernel): export _sigintr and let signal honour it
The public SDK's libkernel, libkernel_sys and libkernel_web stub tables declare _sigintr, the
sigset_t that FreeBSD's libc shares between signal and siginterrupt, and no built library
provided it (#8846). libkernel now exports the 16-byte object, zero at start, and signal records
a handler with SA_RESTART unless its signal is in the set, as lib/libc/gen/signal.c does.

siginterrupt, which fills the set, is a libSceLibcInternal export; libc does not link libkernel
and cannot reach the dispositions, so it stays out and a debt entry for signal says so.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-20 20:41:54 -07:00
Kraken aae12fa111 feat(libkernel): implement cfsetspeed 2026-10-21 04:00:42 +01:00
Dean cd700fe9ec Merge pull request #8793 from xXPBSXx/fix/pthread-kill-ended-thread-esrch
fix(libkernel): let pthread_kill with signal 0 report ESRCH for a thread that has ended
2026-10-21 15:27:29 +13:00
frankea 78926e215c Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into ps5-measured-1340
# Conflicts:
#	docs/dev/debt/libSceVideoOut.md
2026-10-20 22:01:26 -04:00
Dean a806c69bfe Merge pull request #8758 from p3n1cillin/codex/pthread-getprio-20261021
feat(libkernel): implement pthread_getprio
2026-10-21 14:27:54 +13:00
Dean c5d841ed94 Merge pull request #8732 from DoubleAAGuy/feat/libkernel-osreldate-sysctl
feat(libkernel): expose kern.osreldate sysctl
2026-10-21 14:27:39 +13:00
Dean 8a803d3e6d Merge pull request #8743 from valenciana-nc/fix/kernel-iovec-table-copy
fix(libkernel): return EFAULT for unreadable iovec tables
2026-10-21 14:24:39 +13:00
xXPBSXxandClaude Sonnet 5.5 79569a7a3d fix(libkernel): let pthread_kill with signal 0 report ESRCH for a thread that has ended
pthread_kill(thread, 0) returned 0 for every handle other than the caller's before it asked whether the thread was still alive. FreeBSD's _pthread_kill looks the thread up with _thr_find_thread before it checks for signal 0, so the call answers ESRCH for a thread that has ended or was never a thread. The liveness check now runs before the signal 0 shortcut; the calling thread still answers 0.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-21 02:29:54 +02:00
Dean f41c5bef2b Merge pull request #8637 from billythemenace2/fix/kernel-raise-system-call-wait
fix(libkernel): keep waiting while a raise target is inside a system call
2026-10-21 13:11:08 +13:00
orezraeyandClaude Opus 5.5 973234db6e Merge main into fix/libkernel-sync-on-address-measured-ps5
Keep main's WaitOnKey helpers from #8304 and build the measured
sceKernelSyncOnAddressWait results on them: the wait's ready check now
records whether the value differed, and Wake returns the waiters woken.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 20:45:03 -03:00
p3nicillin 5a79dda21d feat(libkernel): implement pthread_getprio 2026-10-21 00:08:30 +01:00
valenciana-nc 23c43725f6 fix(libkernel): copy guest iovec tables before vector transfers 2026-10-20 17:04:30 -06:00
Dean 61d0fa5b3c Merge pull request #8304 from Aryansh1520/feat/libkernel-umtx-ops-sync
feat(libkernel): implement _umtx_op UMTX_OP_SEM_WAIT and UMTX_OP_SEM_WAKE
2026-10-21 11:50:34 +13:00
orezraeyandClaude Opus 5.5 692cb4af09 fix(libkernel): fail msync MS_INVALIDATE with EBUSY as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 19:32:46 -03:00
Hermes Agent 0273c1479f feat(libkernel): expose kern.osreldate sysctl 2026-10-20 18:29:40 -04:00
orezraeyandClaude Opus 5.5 bcc5960d84 fix(libkernel): follow sceKernelSyncOnAddressWait and Wake as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 19:28:38 -03:00
Danigamer05 3f8f81e175 fix(libkernel): clamp Windows birth time when setting earlier timestamps 2026-10-20 21:42:41 +02:00
billythemenace2andClaude Opus 5.5 681926e085 fix(libkernel): keep waiting while a raise target is inside a system call
Since #8512 a raise redirects a target running host code once 50 ms have
passed since the raise began. A target inside a system call that is not a
wait, such as the NtWriteFile of an fwrite that holds its stream lock, can
stay there longer; the redirect then ran the handler with the lock held.
SONIC SUPERSTARS froze at frame 67 again on main this way, with its GC
raise delivered at ntdll!ZwWriteFile+20.

A target stopped right after a syscall instruction in ntdll now restarts
the 50 ms host-code window, so the raise keeps sampling until the call
returns and the target leaves host code, bounded by the 1 s retry limit.
guest_raise_in_system_call holds a writer in NtWriteFile on a slowly
drained pipe; it times out on main and passes with this change.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-20 20:35:36 +01:00
David a131bddbab Merge branch 'main' into feat/libkernel-jit-shared-memory-macos 2026-10-20 23:35:11 +04:00
Dean c70524a3db Merge pull request #8596 from ebarr24/ws/libkernel-kevent-note-lowat-above-1-on-e
fix(libkernel): fire EVFILT_WRITE on a socket once free send space reaches NOTE_LOWAT
2026-10-21 08:27:05 +13:00
Dean b7596be595 Merge pull request #6658 from nicolasabosch/perf/gpu-wake-sleeps
perf(libkernel): end short sleeps when the GPU or a flip completes
2026-10-21 07:55:28 +13:00
Dean 352dbe751a Merge pull request #8583 from Ondra97/codex/fix-pthread-attr-policy
fix(libkernel): report current thread scheduling policy in attributes
2026-10-21 07:14:27 +13:00
frankea 39e467915e Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into ps5-measured-1340
# Conflicts:
#	core/libs/prx/libScePad/Export.cpp
#	core/libs/prx/libScePad/src/PadState.cpp
#	core/libs/prx/libSceVideoOut/src/PadInput.cpp
#	core/libs/tests/GuestPad.cpp
2026-10-20 13:34:08 -04:00
Ethan Barr 084dcf8736 fix(libkernel): fire EVFILT_WRITE on a socket once free send space reaches NOTE_LOWAT
kevent threw NotImplemented for EVFILT_WRITE with NOTE_LOWAT above 1 on a socket, although the socket readiness check already reports free send-buffer space (SO_SNDBUF less SIOCOUTQ on Linux). The write event now fires once that space reaches the mark, as FreeBSD 11's filt_sowrite compares sbspace with kn_sdata, and stays silent while the space is below it. The debt entry no longer says a write mark is limited to 1. Reference: https://github.com/freebsd/freebsd-src/blob/release/11.0.0/sys/kern/uipc_socket.c
2026-10-20 13:32:17 -04:00
Nicolas Abosch f857616caa Merge remote-tracking branch 'origin/main' into perf/gpu-wake-sleeps
# Conflicts:
#	core/libs/prx/libSceAgcDriver/Execution/src/Driver/EntryPoints.cpp
#	core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
2026-10-20 14:29:10 -03:00
Dean ae12a951f5 Merge pull request #8114 from savvaniss/feat/declare-ps4-hasbro-imports
feat(libs): declare sceGameLiveStreamingEnableLiveStreaming and sceKernelPrintBacktraceWithModuleInfo
2026-10-21 06:19:07 +13:00
Ondra97 ad1650686c docs(libkernel): keep unmeasured policy query behavior concise 2026-10-20 19:18:49 +02:00
Ondra97 2f2fd0f7a4 docs(libkernel): keep attribute query limits with attribute debt 2026-10-20 19:08:27 +02:00
Ondra97 07486d7cfa fix(libkernel): report current thread scheduling policy in attributes 2026-10-20 19:05:08 +02:00
Dean 83751168dd Merge pull request #8202 from babyhuey/feat/libkernel-open-event-flag
feat(libkernel): implement sceKernelOpenEventFlag
2026-10-21 05:59:15 +13:00
xXPBSXxandClaude Sonnet 5.5 8977922244 fix(libkernel): drop undefined protection bits in mprotect
FreeBSD 11.4 kern_mprotect masks the argument with VM_PROT_ALL instead of
refusing it (sys/vm/vm_mmap.c:613). sceKernelMprotect already does this
since #5770; the POSIX mprotect export still failed with EINVAL.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-20 18:51:41 +02:00
David 39f3c79b7d Merge branch 'main' into feat/libkernel-jit-shared-memory-macos 2026-10-20 20:17:32 +04:00
Adrià 10e2cbf648 Merge pull request #7541 from ionut27001/fix/libkernel-sysctl-absent-names
fix(libkernel): return ENOENT for thirteen sysctl names, as measured on a PS5
2026-10-20 18:13:19 +02:00
Retr0 2d1fa5aea5 fix(libkernel): report O_RDWR from F_GETFL on both ends of a pipe
FreeBSD 11's kern_pipe opens both ends with FREAD | FWRITE, so F_GETFL
reports O_RDWR on each. The host pipe ends are one-way, so the access
mode came back as O_RDONLY and O_WRONLY. Descriptors made by pipe() are
now marked in the guest descriptor table, the mark follows dup, dup2 and
F_DUPFD, and F_GETFL reports O_RDWR for them.
2026-10-20 19:04:22 +03:00
Adrià 4036fab1b2 Merge pull request #7437 from lucaslima430/fix/libkernel-socket-fcntl-duplication
fix(libkernel): support socket fcntl duplication
2026-10-20 17:40:06 +02:00
bluandClaude Opus 5.5 0ecef87c4c fix(libkernel): answer Windows reparse points that are not links
lstat and readlink threw NotImplemented for every Windows reparse point
other than a symbolic link or a drive junction. A tag without the name
surrogate bit (cloud files, deduplication) does not stand for another path,
so lstat now answers as stat does and readlink returns EINVAL, as FreeBSD
does for a file that is not a link and as CPython's os.lstat and os.readlink
do (bpo-37834). A name surrogate that is neither a symbolic link nor a
junction (a mounted volume, a WSL link) is reported as the reparse point
itself with the mode of its attributes, and readlink returns EINVAL.

The tests set reparse tags with FSCTL_SET_REPARSE_POINT, one without the
name surrogate bit and one with it. A compact /exe (WOF) file cannot serve
as the fixture: on Windows 11 24H2 the WOF filter hides the reparse point
from GetFileAttributesW and FileAttributeTagInfo alike. Windows refuses
every open of an unhandled tag without FILE_FLAG_OPEN_REPARSE_POINT, so the
test requires lstat to agree with stat rather than to succeed.

mashingaan's boykopovar/AnyPS5#6447 returned EINVAL for other reparse
points without the tag check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-20 08:21:33 -07:00
Federico Marras 5f6c30547e Merge remote-tracking branch 'upstream/main' into feat/kqueue-read-on-kqueue
# Conflicts:
#	docs/dev/debt/libkernel.md
2026-10-20 17:18:22 +02:00
Retr0 4e2ee895d2 docs(debt): drop the Windows directory dup gap from libkernel
d3011ae11 made dup and dup2 of a Windows directory descriptor share
its DirectoryState, as FreeBSD's kern_dup shares the open file, and
removed the clause; a later merge of the entry brought it back.
GuestDirectoryRewind covers both calls.
2026-10-20 18:15:30 +03:00
Adrià 1e1a19bf48 Merge pull request #7075 from AlexOfTheForest/feat/kevent-pipe-write
feat(libkernel): support EVFILT_WRITE on the write end of a pipe
2026-10-20 17:15:03 +02:00
elieh999 bb396009e0 fix(libkernel): store the process resource limit 2026-10-20 18:01:27 +03:00
xXPBSXxandClaude Sonnet 5.5 0bb7b02e9f fix(libkernel): answer a bound IPv4 datagram send to port 0 without the host
Linux's udp_sendmsg refuses port 0 with EINVAL, so a send that FreeBSD
accepts (the socket is bound to a specific address and port and the
destination is not INADDR_ANY or INADDR_BROADCAST) failed there. Nothing can
receive on port 0, so the call now returns the length itself on every host.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-20 16:56:47 +02:00
Federico Marras 6ead14f9e8 feat(libkernel): watch a kqueue with EVFILT_READ 2026-10-20 16:56:06 +02:00
xXPBSXxandClaude Sonnet 5.5 aec1f2c012 fix(libkernel): fail sendto to port 0 from an unbound IPv4 datagram socket with EADDRNOTAVAIL
udp_output hands the destination to in_pcbconnect_setup unless the socket is
bound to a specific address and port and the destination is neither
INADDR_ANY nor INADDR_BROADCAST, and in_pcbconnect_setup fails port 0 with
EADDRNOTAVAIL. The send went to the host, which accepted it. sendto, and
sendmsg through it, now fails the same way for an AF_INET datagram socket
that is not connected. connect to port 0 already did.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-20 16:54:21 +02:00
frankea 73bc20e93d Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into ps5-measured-1340
# Conflicts:
#	docs/dev/debt/libSceAgcDriver.md
2026-10-20 09:21:31 -04:00
xXPBSXxandClaude Sonnet 5.5 26f861dd27 feat(libkernel): accept MSG_WAITALL in recv, recvfrom and recvmsg on a stream socket
soreceive_generic keeps a MSG_WAITALL receive on a stream socket waiting until
the buffer is full, the peer closes or an error occurs. The three calls failed
every flag but MSG_PEEK and MSG_DONTWAIT with EOPNOTSUPP. A stream socket now
passes the flag to the host receive; a datagram socket ignores it, as a record
is delivered whole.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-20 15:12:33 +02:00
Dean 44e3389c88 Merge pull request #7807 from mazen320/fix/windows-stderr-dup2
fix(libkernel): keep host stderr off a guest dup2 onto descriptor 2
2026-10-21 01:45:30 +13:00
thuanquangandClaude b8beb80e54 docs(libkernel): say that an AMM command buffer may run after its submission returns
Co-Authored-By: Claude <[email protected]>
2026-10-20 19:27:33 +07:00
ionut27001andClaude Opus 5.5 dfa96f1fe6 fix(libkernel): return ENOENT for thirteen sysctl names, as measured 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 <[email protected]>
2026-10-20 13:46:29 +02:00