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 <noreply@anthropic.com>
This commit is contained in:
Pacuka
2026-09-26 11:15:16 +02:00
parent 998605fe4e
commit d15e93681f
@@ -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;
}