AnyPS5/core/libs/prx/libc/include
Dean Galvin bb1531fc34 fix(agc): consume the write-watch faults of the driver's own CPU stores
A store the driver makes with the CPU into watched guest memory (a
GuestMemory::Write, a changed-bytes write-back, a completion action's label
store, the copy HLE's CPU path) faults its pages dirty in the write watch and
stamps the range with MarkWritten. The faults stayed behind: collects are
memoized per packet, so the next walk over those pages came later and stamped
them again, as a CPU write made after every check in between.

PPSA21564 fast-clears its normal G-buffer every frame with a register DCC key
fill on the GPU. While that fill is still pending, the first draw into the
target materializes the clear with a CPU store of the clear texels and a
refresh of the resident image. A dozen draws later a walk found the store's
faults, the target read as changed, and the image was uploaded again from
guest memory, dropping the draws recorded in between. Lighting then sampled
cleared normals and the level's moon and rocks went unlit in about half the
frames.

The driver's stores now consume those faults themselves: a walk before the
store stamps earlier CPU writes as such, a walk after it takes the store's
own faults as a driver store, and the range is stamped as before.

On Windows the arena's range also holds host regions that were already in
use when it was reserved (heaps, thread stacks). They are not write-watched,
so a store into one is stamped as before, without a walk.
2026-10-04 11:36:05 +13:00
..
exceptions refactor(libs): use local cmakelists in libc 2026-09-11 12:22:19 +03:00
general refactor(agc): make frame timing logs optional by cmake option 2026-09-28 10:51:29 +03:00
specifics feat(libc): operator new/delete, bounds-checked functions, char locale facets and runtime helpers 2026-09-28 14:22:48 +13:00
ApplicationHeap.hpp feat(libc): implement RaiseEv, catchReturnFromMain and reallocalign 2026-09-30 23:55:00 +00:00
CpuTopology.hpp feat(runtime): timed waits, sync primitive fixes, heap and RTC fixes, unattended-run switches 2026-09-26 19:00:39 -07:00
FileStream.hpp feat(libc): support C locale wide stream input 2026-10-01 11:59:11 +03:00
General.hpp fix(savedata): the native module keeps save directory params and mounts at /savedata<N> 2026-09-30 08:23:02 +03:00
GuestAllocations.hpp fix(libkernel): unmap ranges that span several mappings 2026-09-30 10:54:47 +02:00
GuestArena.hpp fix(agc): consume the write-watch faults of the driver's own CPU stores 2026-10-04 11:36:05 +13:00
GuestDirectory.hpp feat(libc): translate guest directory enumeration 2026-09-25 06:41:55 +10:00
GuestHeap.hpp feat(libc): implement RaiseEv, catchReturnFromMain and reallocalign 2026-09-30 23:55:00 +00:00
GuestLocale.hpp feat(libc): replace guest locale implementation with std::locale 2026-09-27 11:43:42 +03:00
GuestWriteWatch.hpp feat(agc): track guest memory writes on Linux with async userfaultfd write protection 2026-10-01 00:08:08 +13:00
HeapDiagnostics.hpp feat(libc): implement heap trace info 2026-09-27 11:43:36 +03:00
HostThreadLocal.hpp fix(agc): preserve recorder buffers through Windows thread teardown 2026-09-28 09:55:01 +10:00
PreciseWait.hpp refactor: strip explanatory comments to match repo conventions 2026-09-29 04:18:04 +03:00
Shutdown.hpp fix(kernel): orderly shutdown when closing the display window 2026-09-28 18:30:34 +03:00
VarArgsAbi.hpp refactor(libc): separate platform and compiler specifics in libc 2026-09-06 12:41:33 +03:00
WindowsFormatting.hpp style: drop the branch's code comments per CONVENTIONS.md 2026-09-29 21:25:29 +03:00
WindowsMappings.hpp fix(libkernel): read, pread, AIO and APR write into guest memory as host writes 2026-10-01 18:56:36 +02:00
WindowsScanning.hpp fix(libc): reject unsupported format extensions explicitly 2026-10-01 12:00:50 +03:00
WindowsWideFormatting.hpp fix(libc): reject unsupported format extensions explicitly 2026-10-01 12:00:50 +03:00