8 Commits
Author SHA1 Message Date
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
milescovielloandClaude Opus 5.5 077bbfc98d test(libkernel): cover the APR prefixed resolve, file size and stat queries and the submission with a result
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 22:11:41 +00:00
frankea ad9a0c8ef9 fix(libkernel): report 12 GiB of direct memory, as a PS5 does
sceKernelGetDirectMemorySize returns 0x300000000 inside Gran Turismo 7 (PPSA01317) on a PS5 with firmware 13.40. DIRECT_MEMORY_SIZE was 13824 MiB.
2026-10-24 22:11:58 -04:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
SamandClaude Opus 5.5 928a11bf2a fix(libkernel): keep the Windows APR read staging buffer off the stack
Windows APR reads are staged through a 64 KiB std::array on the stack of
the thread that submits them (f7953ecac). Titles submit reads from fibers
whose stacks they allocate themselves, which can be smaller than that and
have no guard page, so the array runs past the bottom of the fiber stack
and the file data lands on whatever lies below it. Demon's Souls
(PPSA01341) then crashes in scePthreadMutexLock about half a second after
start, on a mutex that holds bytes of playgo-chunkdefs.xml.

The staging buffer is now allocated for each read, at most 64 KiB. The
new guest_apr_read_stack test reads on a thread with a 64 KiB stack; with
the stack array it ends in a stack overflow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 13:03:55 +01:00
Werner 8bd8c1c338 test(libkernel): read through APR while 600 guest streams are open 2026-10-19 10:32:45 +02: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