AnyPS5/core/libs/prx/libkernel
raghav314 be1f501525 fix(agc): import GPU-mapped guest memory when it is mapped
The registry calls an observer on the mapping thread, after the registry
lock is released, with the ranges a kernel mapping gave GPU access:
direct and flexible maps with it, and fixed remaps with it over a
registered range (a reservation). The mutation looks them up while it
still holds the lock and hands them over weakly, with the registry
generation it ended at, so the observer does not keep a range alive.
The driver imports those ranges on its current device, so an
address-based build finds the import instead of pinning the memory on
the queue that first uses it. A range that gains GPU access through
sceKernelMprotect, and AnyPS5's own libc heap, are still imported on
first use.

The import at map does not reconcile the other imports with the
registry, so its cost does not grow with the number of imports. It skips
a range that is gone, and any range when the imports were reconciled
with a newer registry since; the next lookup imports those as before.
It installs the pin waiter as the other import paths do, so unmapping a
range imported at map retires its import. The live import bytes are kept as a
running total instead of being summed over every import. Once the import
table belongs to the current device the import takes only the table's
lock; the first import on a device (which runs the write-watch probe)
and a device that was just replaced go through the GPU lock. Clearing
the observer waits for calls already running.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 00:23:23 +02:00
..
Aio/src fix(libkernel): preserve EINVAL in AIO completions 2026-10-10 08:42:19 +02:00
AppMetadata fix(kernel): skip the download0 mount when param.json cannot be read 2026-10-08 16:07:18 +02:00
Apr fix(windows): use precise sleeps for sub-millisecond polling 2026-10-10 08:30:28 +00:00
DirectMemory fix(agc): import GPU-mapped guest memory when it is mapped 2026-10-11 00:23:23 +02:00
Equeue fix(libkernel): report AMPR completion events with the AMPR filter 2026-10-07 19:37:40 -04:00
EventFlag/src feat(runtime): timed waits, sync primitive fixes, heap and RTC fixes, unattended-run switches 2026-09-26 19:00:39 -07:00
File feat(libkernel): implement sceKernelFcntl 2026-10-11 00:06:02 +02:00
Module fix(libkernel): unregister guest module images in dlclose and propagate failures 2026-10-10 10:23:50 +02:00
Pthread Merge pull request #2973 from babyhuey/feat/libkernel-rwlockattr 2026-10-10 23:53:36 +02:00
Semaphore fix(libkernel): accept a zero count in sceKernelSignalSema 2026-10-10 16:12:43 +00:00
Socket feat(libkernel): implement dup and dup2 2026-10-10 15:52:25 +04:00
SyncOnAddress/src feat(libkernel): implement sceKernelSyncOnAddressWait8 and sceKernelSyncOnAddressWait16 2026-10-06 04:30:12 +05:30
System/src feat(libkernel): implement sync 2026-10-10 18:12:21 -04:00
Time feat(libkernel): implement thread cancellation 2026-10-10 11:32:09 +02:00
CMakeLists.txt Merge pull request #1739 from Sanjaysrinivas/test/pthread-cancel-recovery 2026-10-11 00:20:59 +02:00
KernelErrors.hpp refactor(kernel): share SCE kernel error codes through KernelErrors.hpp 2026-09-27 13:32:28 +07:00
Unimplemented.cpp feat(libkernel): implement thread cancellation 2026-10-10 11:32:09 +02:00