AnyPS5/core/libs/prx/libc
alfalfa-star 815d274736 feat(agc): import shared direct memory through udmabuf on Linux
On Linux, direct memory is a memfd mapped MAP_SHARED. amdgpu accepts only
private anonymous memory for a host pointer import (libdrm sets
AMDGPU_GEM_USERPTR_ANONONLY), so every import of direct memory failed with
VK_ERROR_INVALID_EXTERNAL_HANDLE and its ranges were copied.

When a host pointer import fails, the range's memfd slice is turned into a
dma-buf through /dev/udmabuf and imported with VK_EXT_external_memory_dma_buf.
The direct memory backing is sealed against shrinking and growing, as
udmabuf requires. libkernel reports the backing of a guest range through
GuestArenaSharedBacking. Without /dev/udmabuf, or past its size limit, the
range is copied as before. APS5_TRACE_HOST_IMPORT now prints the mappings
behind a failed import on Linux too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 23:09:16 +02:00
..
include feat(agc): import shared direct memory through udmabuf on Linux 2026-10-07 23:09:16 +02:00
src feat(agc): import shared direct memory through udmabuf on Linux 2026-10-07 23:09:16 +02:00
CMakeLists.txt test(libc): match the immortal classic locale and run guest_locale in ctest 2026-10-07 00:00:12 -03:00
Export.cpp feat(libc): implement std_execute_once 2026-10-06 13:11:41 +03:00