fix(libkernel): announce sendfile's header and trailer reads #17113
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17113"
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 Meh7an on 2026-11-08T10:23:40Z.
What
sendfilesends its header and trailer vectors from guest memory with::send, withoutGuestArenaPrepareHostRead.write,pwrite, AIO andsendtoall make that call, and the AGC driver's hook behind it lands pending GPU writes before the host reads the bytes. So a header or trailer the GPU just wrote could go out with its older contents.SendIovecsnow announces each vector. The file data in between is read into a host buffer and needs no announcement.sendhas the same gap. It is left to #12700, which adds the call there, so this PR does not repeat it.Overlap: #12688, #12700 and #12965 change the
SendIovecssignature toSocket&, a one-line textual conflict. None of them announces the vectors.tools/pr_overlap.pycould not auto-compare 8 PRs touchingUdp.cppbecause they conflict with main; I read those diffs forSendIovecs,SendAllandsendfile_nid_postfix.Tested
Windows 11, no title run.
guest_sendfilegains a check that the host-read hook is called with each header and trailer vector: it aborts without this change (0xc0000409) and passes with it. Together with it, the 33 ctests matchingguest_sendfile|guest_.*socket|guest_host_readpass.Built and tested on main
0f147e329f, then rebased onto990481cdbf.SendIovecsand the test file are unchanged between those commits; the tip itself was not built here because it needs the new3rdparty/curlsubmodule. Not tested on Linux or macOS.Rebased onto main
1f56d72520(2026-11-29). The only conflict was main's newSendIovecs(Socket&, ...)signature, which the change now uses; the added line is unchanged. On that base the 35 ctests matching^(guest_sendfile|guest_socket_.*|guest_kernel_socket_.*)$pass, andguest_sendfilestill aborts (0xc0000409) without the added line.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-08T12:31:59Z.
Review: COMMENTED
Windows run of head
2dbe0dd86d, merged ontomain105c9e4d91(clean merge). Thatmainalready has3rdparty/curl, so this is a build of the tip itself, which the description says wasn't built.Setup: Windows 11, WinLibs GCC 15.2 (
x86_64-ucrt-posix-seh), Release, full build withBUILD_TESTING=ON.-R 'guest_sendfile|guest_.*socket|guest_host_read': 33 / 33 in each of 3 runs.main'sUdp.cppand this PR's test:guest_sendfileaborts 3 / 3 with0xc0000409. The other files were left as they were, and the PR'sUdp.cppwas put back and rebuilt afterwards.From reading the code:
GuestArenaPrepareHostRead_nid_no_patchreturns early for a null base or a zero length, so header and trailer entries like{nullptr, 0}stay safe. Each vector is announced right before its ownSendAll, so a vector after a failed send isn't announced. That's fine, since it isn't read either.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T12:02:40Z.
Review: COMMENTED
Reviewed — no blocking findings
The change at head
2dbe0dd86df368e67fff4da0355f0a4be404d28ecorrectly announces each sendfile header and trailer vector before sending it; runtime checks were not run in this review.What I ran
Read the prepared description, commit list, manifest, diff, and both changed files at the pinned head. Used
repo_read.pyto inspectSendIovecs, its callers, and the host-read hook implementation. No build or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author reports the targeted ctests and negative control passed on Windows 11, but those results were not independently verified. The tip was reportedly not built; Linux and macOS behavior was not tested. Both changed files listed in
manifest.jsonunder reviewed were read. No files were excluded by the manifest.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-29T09:30:05Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the diff announces each sendfile header and trailer vector immediately before sending it, and the added test checks that all three vectors reach the host-read hook.
What I ran
Reviewed head
9183c6a0e8d2a4efc4a733c62e44949e07d48514. I readreview/description.md,review/commits.md,review/manifest.json,review/diff.patch,core/libs/prx/libkernel/Socket/src/Udp.cpp(lines 3330–3500),core/libs/tests/GuestSendfile.cpp(lines 1–100), andcore/libs/prx/libc/src/GuestArena.cpp(lines 1035–1070). Both changed files listed in the manifest were read.files.jsonwas unavailable. No commands or tests were run; the test results in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The reported Windows 11 ctest results, behavior on Linux and macOS, and execution on a physical console were not independently verified. No repository files were excluded according to the manifest;
files.jsonwas unavailable.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T13:09:08Z.
Review: COMMENTED
Built the changed sources and ran
GuestSendfileon Linux against the existing runtime. The fixture passed, including the header and trailer payload and read-announcement checks.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-03T15:48:15Z.
Review: APPROVED
I read the diff at
9183c6a0e8. Windows 11 with GCC 15.2 and Linux (Ubuntu 24.04 in WSL2, GCC 13.3), merged intomainatc1593e4e1ddtogether with other open PRs (so not an isolated build).guest_sendfile: pass on both.main's): it fails.Not checked: a title.
AI-assisted: yes (Claude Code)