From d15e93681fe22f47f7beff8fc37c2be339d1281a Mon Sep 17 00:00:00 2001 From: Pacuka <69674426+Pacuka@users.noreply.github.com> Date: Sat, 26 Sep 2026 11:15:16 +0200 Subject: [PATCH] fix(kernel): map SCE protections to readable host pages SCE_KERNEL_PROT_CPU_RW (0x02) and CPU_EXEC (0x04) include read access, but were translated to write-only and execute-only host pages. GPU read and write bits also need host access because the emulated GPU reads and writes guest memory from the CPU. Write-only mappings made the AGC driver reject guest data segments as unreadable. Co-Authored-By: Claude Opus 5.5 --- core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp b/core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp index 69be5eb95..9c74f54c9 100644 --- a/core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp +++ b/core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp @@ -66,9 +66,9 @@ int LinuxProtFromSce(int prot) { throw std::invalid_argument("Unsupported memory protection bits"); } int result = PROT_NONE; - if (prot & 1) result |= PROT_READ; - if (prot & 2) result |= PROT_WRITE; - if (prot & 4) result |= PROT_EXEC; + if (prot & 0x13) result |= PROT_READ; + if (prot & 0x22) result |= PROT_READ | PROT_WRITE; + if (prot & 4) result |= PROT_READ | PROT_EXEC; return result; }