Commit Graph
1068 Commits
Author SHA1 Message Date
orezraeyandClaude Opus 5.5 7571085a39 Merge main into docs/libkernel-sem-timedwait-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 08:10:56 -03:00
Adrià fa515def85 Merge pull request #7653 from ionut27001/fix/libkernel-kevent-timer-readd
fix(libkernel): handle kevent timer re-adds and the AIO, LIO, SENDFILE and PROCDESC filters as measured on a PS5
2026-10-24 13:02:21 +02:00
Adrià 887a9640b4 Merge pull request #7605 from HQasper/fix/poll-kqueues
fix(libkernel): poll kqueues as kqueue_poll answers
2026-10-24 12:32:33 +02:00
orezraeyandClaude Opus 5.5 09048e3278 Merge main into fix/libkernel-socket-address-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 06:56:16 -03:00
JJenkxandClaude Opus 5.5 462f8dff1f fix(libkernel): skip unallocated pages in sceKernelReleaseDirectMemory
The unchecked release passed its whole range to ForgetDirectMemory,
which throws on any page that is not allocated, so releasing a range
that is partly or wholly free aborted the process. Release only the
allocated runs, as shadPS4's unchecked free does; the checked variant
still returns ENOENT for them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 05:54:17 -04:00
bluandClaude Opus 5.5 e040d1191b Merge branch 'boykopovar:main' into feat/libc-siginterrupt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 02:49:01 -07:00
Adrià f23ed4533d Merge pull request #8921 from xXPBSXx/docs/udp-disconnect-windows-bound-address
docs(debt): record what a Windows UDP socket keeps after connect(AF_UNSPEC)
2026-10-24 11:28:43 +02:00
Adrià bfb504fc78 Merge pull request #8533 from Retr0G28/docs/libkernel-dup-directory-debt
docs(debt): drop the Windows directory dup gap from libkernel
2026-10-24 11:25:49 +02:00
Adrià 6b4cf8c731 Merge pull request #8408 from thuanquang/docs/debt-amm-submit-queue
docs(libkernel): say that an AMM command buffer may run after its submission returns
2026-10-24 11:21:27 +02:00
Adrià FranchandClaude Sonnet 5.5 387f069744 chore(libkernel): drop code comments from the kqueue tests and move the timer debt line off the section end
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-24 11:13:43 +02:00
blawesom 681cfa1170 fix(libkernel): refuse a timer modify with fflags and pin the disabled timer's enable re-arm
- a timer change with EV_ADD unset and data 0 keeps the period; one that set
  fflags was silently ignored, where FreeBSD 11's kqueue_register copies it
  onto the note: it now throws with the other re-adds, waiting for the
  measured rules
- EV_ENABLE on a disabled timer reports the expiries missed while disabled in
  one step and keeps the note's phase, as FreeBSD 11's filt_timerexpire counts
  a disabled note and keeps its p_nexttime; TimerDisableEnableRearm pins it
  (5 serial runs and 3 rounds of 8 parallel copies pass)
- the next-wait abort from the review round was observed before main's
  5cbc46029b wait refactor and does not reproduce
2026-10-24 11:13:43 +02:00
Nawasfadili 29a6fc7169 fix(libkernel): retire an EV_ONESHOT note through its delete callback and follow Windows $Deleted paths
Carries the additive pieces of #6510 onto main after its feature was
superseded by #5847: the deleteEventFunc invocation when an EV_ONESHOT
note retires in CollectTriggered, the Windows $Deleted path detection
in FileEvent (IsDeleted transitions), the relaxed timer-modify and
SetVnodeNotes guards, and the compatible kevent tests.
2026-10-24 11:13:43 +02:00
Dean ce965ddb7b Merge pull request #9153 from orezraey/fix/libkernel-dmem-available-measured-ps5
fix(libkernel): match sceKernelAvailableDirectMemorySize arguments to PS5
2026-10-24 22:13:10 +13:00
954a8e1a9d fix(libkernel): append positioned writes on an O_APPEND descriptor on macOS
macOS pwrite and pwritev write at the given offset even when the
descriptor was opened with O_APPEND. FreeBSD's vn_write appends to an
O_APPEND regular file whatever the offset and leaves the file offset
unchanged, and Linux pwrite appends too. On macOS, sceKernelPwrite,
pwrite, sceKernelPwritev, pwritev and the AIO write commands now append
such writes with writev and restore the file offset, as #8359 does on
Windows.

