fix(libkernel): stage Windows APR reads through host memory #6449
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6449"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Izamaru on 2026-10-15T16:00:25Z.
What
On Windows, read APR file data into a bounded 64 KiB host buffer and copy it into the destination in user mode. A direct stream read can fail when writing the destination needs the process's page-fault handler; the CPU copy can take that handler. Keep the existing
HostWriteprotection checks, short-read validation and zero-fill at EOF. Other platforms keep their existing read path.Add synthetic tests for large and unaligned reads, host and direct-memory destinations, chunk boundaries, EOF, missing files, unseekable offsets and read-only guest memory. The Windows regression reserves a destination and commits its pages through a vectored handler on CPU writes. With the original APR implementation from main
0029e62f974c453a5f6c7333f3bdb13e770e3903, that case fails with an APR read error; with this change it passes. All file contents are generated by the test.Tested
Windows x86-64, supported MinGW-w64 GCC 15.2.0, Release:
libc,libkernel,libSceAmprand the test targets using the normal project CMake configuration.guest_apr_read_*cases plusguest_ampr_markers,guest_ampr_threadsandguest_ampr_cpp_error.To run after configuring with
BUILD_TESTING=ONas described indocs/dev/BUILD.md:Checklist
main; no other open PR implements the same functionsImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T16:37:03Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txt