Commit Graph
273 Commits
Author SHA1 Message Date
xXPBSXxandClaude Sonnet 5.5 8e0dbfc783 Merge main (98346b748c) into fix/guest-allocation-pin-livelock
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-02 12:28:52 +01:00
Dean 9dc910f515 Merge pull request #11042 from EagleBearerYS/fix/count-throwing-done-net-kernel
fix: report five always-throwing network and kernel exports as not implemented
2026-11-02 23:26:36 +13:00
Dean 4b4c038d6f Merge pull request #9882 from orezraey/fix/libkernel-mprotect-gaps-measured-ps5
fix(libkernel): protect ranges with unmapped pages as measured on a PS5
2026-11-02 20:59:05 +13:00
Dean 78ae9eb66b Merge pull request #6321 from mariuszkreft/wip/gta-v-4634-registry-scan
perf(libc): start the guest allocation overlap queries at the range that touches the address
2026-11-02 20:55:36 +13:00
Dean Galvin c5c96c0d77 Merge commit '74ca823ad87b3948fea79db8669efc46ff944394' into HEAD
# Conflicts:
#	core/libs/tests/GuestMemory.cpp
2026-11-02 03:09:30 +13:00
Dean Galvin 88b99b28b6 Merge commit 'f1a7b02028ae50adaf6c5aaaef892a51841b25bf' into HEAD
# Conflicts:
#	core/libs/prx/libSceAgcDriver/CMakeLists.txt
2026-11-02 02:38:58 +13:00
xXPBSXxandClaude Sonnet 5.5 5b9058fe6d Merge main (90cc8d57a5) into fix/guest-allocation-pin-livelock
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-01 09:15:09 +01:00
Dean db8825e4b6 Merge pull request #7938 from JJenkx/perf/guest-arena-prefix
perf(libc): skip the known occupied guest arena prefix
2026-11-01 19:17:49 +13:00
Yunus Shaikh 49a05d8769 Merge main into fix/count-throwing-done-net-kernel
The conflict in core/libs/tests/GuestRudpContextLifecycle.cpp with #13799 keeps both changes: this branch's removal of the check that sceRudpActivate throws, and main's sceRudpBind(ctx, 5, 0, 2) call after it.
2026-10-31 18:38:17 -07:00
Adrià 0835ec8bdc Merge pull request #13576 from pushkarreddyy/fix/direct-memory-queries-efault
fix(libkernel): return EFAULT from direct memory queries for invalid memory pointers
2026-10-31 05:15:50 +01:00
pushkarreddyy aeab1543b4 test(libkernel): cover invalid memory rejection in flexible memory queries and PRT aperture 2026-10-31 08:15:41 +05:30
pushkarreddyy 33aa65bf90 test(libkernel): cover EFAULT from direct memory queries for invalid memory pointers 2026-10-31 08:14:53 +05:30
pushkarreddyy f07dbee530 test(libkernel): cover invalid memory rejection in page table and trace memory stats 2026-10-31 02:24:36 +01:00
2f225f0ff2 test(libkernel): map one physical allocation out of order for the shared-backing runs check
The check allocated three physical blocks and accepted whatever the allocator returned, so an ordinary run could coalesce them into one and never exercise a scattered result, and a layout where only the latter two are adjacent (two runs) failed its count. One four-page allocation mapped in the order 2,3,0,1 gives exactly two runs, with the latter mappings required to coalesce; the offsets, lengths, a partial-range query, the backing byte and the insufficient-capacity refusal are checked exactly.

