Commit Graph
1466 Commits
Author SHA1 Message Date
Adrià 62e946f114 Merge pull request #6833 from ErenYeager1836/feat/libkernel-sysconf-limits
feat(libkernel): support _SC_ARG_MAX, _SC_OPEN_MAX and _SC_IOV_MAX in sysconf
2026-10-19 13:37:44 +02:00
Adrià 3691f6ffc2 Merge pull request #6826 from hugodearaujo/fix/page-table-stats-console
fix(libkernel): count page-table entries the way the console does
2026-10-19 13:24:22 +02:00
Adrià 97d5d7a52a Merge pull request #6737 from fogydes/fix/libkernel-eventflag-deletion-and-multiwaiter-race
fix(libkernel): prevent use-after-free on event flag deletion and multi-waiter race
2026-10-19 13:05:18 +02:00
Dean cd32b54c56 Merge pull request #7806 from fogydes/fix/libkernel-pipe-buffer-size
fix(libkernel): increase pipe buffer size to match FreeBSD BIG_PIPE_SIZE
2026-10-19 23:53:54 +13:00
Dean 7f6ef06348 Merge pull request #7813 from whamre/fix/windows-stdio-stream-limit
fix(libkernel): raise the Windows stdio stream limit to RLIMIT_NOFILE
2026-10-19 23:52:59 +13:00
Adrià 2eb4de8e13 Merge pull request #6711 from Ondra97/codex/fix-rwlock-unlock-lifetime
fix(libkernel): notify rwlock waiters before unlocking state
2026-10-19 11:03:06 +02:00
fogydes ee7280c873 fix(libkernel): prevent use-after-free on event flag deletion and multi-waiter race 2026-10-19 14:32:12 +05:30
Adrià 48f436406b Merge pull request #6663 from karimibrahim07/feat/libkernel-ipv6-v6only
feat(libkernel): set and read IPV6_V6ONLY on a guest socket
2026-10-19 10:44:37 +02:00
Werner 8bd8c1c338 test(libkernel): read through APR while 600 guest streams are open 2026-10-19 10:32:45 +02:00
Adrià b95ca1b87d Merge pull request #6648 from NevesHenry/fix/libkernel-open-errno-mapping
fix(libkernel): report ENAMETOOLONG and ELOOP from open, unlink and stat
2026-10-19 10:15:06 +02:00
fogydes 9f0485c4cc fix(libkernel): increase pipe buffer size to match FreeBSD BIG_PIPE_SIZE
On Windows, pipe_nid_postfix configured the anonymous pipe with a 4096-byte buffer. When guest executables redirect standard error to a pipe via dup2 and host logging writes to standard error, the pipe buffer fills during startup before or between guest reader drains, blocking writer threads in ZwWriteFile and deadlocking the title. Increase the Windows pipe buffer capacity to 65536 bytes to match FreeBSD BIG_PIPE_SIZE used by the PS5 kernel, and cover multi-page single-shot pipe writes in guest posix scalar IO tests.
2026-10-19 13:44:41 +05:30
Werner 4e5eb1c3be fix(libkernel): raise the Windows stdio stream limit to RLIMIT_NOFILE
The C runtime allows 512 stdio streams by default, so after about 509
guest fopen/fdopen streams every further stream failed with EMFILE,
including the std::ifstream APR opens for each read, while getrlimit
reports 8192 open files. Raise the limit to 8192 when libkernel loads,
as the Linux build raises RLIMIT_NOFILE.
2026-10-19 08:00:07 +00:00
Adrià 22410061d5 Merge pull request #6542 from wachi35676/fix/libkernel-windows-shared-file-mmap
feat(libkernel): map regular files with mmap on Windows
2026-10-19 08:37:27 +02:00
Doğukan Atlıhan 1ad6c746b8 fix(libkernel): replace anonymous Windows stack mappings 2026-10-19 06:42:30 +02:00
Dean 8687da6c0e Merge pull request #7711 from jotitadev/fix/guest-dynamic-loader-resource-lock
test(libkernel): serialise the two dynamic loader tests that share their files
2026-10-19 16:22:06 +13:00
Adrià decb14c505 Merge pull request #6491 from Ondra97/codex/fix-flexible-fixed-remap-budget
fix(libkernel): account for fixed flexible memory replacements
2026-10-19 04:30:17 +02:00
Dean 43797ca8a9 Merge pull request #6198 from valenciana-nc/fix/aio-batch-cap
fix(libkernel): check the AIO Multiple batch limit before reading the requests
2026-10-19 15:22:04 +13:00
Adrià 40393b0f95 Merge pull request #6487 from klosixgaming-arch/fix/pthread-detach-joiner
fix(libkernel): refuse to detach or rejoin a thread that is being joined
2026-10-19 04:03:57 +02:00
Adrià 324e0e48e0 Merge pull request #6482 from Ondra97/codex/team-20261015-worker-1-ready
fix(libkernel): preserve RTLD_GLOBAL visibility on Windows
2026-10-19 03:39:21 +02:00
Jota 6f94cba100 test(libkernel): serialise the two dynamic loader tests that share their files
guest_dynamic_loader and guest_dynamic_loader_fixed_base run the same
GuestDynamicLoader.cpp in the same working directory, and both copy the
module fixture to anyps5-relinked-module-for-test.prx.guest.prx and
anyps5-host-loaded-module-for-test.prx before loading it. Under ctest
--parallel one test rewrote or removed a file the other had mapped:
Bus error, or failed at GuestDynamicLoader.cpp:92. Give both one
RESOURCE_LOCK.
2026-10-18 22:38:13 -03:00
Adrià 79d7d26b6d Merge pull request #6484 from Ondra97/codex/team-20261015-worker-2
fix(libkernel): share guest rename semantics with sceKernelRename
2026-10-19 03:35:57 +02:00
klosixgaming-arch 30cbb2fd66 fix(libkernel): refuse to detach or rejoin a thread that is being joined
PPSA34015 (EA SPORTS FC 27) stopped with "Joining guest thread: Access is
denied": scePthreadJoin waited on a thread that another call released
under it, and then waited on its closed handle. As FreeBSD 11.4's
thr_join.c and thr_detach.c do with the joiner field, scePthreadDetach
now returns EINVAL while a thread waits to join the target, a second
concurrent scePthreadJoin returns EOPNOTSUPP, a cancelled join backs out,
and a completed join leaves the thread detached.
2026-10-19 03:30:58 +02:00
valenciana-nc 767ea1ea0f fix(libkernel): check the AIO Multiple batch limit before reading the requests 2026-10-18 19:04:54 -06:00
Izamaru f7953ecac3 fix(libkernel): stage Windows APR reads through host memory
Copy bounded host reads into the destination in user mode so demand-committed pages can be handled by the process. Preserve short-read validation, zero-fill at EOF and HostWrite protection checks. Add synthetic read and Windows page-fault regressions. AI-assisted: yes.
2026-10-19 02:52:01 +02:00
Adrià bebc294607 Merge pull request #6443 from EagleBearerYS/fix/libkernel-host-stack-guard-page
fix(libkernel): keep a protected host stack's guard page, and protect the Linux main stack
2026-10-19 02:41:09 +02:00
Adrià 347c0a7934 Merge pull request #6420 from JJenkx/feat/kernel-error-conversion-upstream
feat(libkernel): convert guest POSIX error values
2026-10-19 02:40:46 +02:00
NevesHenryandClaude Opus 5.5 3fe7ba01c3 fix(libkernel): report ENAMETOOLONG and ELOOP from open, unlink and stat
Open.cpp passed host errno values 1 to 34 through and turned every
other one into EIO. On Linux, ENAMETOOLONG (36) and ELOOP (40) are above
that range, so sceKernelOpen and sceKernelUnlink returned EIO for a name
longer than 255 bytes or a symbolic link loop, where FreeBSD returns
ENAMETOOLONG (63) and ELOOP (62). sceKernelStat returned ENOENT for
both. sceKernelMkdir already reported them through the mapping in
Stdio.cpp.