Co-authored-by: Himansh Raj <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 05:34:28 -03:00
orezraeyandClaude Opus 5.5 22b120c185 Merge main into docs/libkernel-sem-timedwait-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 05:24:29 -03:00
Dean e058b3284a Merge pull request #9167 from slider/feat/libkernel-named-semaphores
feat(libkernel): implement named POSIX semaphores
2026-10-24 21:09:30 +13:00
ionut27001 27e37024a8 fix(libkernel): handle kevent timer re-adds and the AIO, LIO, SENDFILE and PROCDESC filters as measured on a PS5
In payload processes on a PS5 (firmware 12.70), re-adding an existing
periodic EVFILT_TIMER with EV_ADD, fflags 0 and a positive period kept
the armed expiry and the expirations already counted, and applied the
new period after that expiry, as FreeBSD 11.0 does. EV_ONESHOT in the
re-add left the timer periodic. Here such a re-add threw; it now does
the same. Re-adding a one-shot or disabled timer, a re-add with nonzero
fflags, a period of 0 or less, a period that overflows the armed expiry
or flags other than EV_ONESHOT, and the other changes to an existing
timer except EV_DELETE still throw.

There, EV_ADD failed with EPERM for EVFILT_AIO, EVFILT_LIO and
EVFILT_SENDFILE at every ident and flag set tried, and EV_DELETE and
EV_ENABLE of them without EV_ADD failed with ENOENT. EVFILT_PROCDESC
failed with EBADF on a descriptor that is not open and with EINVAL on
every kind of open descriptor tried, and EV_DELETE of it on a socket
failed with ENOENT. These filters threw here; they now answer the same
way. EV_ADD of EVFILT_PROCDESC fails with EINVAL on the kinds of
descriptor tried and on shared memory, and throws on other kinds and on
descriptors 0 to 2 that are not sockets or kqueues; a change without
EV_ADD fails with ENOENT, after the descriptor check for
EVFILT_PROCDESC.

A new kevent measurements debt entry, which the kqueue and kevent entry
points to, records these measurements and the answers for NOTE_LOWAT
marks and EVFILT_READ on another kqueue, which still throw here. The
kqueue and kevent entry also stops listing a NOTE_NSECONDS period above
one second with a fraction among the cases that throw, since d71a1c577
made it work.
2026-10-24 10:08:01 +02:00
Dean efe844c653 Merge pull request #10308 from orezraey/fix/libkernel-socket-receive-measured-ps5
fix(libkernel): answer zero-length datagram receives and recvmsg flags as measured on a PS5
2026-10-24 20:46:44 +13:00
orezraeyandClaude Opus 5.5 510b089120 Merge main into fix/libkernel-socket-address-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 04:39:32 -03:00
Dean 59052151d0 Merge pull request #8728 from orezraey/fix/libkernel-msync-measured-ps5
fix(libkernel): fail msync MS_INVALIDATE with EBUSY as measured on a PS5
2026-10-24 20:25:08 +13:00
Dean ec3ea2f558 Merge pull request #6586 from JJenkx/fix/linux-runtime-module-start
fix(loader): defer Linux runtime module starts until requested
2026-10-24 19:54:29 +13:00
Emanuele d93cdf402d fix(libkernel): defer raises while a thread holds the address-wait lock on Linux and macOS
On Linux and macOS, sceKernelRaiseException runs the guest handler in
the target's SIGUSR1 handler wherever the thread was interrupted. A
thread interrupted while it held the address-wait lock of
sceKernelSyncOnAddressWait, sceKernelSyncOnAddressWake or _umtx_op ran
the handler with the lock held, so a handler that waits, as a
stop-the-world collector's does, blocked every other thread that waits
on or wakes an address. #5756 fixed this on Windows.

