fix(libSceAgc): write the console's poll and cache control words in sceAgcDcbAcquireMem #16855
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16855"
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 xXPBSXx on 2026-11-07T18:26:25Z.
What
sceAgcDcbAcquireMemdivided the poll cycles by 40 and wrote the cache control as given. On a PS5 the poll word is the poll cycles shifted right by four, and bit 14 of the cache control also sets bit 15 in the control word. It now does the same.sceAgcAcbAcquireMemwrites the same packet through this call, so its poll word changes too; it was not measured on its own. The size, address and engine words already matched. A poll of 0x100000 or more (the shifted value above 0xffff) is written as 0xffff on the console, without an error, so it is saturated here at 0xffff (before: it threw above 0x27ffff); a poll of exactly 0xfffff andsceAgcDcbWaitRegMemwere not measured. The title call sites checked have a constant poll of 0x190; about 190 sites do not load the poll as a constant and were not checked. The console's other differences (a size of 1 << 40, an unbounded size, thecbDbOpbits) are not changed here and are listed in the debt entry.Tested
Measured on a PS5 with firmware 11.60 (
kernel_get_fw_version0x11600005), from a homebrew payload process (ps5-payload-sdk v0.45, elfldr) that only builds packets in its own memory, on 2026-11-06 at 20:55 UTC and 22:26 UTC; the console's own clock read about 1 h 41 min more (see the first comment). A title process may differ.sceAgcDcbAcquireMem(cb, 0, 0, 0x4380, 0x100000, 0x1000, poll)word 6mainbeforemainbeforeThe test
agc_commandsnow checks 18 poll values and 15 cache control values from the measurement, and thatsceAgcAcbAcquireMemsaturates the same way. On Ubuntu 24.04 under WSL2 with GCC 13.3.0 and an AddressSanitizer build, onmain72a1308d27the test commit alone fails ("acquire packet does not round its range outward to 256 bytes"), and with the fix commit on the samemainagc_commandsandagc_initializationpass. The five polls above 0xfffff were measured on 2026-11-09 at 22:33 UTC (probe in the second comment); on head8dd63f39a2the new test commit alone fails ("acquire poll interval overflow") and passes with the fix commit.tools/check_conventions.py --base upstream/mainpasses.Overlap: the open pull requests that change
DcbFlow/src/Memory.cpp,tests/Commands.cppordocs/dev/debt/libSceAgc.mdwere checked on 2026-11-07 between 18:05 UTC and 18:19 UTC againstmain07c8408713(the base of this change is the older72a1308d27; it still merges without a conflict): six pull requests, found by listing all open pull requests by update time. #12315 and #14212 already conflict withmainwithout this change, and #14212 also conflicts indocs/dev/debt/libSceAgc.mdwith this change, because it adds a blank line between every entry. #16197 (emit a 2^40-byte acquire range as whole address space) conflicts inDcbFlow/src/Memory.cpponly with this change, because both edit the same function,sceAgcDcbAcquireMem: it changes how the size is rounded and when the whole address space is written, this change the poll and cache control words, which are different lines. Whichever merges second needs a small rebase. #16194, #8314 and #16334 merge cleanly with and without this change. Re-checked on 2026-11-10 at about 06:10 UTC againstmain53bb992782(this head merges into it without a conflict): of the open pull requests that change these files, #12315 and #14212 conflict withmainwithout this change as well, and #16987, #17613 and #17742 merge cleanly with and without it; #16197, #16194 and #16334 have merged since.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)AI-assisted (Claude Code).
🤖 Generated with Claude Code