Values above 34 now go through FilesystemError, the std::errc mapping
that path resolution already uses. sceKernelStat returns ENAMETOOLONG
and ELOOP when the status query fails with them. The POSIX open, unlink
and stat wrappers set the same errno values.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-18 21:35:18 -03:00
Muhammad Wasif Ali WasifandClaude Opus 5.5 ddb774ad26 feat(libkernel): map regular files with mmap on Windows
A shared mapping is a view of a file section created on the descriptor's
handle, read-write when the descriptor is, otherwise read-only. A private
mapping is a copy of the file read at mmap, as POSIX allows. Anonymous
shm_open objects and JIT shared memory descriptors are temporary files on
Windows, so mmap now maps them too (it failed with EOPNOTSUPP before).
mprotect of a mapped view above the view's protection fails with EACCES
before any bookkeeping changes. The cases Windows cannot represent are
listed in the libkernel debt.

Dusklight (PPSA99305) uses SQLite in WAL mode, which maps its -shm file.
On Windows main f0634088b every start logged "Failed to start
transaction: disk I/O error" for its Dawn and pipeline caches (3 of 3
runs); with this change the caches initialise and their WAL files fill
(4 of 4 runs). The title reaches its menu either way.

A shared mapping may end inside the 16 KiB page that holds the end of
the file, as POSIX mmap allows: the view ends with the file's last 4 KiB
host page, which Windows zero-fills past the end, the rest of the guest
page is private zero pages, and the file never grows. A mapping that
reaches a whole page past the end still fails with EOPNOTSUPP.