The address-wait lock is now taken under DeliveryDeferral on every
host. On POSIX the deferral is a count per thread: while it is raised
the SIGUSR1 handler only records the signal, and DeliverDeferred sends
it to the thread again once the lock is released. An address waiter
waits on its own semaphore (sem_t, a dispatch semaphore on macOS) with
the lock released and the deferral lifted, so a raise reaches a thread
that waits for an address without a timeout.

The address-lock phases of guest_raise_exception now run on every
host, with a new phase that raises at a thread in an unbounded address
wait.
2026-10-24 08:40:37 +02:00
orezraeyandClaude Opus 5.5 698697cbc7 fix(libkernel): throw for an unmeasured unbalanced thread atexit decrement on a module
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 02:53:35 -03:00
orezraeyandClaude Opus 5.5 11df317b82 docs(libkernel): list SO_ACCEPTFILTER, option 0x10000 and the timestamp options in the socket debt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 02:49:38 -03:00
orezraeyandClaude Opus 5.5 711171a505 Merge fix/libkernel-tcp-options-measured-ps5 into fix/libkernel-socket-flags-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 02:49:29 -03:00
orezraeyandClaude Opus 5.5 8d4002884c docs(libkernel): mark the unmeasured TCP_MAXSEG bound and the AF_INET6 default
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 02:47:23 -03:00
orezraeyandClaude Opus 5.5 366c18439e docs(libSceNet): move the sceNetRecv truncation note to the libSceNet debt file
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 02:43:13 -03:00
orezraeyandClaude Opus 5.5 db9e8a846b fix(libkernel): ignore the sendto address of a connected stream socket
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 02:33:20 -03:00
orezraeyandClaude Opus 5.5 ee83082a10 docs(libkernel): mark the unmeasured zero-length receive cases and keep the libSceNet truncation note
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 02:27:12 -03:00
harisibrar1andClaude Opus 5.5 c7cd45c0da fix(libkernel): return EINTR from pselect when its mask unblocks a pending signal
FreeBSD's kern_pselect installs the mask and kern_select sleeps with
PCATCH, so a pending signal that the new mask unblocks makes the call
return EINTR once the descriptors have been scanned. Here the handler ran
inside the mask swap and select then waited the full timeout, or forever
with no timeout. The swap now reports whether a handler ran, and pselect
then scans the descriptors once without waiting: a ready descriptor, a
zero timeout or an invalid argument keep select's answer, and otherwise
the call fails with EINTR and leaves the descriptor sets unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 00:39:02 -04:00
orezraeyandClaude Opus 5.5 7902af7357 Merge main into fix/libkernel-socket-address-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 01:12:54 -03:00
orezraeyandClaude Opus 5.5 144319f82e Merge main into fix/libkernel-msync-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 01:10:30 -03:00
xXPBSXxandClaude Sonnet 5.5 33b6388820 docs(debt): record what a Windows UDP socket keeps after connect(AF_UNSPEC)
The connect-to-AF_UNSPEC debt entry only described Linux. On Windows a socket bound to an explicit address keeps it in the same way, getsockname reports the host address, and a sendto to a non-loopback address then fails with ENETUNREACH, where FreeBSD's udp_disconnect() resets the local address and the send succeeds.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-24 05:59:34 +02:00
Dean 83a25ceb71 Merge pull request #9105 from Retr0G28/fix/connect-port0-connected-dgram
fix(libkernel): disconnect a connected datagram socket on connect to port 0
2026-10-24 16:54:25 +13:00
Dean 68871895d4 Merge pull request #9256 from Dom3005/fix/windows-fcntl-append
fix(libkernel): change O_APPEND on a Windows file through fcntl
2026-10-24 16:37:06 +13:00
frankea fabe448517 fix(libkernel): report the host zone's standard offset and daylight saving amount from sceKernelGettimezone
sceKernelGettimezone wrote {0, 0} for every zone. A PS5 on firmware
13.40 set to US Eastern returned tz_minuteswest -300 and tz_dsttime 60:
the standard offset in minutes east of UTC, without the summer time in
effect on the run date, and the zone's daylight saving amount in
minutes. Both now come from the host zone, through the same HostZoneAt
and HostDaylightAmount the calendar conversions use.

