Commit Graph
1040 Commits
Author SHA1 Message Date
milescovielloandClaude Opus 5.5 9a12233a76 docs(libkernel): list sceKernelDebugRaiseException and its release-mode form as silent stubs
Both log their arguments and the caller and return. Note what the
titles' bundled libc.prx passes them and that three of its
sceKernelDebugRaiseException calls are followed by ud2 in every build
checked, so the guest reaches that ud2 here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 04:25:31 +00:00
Dean Galvin 97f1d41a2c Revert "Merge pull request #10809 from frankea/fix/direct-memory-12gib"
This reverts commit 780b33aea3, restoring the 13824 MiB direct memory pool.

With the pool at 12288 MiB, Astro Bot (PPSA21564) can no longer load its
level: DirectMemoryAllocator asserts "Can't allocate direct memory" for a
64 MB VideoPlayerTexture with 12228 of 12288 MB in use, then the process
faults about 26 s in (2 of 2 runs, RTX 4090, Linux, main cccdaa2734).
The same tree with only this merge reverted runs the full 150 s with no
direct memory assert (2 of 2 runs).
2026-10-28 15:45:26 +13:00
Dean 780b33aea3 Merge pull request #10809 from frankea/fix/direct-memory-12gib
fix(libkernel): report 12 GiB of direct memory, as a PS5 does
2026-10-28 13:49:57 +13:00
Dean b3b449cfe4 Merge pull request #8916 from Henryisdjfunkyho/fix/cancellable-timed-sleeps
fix(libkernel): wake timed sleeps for thread cancellation
2026-10-28 13:48:32 +13:00
Dean e778405b5b Merge pull request #11592 from alvaroelpob/fix/libkernel-condattr-getclock-einval
fix(libkernel): fail pthread_condattr_getclock with EINVAL for a null attribute
2026-10-28 13:04:04 +13:00
Dean ba8845d2e7 Merge pull request #9442 from Gruzzberry/feat/lchflags
feat(libkernel_sys): implement lchflags
2026-10-28 13:00:19 +13:00
Adrià 4a6005955f Merge pull request #10898 from imellag/feat/libkernel-memory-protection-macos
feat(libkernel): guest memory protection and VirtualQuery on macOS hosts
2026-10-27 21:42:24 +01:00
Adrià 225ebc5eee Merge pull request #11264 from Gruzzberry/fix/sysctl-faults
fix(libkernel): fail sysctl and sysctlbyname with EFAULT on an unreadable or unwritable pointer
2026-10-27 21:16:21 +01:00
Adrià e2a5118839 Merge pull request #11047 from imellag/feat/libkernel-macho-tls
feat(libkernel): thread-local storage for Mach-O guests
2026-10-27 15:18:46 +01:00
Adrià a40ad89e2c Merge pull request #11236 from orezraey/fix/libkernel-kqueue-timer-readd-measured-ps5
fix(libkernel): accept EVFILT_TIMER re-adds with a time unit or on a disabled timer as measured on a PS5
2026-10-27 14:28:05 +01:00
Adrià 1089f2bbfd Merge pull request #11039 from orezraey/fix/libkernel-mutex-yieldloops-destroyed-measured-ps5
fix(libkernel): fail the yield loop setter on a destroyed mutex as measured on a PS5
2026-10-27 14:08:31 +01:00
Adrià b71d5db752 Merge pull request #10855 from Felipebmaitan/feat/async-storage-engine
fix(libkernel): preserve AIO request ownership and identities
2026-10-27 13:30:47 +01:00
Dean c28cf99512 Merge pull request #11438 from p3n1cillin/claude/direct-map-refuses-execute
fix(libkernel): refuse to map direct memory with execute as the console does
2026-10-27 21:26:17 +13:00
Emanueleandmugurc 86cdfb8647 feat(libkernel): thread-local storage for Mach-O guests
FreeBSD code reaches its thread pointer through %fs and macOS cannot set
the fs base. The macOS relinker turns each %fs access of a guest image
into a stub that reads the thread pointer from a pthread key and calls
Aps5GuestTlsAllocate on a thread's first access, registers the TLS
descriptor of an image with Aps5GuestTlsRegister, and routes
__tls_get_addr to Aps5GuestTlsGetAddr. No library provided them, so a
relinked executable could not start.

- Aps5GuestTlsRegister validates the descriptor the relinker wrote and
  creates the key; its destructor frees the block of a thread.
- Aps5GuestTlsAllocateThreadPointer allocates the block (the TLS template
  followed by zeros, then a 0x100-byte thread control block whose first
  word points at itself, as on FreeBSD) and stores the thread pointer
  under the key.