PS5LM Plus (PPSA99581) loads its model with llama.cpp, which maps the
whole GGUF file shared and read-only. With a 491,400,032-byte model,
Windows main 5de7a46e0 and this change without the last page logged
"llama_model_load: error loading model: mmap failed: Operation not
supported" (3 of 3 runs); now the model loads and the completion of
"The capital of France is" starts with " Paris" (3 of 3 runs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 05:02:25 +05:00
Adrià 9d4966c265 Merge pull request #6343 from klosixgaming-arch/feat/kevent-standard-input
feat(libkernel): accept a kevent read event on descriptor 0
2026-10-19 01:46:19 +02:00
Ondra97 a64d038154 fix(libs): flush pending GPU results before file writes 2026-10-19 00:53:25 +02:00
Adrià 38a848a1b7 Merge pull request #6287 from ahmad3a4/fix/libc-append-streams-windows
fix(libc): append stream writes atomically on Windows
2026-10-19 00:16:59 +02:00
Adrià 6a480ea637 Merge pull request #6302 from Ondra97/codex/fix-positioned-truncate-race
fix(libkernel): serialize Windows ftruncate with file transfers
2026-10-19 00:16:07 +02:00
Adrià 57a9970094 Merge pull request #6311 from Ondra97/codex/fix-posix-flexible-memory-release
fix(libkernel): release flexible memory budget through munmap
2026-10-19 00:06:26 +02:00
Ondra97 f7aeed2eb0 fix(libkernel): serialize Windows ftruncate with file transfers 2026-10-18 23:36:25 +02:00
Adrià 5768b25925 Merge pull request #6244 from xXPBSXx/fix/pthread-destroyed-einval
fix(libkernel): return EINVAL for pthread mutex and cond operations on a destroyed object
2026-10-18 23:27:09 +02:00
Adrià 3a14fdb321 Merge pull request #6241 from Ondra97/codex/fix-semaphore-canceled-wakeup
fix(libkernel): preserve semaphore wakeups across cancellation
2026-10-18 22:59:45 +02:00
Adrià 1288433e8e Merge pull request #6184 from MarcZX10/codex/cache-inaccessible-guest-pages-6183
fix(agc): cache inaccessible guest pages
2026-10-18 22:37:09 +02:00
Adrià ccf0f58785 Merge pull request #6228 from Ondra97/codex/fix-windows-directory-renames
fix(libkernel): preserve directory identity across Windows renames
2026-10-18 22:20:22 +02:00
Adrià b8cd204a3f Merge pull request #6220 from DavidSamir/fix/libkernel-sysctl-kern-ostype
feat(libkernel): answer the uname sysctl names
2026-10-18 21:56:01 +02:00
Adrià 4b4385cb7f Merge pull request #6201 from bruceblake/libkernel-getdtablesize
feat(libkernel): implement getdtablesize
2026-10-18 21:26:33 +02:00
xXPBSXxandClaude Sonnet 5.5 c664ffbec4 fix(libkernel): return EINVAL for pthread mutex and cond operations on a destroyed object
Locking, trylocking, unlocking a destroyed mutex and signalling, broadcasting,
waiting on or destroying a destroyed condition variable threw a C++ exception
into the guest. FreeBSD 11.4 libthr returns EINVAL for all of them (thr_mutex.c
check_and_init_mutex and mutex_unlock_common compare against THR_MUTEX_DESTROYED,
thr_cond.c CHECK_AND_INIT_COND and _pthread_cond_destroy against
THR_COND_DESTROYED). The condition wait path already reported EINVAL for a
destroyed mutex.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 21:23:54 +02:00
MarcZX100 00ca965c57 fix(libkernel): reject connects on listening sockets first 2026-10-18 18:25:48 +00:00
MarcZX100 0751dffcb1 fix(libkernel): match FreeBSD port-zero stream connects 2026-10-18 18:23:39 +00:00
Hussein Kadhim f571b37f5a fix(libkernel): limit the port 0 check to connect on an unconnected datagram socket 2026-10-18 18:23:39 +00:00
Hussein Kadhim b10f1310df fix(libkernel): fail connect and sendto to port 0 with EADDRNOTAVAIL 2026-10-18 18:23:38 +00:00
Dean cd20b7f6f8 Merge pull request #6132 from MarcZX10/codex/open-resolved-path-diagnostics
fix(libkernel): log resolved paths for failed opens
2026-10-19 07:22:43 +13:00
Dean ff99667449 Merge pull request #6123 from MarcZX10/codex/trace-semaphore-lifecycle
feat(libkernel): trace semaphore lifecycle under sync logging
2026-10-19 07:22:39 +13:00
Dean 38ea28854c Merge pull request #7616 from MarcZX10/codex/libkernel-clock-gettime-cpu-error
fix(libkernel): return errno when Windows CPU clock queries fail
2026-10-19 07:22:36 +13:00
MarcZX100 e88f7fc157 fix(libkernel): return errno when Windows CPU clock queries fail 2026-10-18 17:14:22 +00:00
MarcZX100 40bc17cb86 fix(libkernel): return errno when Windows CPU clock queries fail 2026-10-18 17:04:35 +00:00