Commit Graph
1437 Commits
Author SHA1 Message Date
mrph28 3b379b4435 feat(libkernel): answer kern.proc.proc with the calling process
MihawkOS (PPSA99170) reads sysctl {1, 14, 8, 0} while it starts and the
runtime throws on the unsupported MIB, which aborts the title.

KERN_PROC_PROC takes no pid, so the node lists the one guest process the
runtime hosts, as the same kinfo_proc kern.proc.pid already builds.

AI-assisted: yes
2026-10-30 18:06:58 -03:00
Adrià 7ad4f3bb9f Merge pull request #12986 from Oscar45397/test/libkernel-virtual-range-name
fix(libkernel): return EFAULT for a null virtual range name
2026-10-30 21:23:57 +01:00
Adrià c0fb4a6aad Merge pull request #13411 from DeveshB-1/fix/uuid-create-efault
fix(libkernel): return EFAULT from sceKernelUuidCreate and sceKernelCreateUuidV4 for unwritable stores
2026-10-30 21:14:40 +01:00
AdriàandClaude Sonnet 5.5 a667bc4a7a fix(libkernel): keep unwritable-output checks to hosts with a sensor, restore measured debt detail
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-30 20:51:20 +01:00
DeveshB-1 84e493242f fix(libkernel): return EFAULT from thermal sensor queries for unwritable stores 2026-10-30 20:51:08 +01:00
erickerxhalli 3aa61cb9d4 Merge remote-tracking branch 'upstream/main' into feat/libkernel-mutex-prioceiling
# Conflicts:
#	core/libs/prx/libkernel_sys/Export.Discovery.cpp
#	core/libs/prx/libkernel_sys/include/Api.hpp
2026-10-30 19:41:06 +00:00
MarcZX10 03a4bd851e docs(libkernel): sysctlnametomib returns ENOENT for kern.smp.maxcpus, kern.stackprot, kern.sched.name and kern.timecounter.hardware
Old claim (entry 155 of docs/dev/debt/libkernel.md, second half): sysctlnametomib still throws for these four names.

What the code does: these names are only in IsUnansweredName, which the read path of sysctl uses. sysctlnametomib does not match them in TopLevelNode, its known-name table or its SystemStrings and SystemIntegers tables, so it reaches the final fall-through, sets errno to 2 (ENOENT) and returns -1 without throwing.