- Aps5GuestTlsAllocate is the entry the stubs call: rax holds the
  descriptor and returns the thread pointer, every other register is
  preserved, the upper halves of the ymm registers only where AVX exists.
- Aps5GuestTlsGetAddr returns the block of the thread plus the offset.

Co-authored-by: mugurc <[email protected]>
2026-10-27 08:42:04 +01:00
GruzzberryandClaude Sonnet 5.5 4d8fa35a5e fix(libkernel): fail sysctl and sysctlbyname with EFAULT on an unreadable or unwritable pointer
FreeBSD 11.4's sys___sysctl and userland_sysctl copy the name and the
old length in, and copy the value and the length out, so a bad pointer
gives EFAULT in that order. sysctl dereferenced them directly, and
sysctlbyname read its name with strcmp.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-27 08:30:17 +01:00
Adrià 57e44c4b3d Merge pull request #11257 from orezraey/docs/libkernel-accept-option-inheritance-measured-ps5
docs(libkernel): record the socket options an accepted socket inherits as measured on a PS5
2026-10-27 08:28:31 +01:00
Adrià 5c356f41c3 Merge pull request #11048 from imellag/feat/libkernel-macos-main-thread
feat(libkernel): start the guest off the main thread on macOS
2026-10-27 08:27:20 +01:00
Adrià a0aafc1dba Merge pull request #11253 from orezraey/docs/libkernel-module-process-info-measured-ps5
docs(libkernel): record the text location, unwind info, SoC id and model queries as measured on a PS5
2026-10-27 08:26:53 +01:00
Emanuele 896ae02ab5 fix(libkernel): address the macOS stack protection review 2026-10-27 08:16:36 +01:00
Emanuele 62d80b578f fix(libkernel): protect guest stack pages through the write watch on macOS 2026-10-27 08:16:36 +01:00
Emanuele f2e8d5a3eb fix(libkernel): address the macOS memory protection review
- mlock on macOS wires only the pages libkernel has not wired yet. XNU
  counts each wire of a page, and the locked ranges merge overlapping
  locks, so a page locked twice stayed wired after munlock and
  munlockall. The mlock test checks the wire count on macOS.
- mprotect changes a watched page through GuestWriteWatchProtect, which
  applies the host protection and records it under the write watch's
  lock, so a collection on another thread cannot run between the two.
  The write watch test covers it.
- sceKernelVirtualQuery takes a watched page's write permission from the
  write watch for memory outside the guest allocation registry.
- GuestAllocationsGuestPages counts an image segment up to the end of
  its last host page, as the image page collection does.
- The macOS includes stay in main's include block, so the host code
  other pull requests add there still sees them; the unused Mach-O
  headers and the end trim, which never changed the protected spans,
  are gone, and the guest page size is passed in.
- The libc and libkernel debt entries describe what is wired now.
2026-10-27 08:16:36 +01:00
Emanueleandmugurc 190ed6c8fb feat(libkernel): guest memory protection and VirtualQuery on macOS hosts
- mprotect: the guest rounds a range to its 16 KiB pages. A Mach-O image
  is loaded at a multiple of the host page size only (4 KiB under
  Rosetta), so the pages are counted from where the ELF address 0 of the
  image holding the range was loaded, and a rounded edge smaller than a
  guest page that lies in the gap between two segments, where no host page
  exists, is left out. The write watch is told the new protection.
- sceKernelVirtualQuery reads the region with mach_vm_region.
- sceKernelMunlockall unlocks the ranges libkernel locked, one by one:
  macOS has no munlockall, which fails there with ENOSYS and would
  overwrite errno.
- The stack protect test reads page protections with mach_vm_region.

This is mugurc's f66a4df741 from his macOS series, without the mlock
check that #10889 adds.