Test patch by JJenkx (#4449 comment, deterministic-scattered-runs-linux-20261029).

Co-authored-by: JJenkx <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-30 23:31:53 +00:00
Mouad-Scriptz-0andClaude Fable 5.1 99110dd451 Merge origin/main into port-4449
Conflicts: GuestArena.hpp/.cpp keep both sides' exports; GuestBufferMemory.cpp keeps this PR's run-list createBackingImport and resolves importStaysWatched's shared-backing check through the run resolver (sharedBacked), replacing main's BackingFile/sharedBacking; the debt file keeps this PR's sparse-import entry and main's presentation entry.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-30 23:31:33 +00:00
Adrià 9605300f29 Merge pull request #13503 from Oscar45397/fix/libkernel-map-unallocated-direct-memory
fix(libkernel): return ENOMEM when mapping unallocated direct memory
2026-10-30 22:56:33 +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
Oscar45397andClaude Opus 5.5 e6abfdcf75 test(libkernel): cover sceKernelSetVirtualRangeName argument errors
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 17:44:03 +01:00
JJenkx a87ce79892 perf(libc): skip the known occupied guest arena prefix 2026-10-30 08:14:30 -04:00
xXPBSXxandClaude Sonnet 5.5 9fbe519712 fix(libc): leave a range that a mutation waits for out of new leases
RequireUnpinned waits for the GPU work that leases a range through the
driver's waiter, but GuestAllocationsAcquireAll and Acquire copy every
registered range into each new lease, so a driver worker that starts an
address-based build between the waiter's return and the re-lock pins the
range again. A title that draws every frame keeps replacing the lease,
and the free fails after APS5_PIN_WAIT_MS.

A mutation that finds a pinned range now records it as retiring until the
wait ends; Acquire and AcquireAll leave retiring ranges out and do not
cache the lease while one is recorded. guest_memory gains a check that
replaces the lease from the waiter the way a worker does: without the
change the unmap fails with "still pinned after 8 recorder syncs".

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-30 10:46:08 +01:00
Adrià 732074ad18 Merge pull request #12987 from Oscar45397/test/libkernel-memory-pool-errors
test(libkernel): cover memory pool commit, decommit and batch argument errors
2026-10-30 07:41:31 +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à b440646418 Merge pull request #12858 from slopgobblercobbler/fix/direct-memory-alignment-and-boundary-checks
test(libkernel): cover boundary parameter validation and unaligned rejection in direct memory allocation
2026-10-30 05:52:16 +01:00
Dean a6ec79e895 Merge pull request #12239 from MarcZX10/perf/libc-realloc-in-place
perf(libc): resize a default heap block in place when it already has the room
2026-10-30 08:20:33 +13:00
Oscar45397andClaude Opus 5.5 5a594afebd test(libkernel): cover memory pool commit, decommit and batch argument errors
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 19:57:00 +01:00
Hedi Trigui 70e34e59f9 test(libkernel): add boundary test cases killing posix_madvise mutants 2026-10-29 16:32:27 +01:00
slopgobblercobbler ffd186e71f test(libkernel): cover parameter bounds and unaligned rejection in direct memory allocation 2026-10-29 14:47:31 +01:00
Hedi Trigui 59c9c7cfac fix(libkernel): validate posix_madvise address against user-map minimum and add regression tests 2026-10-29 14:32:53 +01:00
Hedi Trigui bbb4d05d42 feat(libkernel): implement posix_madvise 2026-10-29 14:14:36 +01:00
Adrià 950f8a5a53 Merge pull request #11681 from milescoviello/test/main-direct-memory
test(libkernel): cover the block sceKernelAllocateMainDirectMemory returns and its type
2026-10-29 09:31:07 +01:00
Dean 319621ba2e Merge pull request #12339 from medazizktata/fix/windows-exec-shared-mapping
fix(libkernel): map shared memory and files executable on Windows
2026-10-29 07:28:16 +13:00
Dean 9c542cac90 Merge pull request #11536 from milescoviello/test/kernel-prt-aperture
test(libkernel): cover the PRT aperture setter and getter, their index bounds and null outputs
2026-10-29 07:21:39 +13:00
Mohamed Aziz Ktata dbd826bc88 fix(libkernel): map shared memory and files executable on Windows
A guest mmap with PROT_EXEC and MAP_SHARED of a shared-memory object or a regular file threw on Windows. The section is now created from a handle reopened with GENERIC_EXECUTE, as PAGE_EXECUTE_READ or PAGE_EXECUTE_READWRITE, the owner ACE of named objects grants execute with read, and a writable shared mapping of a read-only descriptor fails with EACCES, as FreeBSD 11.4 shm_mmap and vn_mmap do.

Fixes #12337
2026-10-28 11:14:08 +01:00
Yunus Shaikh 0efa1a8697 Merge main into fix/count-throwing-done-net-kernel
# Conflicts:
#	docs/dev/debt/libkernel.md
2026-10-28 02:49:58 -07:00
orezraeyandClaude Opus 5.5 e2d2ff05c7 Merge main into fix/libkernel-mprotect-gaps-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 04:25:38 -03:00
MarcZX10 6ab5d277e7 test(libc): shrink a heap block well below its class and granule
A 900 byte block shrinking to 40 bytes and a 1 MiB block shrinking to 4 KiB have
to move and keep their data, while a 1 MiB block resized by 100 bytes stays put.
2026-10-28 06:14:50 +00:00
harisibrar1 6413eacf9d Merge remote-tracking branch 'origin/main' into fix/map-undefined-protection-einval
# Conflicts:
#	docs/dev/debt/libkernel.md
2026-10-28 01:28:03 -04:00
Adrià 3d214c8d87 Merge pull request #11549 from milescoviello/test/kernel-memory-pool-block-stats
test(libkernel): cover sceKernelMemoryPoolGetBlockStats's checks and the block an expansion adds
2026-10-28 06:05:23 +01:00
MarcZX10 39803db8c3 test(libc): shrink and regrow a heap block without moving it
A 1000 byte block shrinks to 900, regrows to 1000 and is realigned to 800 at the
same address with the matching usable size and its data intact; growing it to
1 MiB moves it and keeps the data.
2026-10-28 04:13:21 +00:00
Adrià 957a22d51f Merge pull request #11688 from milescoviello/test/batch-map-fixed
test(libkernel): cover sceKernelBatchMap mapping and unmapping at the given starts
2026-10-28 04:41:33 +01:00
Yunus Shaikh 06e6e107a1 Merge main into fix/count-throwing-done-net-kernel
# Conflicts:
#	core/libs/prx/libkernel/Time/Time.cpp
#	core/libs/tests/GuestMlock.cpp
#	docs/dev/debt/libkernel.md
2026-10-27 20:23:15 -07: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 47f7d77bcb Merge pull request #11593 from milescoviello/test/direct-memory-query
test(libkernel): cover sceKernelDirectMemoryQuery's block lookup, find-next and argument checks
2026-10-28 12:07:11 +13:00
orezraeyandClaude Opus 5.5 2d0b949dd4 Merge main into fix/libkernel-mprotect-gaps-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 17:53:59 -03:00
Adrià 9149eec852 Merge pull request #11152 from thuanquang/perf/resident-page-bookkeeping
perf(libc): keep no per-page physical state for resident guest pages on Windows
2026-10-27 12:00:39 +01:00
orezraeyandClaude Opus 5.5 12aa9bd9b1 Merge main into fix/libkernel-mprotect-gaps-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 05:49:56 -03: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
Dean 699ffce388 Merge pull request #10550 from GitamarT045T3R/fix/libkernel-munmap-unaligned
fix(libkernel): round an unaligned munmap address down like FreeBSD
2026-10-27 21:11:19 +13:00