guest_freebsd_clocks checks five TZ settings (UTC0, IST-5:30, BRT+3,
EST5EDT, CET-1CEST) and the null pointer.
2026-10-23 23:27:29 -04:00
orezraeyandClaude Opus 5.5 3633e09abb Merge main into fix/libkernel-posix-thread-attr-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 23:44:53 -03:00
orezraeyandClaude Opus 5.5 f91cf205cf Merge main into fix/libkernel-sync-on-address-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 23:40:48 -03:00
Dean Galvin c7e2611b6d Merge main into fix/cancellable-timed-sleeps 2026-10-24 15:38:58 +13:00
Dean 379b1dca32 Merge pull request #9164 from MaxLikesCode/fix/kernel-sema-einval
fix(libkernel): return EINVAL for the semaphore arguments the console rejects
2026-10-24 15:28:17 +13:00
Dean 43d6937041 Merge pull request #10246 from orezraey/fix/libkernel-pthread-create-detach-measured-ps5
fix(libkernel): refuse long thread names and answer a detach after a join as measured on a PS5
2026-10-24 15:26:04 +13:00
Dean 6fc058f5cf Merge pull request #10302 from orezraey/fix/libkernel-socket-buffers-measured-ps5
fix(libkernel): keep socket buffer sizes and SO_NBIO as measured on a PS5
2026-10-24 15:25:05 +13:00
Dom3005andClaude Opus 5.5 dd6220698a fix(libkernel): change O_APPEND on a Windows file through fcntl
fcntl(F_SETFL) threw when it changed O_APPEND on a Windows file. The
guest flag already chooses WriteAtEnd, but a descriptor opened with
O_APPEND also carries the CRT's append flag, so _write kept appending
after the guest cleared it. F_SETFL now replaces the CRT descriptor of
every descriptor sharing the open file's status with a duplicate handle
opened with or without _O_APPEND, as libc fdopen does for append mode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 02:28:14 +02:00
Dean d8b73e3644 Merge pull request #9273 from DavidSamir/feat/libkernel-sys-pselect
feat(libkernel): implement pselect over select
2026-10-24 12:53:12 +13:00
orezraeyandClaude Opus 5.5 9402457fb7 Merge fix/libkernel-multicast-membership-measured-ps5 into fix/libkernel-socket-receive-flags-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 20:50:51 -03:00
Retr0 68db53d7a5 fix(libkernel): fail sendfile with EINVAL for a file that is not a regular file 2026-10-24 02:44:14 +03:00
MaxandClaude Opus 5.5 3ddaa64707 fix(libkernel): return EINVAL for the semaphore arguments the console rejects
The prosper console oracle measured SCE_KERNEL_ERROR_EINVAL for creating
a semaphore with an initial count above the maximum, a maximum of 0, a
negative initial count or a null name, for polling 0 or more than the
maximum, and for signalling 0. These threw, or polled past the maximum
returned EBUSY, and signalling 0 succeeded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 01:18:34 +02:00
orezraeyandClaude Opus 5.5 60135e8855 Merge main into fix/libkernel-aio-limits-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 20:06:53 -03:00
Dean ca7bf033c5 Merge pull request #9005 from JJenkx/fix/libkernel-sema-null-esrch
fix(libkernel): return ESRCH for a null semaphore handle
2026-10-24 11:58:20 +13:00
Dean 85f2f2d478 Merge pull request #8544 from Retr0G28/fix/fcntl-getfl-pipe-rdwr
fix(libkernel): report O_RDWR from F_GETFL on both ends of a pipe
2026-10-24 11:55:31 +13:00