Permalinks at 50843f45d9:
- https://github.com/boykopovar/AnyPS5/blob/50843f45d95b60e5772f4396431f9a39b8709d72/core/libs/prx/libkernel/System/src/SystemConfiguration.cpp#L755 (sysctlnametomib)
- https://github.com/boykopovar/AnyPS5/blob/50843f45d95b60e5772f4396431f9a39b8709d72/core/libs/prx/libkernel/System/src/SystemConfiguration.cpp#L808-L809 (fall-through, ENOENT)
- https://github.com/boykopovar/AnyPS5/blob/50843f45d95b60e5772f4396431f9a39b8709d72/core/libs/prx/libkernel/System/src/SystemConfiguration.cpp#L272-L274 (names in the unanswered list)
2026-10-30 18:52:29 +00:00
Paritosh Lahre ff742197a9 Merge branch 'boykopovar:main' into fix/libkernel-guest-sigpipe 2026-10-30 23:58:27 +05:30
cocoa55andClaude Opus 5.5 9a7acb3677 fix(libkernel): spin and yield by the mutex spin and yield loop counts
Lock and timed lock now try the mutex up to the spin count with a pause
between tries, then up to the yield count with a yield before each try,
before they block, as FreeBSD 11.4's mutex_lock_sleep does. Trylock and
a lock the thread already holds do not spin. A uniprocessor host skips
the spins and keeps the yields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 13:56:31 -04:00
BunnyFlandClaude Opus 5.5 bf1a40404f docs(libkernel): correct what the firmware records for the AMM writers
The PRT remap's last argument is checked but not recorded by firmware
13.42, and the comparison covered the recorded fields, not the bytes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 18:06:54 +01:00
Oscar45397andClaude Opus 5.5 06b7a58b1b fix(libkernel): return ENOMEM when mapping unallocated direct memory
Mapping a direct memory range that includes an unallocated physical
page threw std::invalid_argument and ended the process. It now returns
ENOMEM before anything is mapped, as shadPS4's MemoryManager::MapMemory
does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 18:06:45 +01:00
Oscar45397andClaude Opus 5.5 287f43e004 fix(libkernel): return EFAULT for a null virtual range name
KytyPS5 and shadPS4 return EFAULT for a null name. The test keeps that
and the rename and clear checks, and drops the null address, zero length
and past-the-end cases that no reference covers; the debt entry records
them as unknown, with the 32-byte name limit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 17:47:22 +01:00
BunnyFlandClaude Opus 5.5 dd0bc0b781 feat(libkernel_sys): add the AMM writers for PRT maps, address and counter writes, waits and event queues
sceKernelWriteMapCommand2, sceKernelWriteUnmapToPrtCommand,
sceKernelWriteWriteAddressCommand, sceKernelWriteWriteCounterCommand,
sceKernelWriteWaitOnAddressCommand, sceKernelWriteWaitOnCounterCommand
and sceKernelWriteEventQueueOnCompletionCommand follow the checks of
firmware 13.42's libkernel and record this project's command layout.
Without the PRT flag, sceKernelWriteMapCommand2 is
sceKernelWriteMapCommand, as on the console. The debt files record where
the existing writers' checks differ from the firmware.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 17:45:00 +01:00
Malek ca1395389d test(libkernel): cover registered wait address faults 2026-10-30 16:14:13 +01:00
Malek 54aa424cb7 fix(libkernel): return EFAULT for unreadable wait addresses 2026-10-30 16:14:13 +01:00
DeveshB-1 5553cbd447 fix(libkernel): return EFAULT from sceKernelWriteThrottlingStatus for an unwritable store 2026-10-30 20:14:03 +05:30
DeveshB-1 32c4ce6484 docs(libkernel): record unwritable store fallback for sceKernelUuidCreate and sceKernelCreateUuidV4 2026-10-30 20:10:52 +05:30
hugodearaujo 67658c0cbd Merge main into fix/linux-guest-main-stack
# Conflicts:
#	docs/dev/debt/libkernel.md
2026-10-30 09:56:11 -03:00
Oscar45397andClaude Opus 5.5 03722a1570 fix(libkernel): deliver raises at the spin that ends a sleep on Windows
On Windows a sleep shorter than TimedWait's 0.5 ms lead, and the last 0.5 ms of a longer one, is a YieldProcessor spin in host code with no wait counted. A raise that found the target there could only be delivered through the return-address breakpoint or sampling, so sceKernelRaiseException at a thread looping on such sleeps was lost: a thread looping on sceKernelUsleep(200) lost the first raise in 5 of 5 runs.

The spins in SleepUntil and SleepNanosUnlessChanged now run under a DeliveryDeferral and drain APCs afterwards, as BeginPark and Unpark already do. A raise that finds the target spinning is queued as an APC and runs when the sleep ends.

