Commit Graph
178 Commits
Author SHA1 Message Date
Adrià FranchandClaude 970ff0c795 fix(libkernel): keep sem_timedwait debt entry on its own line, include <algorithm>/<cctype> in the kqueue test
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-14 22:43:43 +02:00
Rujul Talekar e9d367776d fix(libkernel): name the failing vnode watch in the kqueue notification error
The Windows error for a refused FindFirstChangeNotification was one string shared
by WatchParent and WatchContents, so the log could not tell which handle or path
was denied. Build it from the watcher, the path the API was given and
GetLastError instead.

Still throws: the EVFILT_VNODE attach path is vfs_kqfilter, which returns only
EINVAL, ENOMEM or 0, with EBADF from fget before it, and consults no directory
permission, so no FreeBSD errno stands for a host that refuses to notify.
2026-10-14 22:43:39 +02:00
Adrià 4b11b97ebb Merge pull request #5096 from sguckiran/main
fix(libkernel): convert local time with the host time zone
2026-10-14 21:38:24 +02:00
Adrià b0a4753de1 Merge pull request #5230 from hugodearaujo/fix/inherit-creator-priority
fix(libkernel): give an inheriting thread its creator's priority
2026-10-14 21:07:30 +02:00
Adrià 9811e9d4b7 Merge pull request #5218 from YossiYad/fix/guest-arena-mapping-hint
fix(libkernel): fall back below a mapping hint with no room above it
2026-10-14 21:05:23 +02:00
Adrià 066442c961 Merge pull request #5143 from xXPBSXx/fix/mprotect-unmapped-einval-v2
fix(libkernel): fail sceKernelMprotect over an unmapped range with EINVAL instead of aborting
2026-10-14 21:05:05 +02:00
Adrià 5922a728c6 Merge pull request #5020 from xXPBSXx/fix/socket-fd-flags
fix(libkernel): answer F_GETFD and F_SETFD on a guest socket
2026-10-14 21:03:19 +02:00
Adrià 16d7ad035c Merge pull request #4933 from nicolasfalesy/fix/libkernel-poll-scenet-sockets
fix(libkernel): poll libSceNet sockets with the host wait
2026-10-14 21:02:57 +02:00
Adrià e27ff7c545 Merge pull request #5819 from GitamarT045T3R/fix/windows-lstat-symbolic-links
feat(libkernel): report relative symbolic links in lstat on Windows
2026-10-14 20:44:09 +02:00
Dean bebff8b0e8 Merge pull request #3295 from SynnZer0/fix/libkernel-close-host-streams
fix(libkernel): keep host standard streams open on guest close
2026-10-15 07:38:36 +13:00
Dean ed835aa76f Merge pull request #5756 from oneandonlydean/fix/raise-address-lock-1488
fix(libkernel): defer raises while a thread holds the address-wait lock on Windows
2026-10-15 07:01:27 +13:00
Nicolas FalesyandClaude Opus 5.5 62d8eeae76 fix(libkernel): poll libSceNet sockets with the host wait
With libSceNet sockets on ordinary descriptor numbers (#4391), poll on a
libSceNet socket threw "neither a socket nor a pipe": poll only knew
libkernel sockets and pipes, while select already asks libSceNet through
its poller. libSceNet now lends libkernel the host socket behind a
descriptor, together with an owner that keeps it open, so poll puts it in
the same WSAPoll or poll call as libkernel sockets. ProsperoLight
(PPSA99002) stopped here on Linux and now reaches its PC list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EvDbpwUPTa78oCAJqe7m9K
2026-10-14 19:56:10 +02:00
xXPBSXxandClaude Sonnet 5.5 84aa2349f8 fix(libkernel): answer F_GETFD and F_SETFD on a guest socket
fcntl on a guest socket handled F_GETFL and F_SETFL only and failed every other command with EINVAL, so libcurl's fcntl(fd, F_SETFD, FD_CLOEXEC) on a new socket failed (ProsperoRadio PPSA99001, traced by screamm on #4796). Record FD_CLOEXEC per socket descriptor: F_SETFD sets or clears it, F_GETFD reads it, SOCK_CLOEXEC sets it at creation, and dup, dup2 and close start without it, as FreeBSD's kern_fcntl and kern_dup do.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 19:28:40 +02:00
Adrià b60e0bc0a5 Merge pull request #4676 from milescoviello/fix/socket-msg-dontwait
fix(libkernel): accept MSG_DONTWAIT in the socket send and receive calls
2026-10-14 19:13:53 +02:00
Itamar Medyoni 52a3b15796 feat(libkernel): report relative symbolic links in lstat on Windows
lstat of a Windows symbolic link threw, although symlink creates links
with relative targets on Windows and readlink reads them. Report such a
link as S_IFLNK with its own identity and times and the length of its
target as st_size, through the reparse reader readlink already used,
now shared from libkernel. Links with absolute targets, junctions and
other reparse points still throw, as for readlink.
2026-10-14 18:55:31 +02:00
SynnZer0andClaude Opus 5.5 8029428497 fix(libkernel): keep host standard streams open on guest close
Guest descriptors are host C runtime descriptors. Closing descriptor 0, 1
or 2 closed the host process's standard stream, and the runtime then gave
that number to the next file opened anywhere in the process, including
files libkernel opens itself, such as the APR reader's. The title's next
close of the same number closed that file mid-read.

close and sceKernelClose now fail with EBADF for descriptors 0 to 2 that
were open when libkernel loaded, and leave them open. A standard
descriptor that was not open at load can still be opened and closed by
the guest.

PPSA21703 calls sceKernelClose(0) repeatedly while loading asset
bundles, which made APR reads return 0 or a part of the requested bytes
and raised UCRT invalid parameter reports from close.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:46:42 +02:00
Yossi Yadgar aca7a3a46d docs(debt): note the fallback of mapping hints with no room above them 2026-10-14 17:41:40 +03:00
Adrià 5adefa6f89 Merge pull request #5643 from Amirtheshwaran/feat/libkernel-mincore
feat(libkernel): implement mincore
2026-10-14 16:25:54 +02:00
Adrià 8488fa7274 Merge pull request #5749 from OleksandrS23/feat/macos-file-event
feat(libkernel): EVFILT_VNODE on macOS through the host kqueue
2026-10-14 16:08:18 +02:00
Adrià eb59c7642e Merge pull request #5666 from Kurenaiiiii/feat/libkernel-sigsuspend
feat(libkernel): implement sigsuspend on the pending-signal set
2026-10-14 16:04:55 +02:00
Adrià 1b55ee4ab3 Merge pull request #5610 from Dripl1x/codex/feat-libkernel-fixed-anonymous-mmap
feat(libkernel): support fixed anonymous mmap
2026-10-14 14:52:53 +02:00
Adrià 24f58e534a Merge pull request #5605 from babyhuey/feat/libkernel-soc-power
feat(libkernel): export sceKernelGetSocPowerConsumption
2026-10-14 14:51:36 +02:00
Adrià 4e0cb18d1e Merge pull request #5545 from Nixitov/feat/setpriority
feat(libkernel): implement setpriority
2026-10-14 14:46:16 +02:00
Adrià a628765e58 Merge pull request #5053 from YossiYad/feat/libkernel-mmap-regular-files
feat(libkernel): map regular files with mmap on Linux
2026-10-14 14:41:32 +02:00
Adrià FranchandClaude 2854d51352 fix(libkernel): follow kern_mincore order and report reserved pages as not resident
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-14 14:40:12 +02:00
Amirtheshwaran Navaneethakrishnan 3699eff904 fix(libkernel): round mincore address down as FreeBSD does
Follow FreeBSD 11's sys_mincore by rounding unaligned address down to page boundary rather than returning EINVAL. Update guest memory test and document unmodeled residency/referenced/modified bits in libkernel technical debt.
2026-10-14 14:40:08 +02:00
Amirtheshwaran Navaneethakrishnan 7781eda113 feat(libkernel): implement mincore
Implement mincore (+hFjyohmOU0) in libkernel following FreeBSD 11's sys_mincore (sys/vm/vm_mmap.c). Validate page alignment, return EFAULT for null vector, check range bounds and residency via sceKernelVirtualQuery, and report MINCORE_INCORE (1) for resident pages. Required by Java 25 LAN / DNS (PPSA99869).
2026-10-14 14:40:08 +02:00
Adrià 9a3e2ac4da Merge pull request #5187 from p3n1cillin/claude/getrlimit-nofile
feat(libkernel): report RLIMIT_NOFILE through getrlimit
2026-10-14 14:27:42 +02:00
Adrià aa6b757662 Merge pull request #4725 from akkadbakkad89/feat/kernel-page-table-stats
feat(libkernel): count committed ranges in sceKernelGetPageTableStats
2026-10-14 12:56:24 +02:00
Dean Galvin 52813787cf fix(libkernel): defer raises while a thread holds the address-wait lock on Windows 2026-10-14 23:03:06 +13:00
Oleksandr SierovandClaude Opus 5.5 84bb450d48 feat(libkernel): EVFILT_VNODE on macOS through the host kqueue
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 10:48:35 +01:00
Dean 318f237602 Merge pull request #5258 from JAB-dev/perf/unwind-info-cache
perf(libkernel): cache the unwind tables and image name per module on Windows
2026-10-14 22:39:58 +13:00
Dean 1a40d3d81f Merge pull request #5013 from p3n1cillin/claude/select-pipes
feat(libkernel): select on pipes on Windows
2026-10-14 22:39:38 +13:00
Claude f5d856d85e test(libkernel): take the summer time amount from the C runtime on Windows
A TZ variable does not set the UCRT's _dstbias, so after the system zone
of a CI runner without daylight saving it stays 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017iLxaSz4qjmirfqKZdhVQk
2026-10-14 07:56:03 +00:00
Dean Galvin 83a268a867 feat(libkernel): stop at start-up on a host CPU without the PS5's extensions
Titles run natively, so a host CPU without an extension that compiled Zen 2 code uses faults with an illegal instruction deep inside a title (#3719: SHLX, BMI2). libkernel now reads CPUID and XCR0 when it loads on Linux and Windows, logs the host CPU's extensions and throws, naming the CPU and the missing extensions, before any title code runs.
2026-10-14 20:29:57 +13:00
p3nicillinandClaude Opus 5.5 f288daf6fe feat(libkernel): select on pipes on Windows
select now checks pipe descriptors on Windows with the readiness test poll
already uses, so a pipe next to a libSceNet socket no longer throws.
RetroArch (PPSA99169) selects on libmicrohttpd's wake-up pipe beside its
listening socket. guest_select now runs on Windows too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 08:19:48 +01:00
p3nicillinandClaude Opus 5.5 1aaec9728d feat(libkernel): report RLIMIT_NOFILE through getrlimit
XPSemu (PPSA97358) queries RLIMIT_NOFILE at start-up in QEMU's
os_setup_limits and stopped on the unsupported resource. It reports the
descriptor count after which AnyPS5 fails with EMFILE: the C runtime's
8192 low-level descriptors on Windows and the host limit on Linux.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 08:12:33 +01:00
Claude bb5f7d7e07 Merge remote-tracking branch 'upstream/main' into pr-main
# Conflicts:
#	core/libs/tests/GuestFreebsdClocks.cpp
2026-10-14 06:49:51 +00:00
Dean f87799aa3a Merge pull request #5061 from p3n1cillin/claude/getdtablesize
feat(libkernel): add getdtablesize
2026-10-14 19:33:57 +13:00
Kurenaiiiii 1ce5c2c4e1 feat(libkernel): share pause wait loop and _sigprocmask restore in sigsuspend 2026-10-14 11:43:57 +05:30
Kurenaiiiii 38e2db378c docs(libkernel): record sigsuspend 32-signal mask limit 2026-10-14 11:42:20 +05:30
Kurenaiiiii b3d850d077 feat(libkernel): implement sigsuspend on the pending-signal set 2026-10-14 11:42:20 +05:30
Dean ea53213fd4 Merge pull request #4674 from zaydzaari/research/kernel-system-version-size-1342
fix(libkernel): accept measured system version record values
2026-10-14 19:06:34 +13:00
Yossi Yadgar 6b8ddfb5de docs(debt): note regular file mappings of mmap 2026-10-14 09:04:56 +03:00
JAB-devandClaude Sonnet 5.5 19c55dc804 fix(libkernel): drop the unwind cache's freshness check and let a failed forget throw
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 07:41:54 +02:00
akkadbakkad89 975ed1213d feat(libkernel): count committed ranges in sceKernelGetPageTableStats
Charge each recorded protection ranges 2 MiB granules to the gpu
pool when the range has GPU-access protection bits and to the cpu
pool otherwise, so the available counts reflect committed usage
instead of staying at the 2048-entry budget. Follows KytyPS5s
counting model.
2026-10-14 05:14:20 +00:00
Dean ee50655414 Merge pull request #5109 from pushkarreddyy/feat/libkernel-foreign-module-protect
feat(libkernel): support sceKernelMprotect on foreign guest module images on Windows
2026-10-14 17:26:42 +13:00
Dean 718ae1355c Merge pull request #4903 from ErenYeager1836/carry/fstat-guest-socket
fix(libkernel): report socket status from fstat on a guest socket
2026-10-14 17:26:23 +13:00
Dean a14ae8e232 Merge pull request #5186 from p3n1cillin/claude/carry-fioclex
fix(libkernel): handle FIOCLEX and FIONCLEX in ioctl
2026-10-14 16:31:08 +13:00
milescovielloandClaude Opus 5.5 472437a703 fix(libkernel): report socket status from fstat on a guest socket
fstat on a guest socket descriptor passed the guest number to the host,
which has no such descriptor, and threw ("FillFileStat: fstat failed for
fd 268435460"); sceKernelFstat returned EBADF. FreeBSD fills the stat
buffer for a socket through soo_stat (sys/kern/sys_socket.c):

	bzero((caddr_t)ub, sizeof (*ub));
	ub->st_mode = S_IFSOCK;
	...
	if ((sb->sb_state & SBS_CANTRCVMORE) == 0 || sbavail(sb))
		ub->st_mode |= S_IRUSR | S_IRGRP | S_IROTH;
	ub->st_size = sbavail(sb) - sb->sb_ctl;
	...
	if ((sb->sb_state & SBS_CANTSENDMORE) == 0)
		ub->st_mode |= S_IWUSR | S_IWGRP | S_IWOTH;

and pru_sense_null (sys/kern/uipc_socket.c) adds
st_blksize = so->so_snd.sb_hiwat.

fstat and sceKernelFstat now answer a guest socket from the socket
table: S_IFSOCK, the read bits until the receive side is shut down and
drained, the write bits until the send side is shut down, st_size from
the bytes queued and st_blksize from the send buffer size, other fields
zero. shutdown records which side it closed. A closed socket descriptor
returns EBADF. The differences from the console (peer shutdown, the
host's FIONREAD and SO_SNDBUF, socketpair identity) are listed in
TechnicalDebt.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 08:34:16 +05:30