Co-authored-by: mugurc <[email protected]>
2026-10-27 08:16:35 +01:00
Dean 81267b2204 Merge pull request #8725 from orezraey/fix/libkernel-sync-on-address-measured-ps5
fix(libkernel): follow sceKernelSyncOnAddressWait and Wake as measured on a PS5
2026-10-27 20:03:20 +13:00
Adrià f1adec7eb1 Merge pull request #11230 from orezraey/docs/libkernel-sync-timeouts-eventflag-measured-ps5
docs(libkernel): record timed self-locks, event flag open and create, and the reltimed calls as measured on a PS5
2026-10-27 08:00:27 +01:00
orezraeyandClaude Opus 5.5 8820aa309f Merge main into docs/libkernel-module-process-info-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 02:49:54 -03:00
Dean 5023cd5a25 Merge pull request #9263 from imellag/fix/libkernel-macos-guest-unwind-info
fix(libkernel): report unwind information for guest and host addresses on macOS
2026-10-27 18:19:28 +13:00
Adrià d093ea9ced Merge pull request #10767 from Ragbie/fix/recvmsg-after-shut-rd
fix(libkernel): drop the data a socket held before shutdown(SHUT_RD) in every receive path
2026-10-27 06:14:18 +01:00
Felipebmaitan e44cc5d463 chore: merge current main for AIO review fixes 2026-10-27 01:23:42 -03:00
orezraeyandClaude Opus 5.5 8f16195370 Merge main into docs/libkernel-sync-timeouts-eventflag-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 01:08:10 -03:00
Adrià b986c11a34 Merge pull request #10543 from maximilianfv/fix/libkernel-macos-append-positioned-writes
fix(libkernel): append positioned writes on an O_APPEND descriptor on macOS
2026-10-27 04:52:27 +01:00
Adrià 244bc628fd Merge pull request #11116 from orezraey/docs/libkernel-version-boottime-socpower-measured-ps5
docs(libkernel): record the version stubs, kern.boottime and the SoC power block as measured on a PS5
2026-10-27 04:51:20 +01:00
Adrià 33d2affaa6 Merge pull request #10901 from EagleBearerYS/docs/debt-gaps-bf208
docs(debt): bring five libraries' debt files in line with the tree
2026-10-27 04:50:47 +01:00
Adrià c93ba3b5a3 Merge pull request #10848 from xXPBSXx/docs/debt-kernel-getoperationmode-title
docs(debt): note what a title does with the sceKernelGetOperationMode values
2026-10-27 04:50:35 +01:00
Adrià 02f66c4e97 Merge pull request #10826 from xXPBSXx/docs/debt-kernel-createeventflag-title
docs(debt): note how titles call sceKernelCreateEventFlag
2026-10-27 04:50:20 +01:00
orezraeyandClaude Opus 5.5 fc51fc0f6e Merge main into docs/libkernel-sync-timeouts-eventflag-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 23:19:30 -03:00
orezraeyandClaude Opus 5.5 cf1771ec7e Merge main into fix/libkernel-mutex-yieldloops-destroyed-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 23:10:34 -03:00
Dean af2a996527 Merge pull request #11263 from orezraey/fix/libkernel-cond-signalto-measured-ps5
fix(libkernel): fail scePthreadCondSignalto for a null or non-waiting thread as measured on a PS5
2026-10-27 15:01:44 +13:00
Dean 4571f48bff Merge pull request #11173 from p3n1cillin/claude/mmap-excl-ignored
fix(libkernel): ignore MAP_EXCL in fixed anonymous mmap as measured on a PS5
2026-10-27 15:01:30 +13:00
Dean 169f3e3e73 Merge pull request #10666 from WallisSkill/fix/libkernel-raise-at-guest-return
fix(libkernel): deliver a raised exception at the guest return of a thread in host code
2026-10-27 14:59:25 +13:00
Dean 8056827ea8 Merge pull request #10133 from orezraey/fix/libkernel-posix-thread-attr-measured-ps5
fix(libkernel): follow the thread priority ranges and POSIX attribute errors measured on a PS5
2026-10-27 14:58:57 +13:00
Dean 6e98696398 Merge pull request #10061 from elieh999/fix/rwlockattr-destroyed-pshared
fix(libkernel): preserve destroyed rwlock attributes
2026-10-27 14:58:42 +13:00
Dean 86a38cdf6c Merge pull request #9187 from slider/feat/libkernel-sched-params
feat(libkernel): implement sched_getparam, sched_getscheduler and sched_setparam for the calling thread
2026-10-27 14:57:32 +13:00
Henryisdjfunkyho 42bbc98235 chore: merge main into cancellable timed sleeps 2026-10-26 17:13:30 -07:00
Dean Galvin f733f7dc43 Merge branch 'main' into feat/lchflags 2026-10-27 11:58:22 +13:00
orezraeyandClaude Opus 5.5 a09cef91b1 Merge main into fix/libkernel-sync-on-address-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 19:31:46 -03:00
orezraeyandClaude Opus 5.5 717bfa18c8 Merge main into docs/libkernel-version-boottime-socpower-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 19:31:21 -03:00
orezraeyandClaude Opus 5.5 b131fa34c6 Merge main into docs/libkernel-sync-timeouts-eventflag-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 19:12:16 -03:00
orezraeyandClaude Opus 5.5 ed019e3e73 Merge main into docs/libkernel-module-process-info-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 19:11:32 -03:00
orezraeyandClaude Opus 5.5 7b355abdb9 docs(libkernel): shorten the socket option debt entries
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 19:10:59 -03:00
orezraeyandClaude Opus 5.5 92581772df Merge main into docs/libkernel-accept-option-inheritance-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 19:09:54 -03:00