GuestRaiseShortSleep raises 100 times each at a thread sleeping 100, 200 and 400 us in a loop, with sleep wakes on (SleepNanosUnlessChanged) and with APS5_NO_SLEEP_WAKE (SleepUntil). Both fail on main at the first or second raise.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 13:26:59 +01:00
Dean 5c0ee1bbf4 Merge pull request #11827 from oneandonlydean/carry/7268-cert-paths
feat(libkernel): provide system and common certificate list paths
2026-10-31 01:18:08 +13:00
Adrià 8304ccaedb Merge pull request #11341 from SteelCrab/review/emscripten-libraries
build(libs): support Emscripten memory64 compilation
2026-10-30 12:49:20 +01:00
Dean Galvin 62f78b77f0 Merge main into PR #11002 2026-10-31 00:22:42 +13:00
Nixitov 02967feefa Merge origin/main into feat/libkernel-dmem-for-app
AI-assisted: yes
2026-10-30 12:18:51 +01:00
hugodearaujo 003002a852 Merge main into fix/linux-guest-main-stack
# Conflicts:
#	core/relinker/elfpatcher/src/general/EntryStubBuilder.cpp
2026-10-30 07:13:21 -03:00
Dean Galvin 462c4ec0aa Merge main into PR #11827 2026-10-30 23:07:47 +13:00
Dean Galvin f2b4437f74 docs(libkernel): mark the system and common certificate paths as unverified 2026-10-30 23:07:14 +13:00
DeveshB-1 9e5683dd8b fix(libkernel): return EFAULT from sched_getparam and sched_setparam for invalid memory 2026-10-30 15:05:54 +05:30
Adrià bcee950a9c Merge pull request #12467 from Buraddomoon/fix/udp-disconnect-local-address
fix(libkernel): clear reported local address after UDP disconnect
2026-10-30 10:18:49 +01:00
Alexandre Figueiredo 950ce5a4fc Merge upstream main into fix/libkernel-guest-thread-x87-control-word 2026-10-30 08:39:26 +00:00
Adrià e4f5516fd6 Merge pull request #12974 from MarcZX10/feat/host-game-mode
feat(libkernel): opt-in host game mode request (APS5_GAME_MODE)
2026-10-30 06:36:04 +01:00
Adrià 5ba6b2b917 Merge pull request #12963 from JJenkx/windows/libkernel-raise-pending-until-resume
fix(libkernel): keep sceKernelRaiseException pending on a suspended thread on Windows
2026-10-30 06:32:05 +01:00
Adrià ad9001f9d2 Merge pull request #12865 from heditrigui/feat/libkernel-posix-madvise
feat(libkernel): implement posix_madvise
2026-10-30 05:52:23 +01:00
Adrià a8d9d375ac Merge pull request #13060 from bunbeans2-arch/docs/7120-anon-flexible
docs(libkernel): record that anonymous mmap is not charged to the flexible budget
2026-10-30 05:51:10 +01:00
AdriàandClaude Sonnet 5.5 885f9bbbb5 docs(libkernel): record WebAssembly direct memory contents lost on remap
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-30 10:50:57 +09:00
pista 2c22b68133 fix(libs): reject unsupported WebAssembly module unwind queries 2026-10-30 10:50:57 +09:00
pista e427bd0567 docs(libs): record WebAssembly host limitations 2026-10-30 10:50:57 +09:00
pista 2f49b2568d build(libs): validate current native and WebAssembly adapter sources 2026-10-30 10:50:57 +09:00
Adrià ec709cede3 Merge pull request #12436 from milescoviello/fix/vm-loadavg
fix(libkernel): answer vm.loadavg with the host's load averages
2026-10-30 02:31:30 +01:00
Adrià 365f857609 Merge pull request #12427 from simnJS/feat/kernel-is-neo-mode
feat(libkernel_sys): answer sceKernelIsNeoMode from the param.sfo Neo-mode attribute
2026-10-30 02:30:27 +01:00
Adrià c9f87549ef Merge pull request #12531 from olegon85/test-kernel-apr-prefixed-batch
test(libkernel): cover the prefixed APR batch resolve without sizes
2026-10-30 02:04:17 +01:00
Adrià 28b490ea5c Merge pull request #12296 from JJenkx/windows/kernel-shm-mmap-checks
fix(libkernel): map Windows shared memory with the regular file checks
2026-10-30 02:04:04 +01:00
Adrià f9a8813b11 Merge pull request #12179 from p3n1cillin/claude/kernel-executable-module-handle
feat(libkernel): add sceKernelGetExecutableModuleHandle
2026-10-30 02:01:01 +01:00
Adrià 4725feb152 Merge pull request #11431 from p3n1cillin/claude/pthread-getaffinity-set-size
fix(libkernel): answer pthread_getaffinity_np for the console's 8- and 16-byte sets
2026-10-30 01:20:44 +01:00
Adrià 96613bba67 Merge pull request #12060 from Ragbie/fix/windows-directory-flock
fix(libkernel): lock directories with flock on Windows as FreeBSD does
2026-10-30 01:04:03 +01:00
bunbeans2-archandClaude Opus 5.5 fabc873701 docs(libkernel): record that anonymous mmap is not charged to the flexible budget
A plain MAP_PRIVATE | MAP_ANON map is placed through DoMapAnon and is
not added to the flexible ranges, so it neither lowers
sceKernelAvailableFlexibleMemorySize nor is refused for the budget.
Whether a PS5 charges it is not measured; shadPS4 charges it on the PS4.
The debt entry records the gap left open in #7120.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 19:57:34 -04:00
Felipebmaitan b9bcb27fb9 docs(libkernel): preserve sysarch sources and clarify Windows FS debt 2026-10-29 20:36:05 -03:00
Felipebmaitan 0e219ec9cd chore(libkernel): integrate current main for GS maintenance 2026-10-29 20:35:35 -03:00
Adrià 1aff97d3c8 Merge pull request #12093 from dantdmdarealguy/fix/kqueue-windows-snapshot-times
fix(libkernel): read a watched file's times again after its size on Windows
2026-10-29 21:20:39 +01:00
blu f430c9ec4e Merge remote-tracking branch 'origin/main' into refactor/siginterrupt-libc-internal
# Conflicts:
#	docs/dev/debt/libSceLibcInternal.md
2026-10-29 12:55:05 -07:00
Nixitov f2df214461 docs(libkernel): name only the title id in the two direct memory debt entries
AI-assisted: yes
2026-10-29 20:48:35 +01:00