fix(libkernel): report is_committed from sceKernelVirtualQuery only for direct memory, as a PS5 does #22013
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22013"
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 brajankw on 2026-11-17T01:32:38Z.
What
sceKernelVirtualQuerysetis_committedfor every registered or host-queried range. A PS5 payload (firmware 13.590.001) reports it only for direct memory, and 0 for flexible memory whether touched or not, stacks, images and reservations (thesceKernelVirtualQuery size and flagsentry indocs/dev/debt/libkernel.md, which left it becausemincoreread the field).QueryVirtualRangesetsis_committedonly for a direct mapping; host-queried memory (stacks, the title's own heap) now reports 0 too.mincorewas the only reader: it usedis_committedto tell a mapping from a reservation. It now asksGuestReservationdirectly, so every mapped page is still resident and a reserved page is not.GuestMemory.cpp: flexible pages and a stack address reportis_committed0; the 72-byte wire layout's flag byte is0x01(flexible) for flexible memory;mincoreover a direct page followed by a reserved one gives1, 0, also after the direct page is set to protection 0, which still reportsis_committed; pages of the registered main image (a static global and a function) report neither committed, flexible nor direct. The existingmincorechecks on anonymousmmapmemory still expect 1.is_committedgap from the entry and notes that pooled memory was not measured.Tested
Linux (Debian 13, GCC 14.2.0, Release). Head
8f161a08b2, rebased ontomain11c9e7764ewithout conflicts. The runs after the first two bullets are from the earlier head onmainab5089590a.8f161a08b2, merged with #22046 and #22049 ontomain11c9e7764e:ctest -R '^(guest_sysarch|guest_memory|guest_mmap_fixed_anonymous|guest_virtual_query_arguments|np_uds_events|guest_np_uds_.*|guest_np_trophy_.*)$': 16 passed, andguest_mmap_executableskipped itself (exit 77) in this environment. This head adds Helldiverr's two pins.is_committedfor anything not flexible failsguest_memoryat the new image check;mincoretreating protection 0 as not resident fails it at the new protection-0 check.ctest -R '^guest_memory$': passed.main'sExport.cppandPosixMemory.cppand this branch's test,guest_memoryfails at the first flexible-memoryis_committedcheck.ctest(5893 tests,-j 12) with this branch merged together with my other three branches of this batch: 5877 passed. The 16 failures are the set that fails onmainin the same environment: sixagc_drivercases (agc_driver_image_table_packed_guardspasses when run on its own) and ten that need a.gitdirectory, network or a passwd entry for the user.python3 tools/check_conventions.py --base origin/main: passed.python3 tools/pr_overlap.py --branchat8f161a08b2: no conflicting pull request. #18190 and #21569, which conflict withmain, shareExport.cpp,PosixMemory.cpporGuestMemory.cppand could not be compared; #18190 only renamesmincore's export (a textual conflict, not a behaviour one), and #21569 changes neitheris_committednormincore.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)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-17T01:35:54Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
b56a3a67ac:tools/check_conventions.pypassed.guest_memory_testsbuilt cleanly.guest_memory,guest_mmap_fixed_anonymous,guest_mmap_executable):core/libs/prx/libkernel/DirectMemory/Export.cpp,core/libs/prx/libkernel/DirectMemory/PosixMemory.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T03:58:07Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the inspected code implements the reported direct-memory-only
is_committedbehavior and checks reservations directly inmincore.What I ran
Reviewed head
b56a3a67ac1125908dd341621250c28c23578a5d. No commands or tests were run in this review;repo_read.pywas used to inspect the prepared diff and targeted source ranges. The description reports Linux checks, which were not run by me.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full text of all four changed files was read, as shown in
manifest.json. The behavior of the PS5 payload, title process, pooled memory, Windows and macOS, and author-reported test results were not independently verified. Excluded files: none are listed in the prepared manifest;files.jsonwas not available through the reader.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T11:35:53Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the reviewed implementation and focused regression checks support the reported
is_committedbehavior.What I ran
Read the prepared diff and relevant changed code at head
8f161a08b244649aff5725ca22a64dceb40be8c2, plusGuestReservationand its callers. No commands or tests were run;repo_read.pywas unavailable as a runnable command in this interface.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No tests were run independently. Windows and macOS behavior and console behavior were not verified. Read:
core/libs/prx/libkernel/DirectMemory/Export.cpp,core/libs/prx/libkernel/DirectMemory/PosixMemory.cpp,core/libs/tests/GuestMemory.cpp, anddocs/dev/debt/changes/fix-libkernel-virtual-query-committed-direct-only.md. The manifest lists all four as included; no changed files were excluded.To get this to a good state
Nothing is required.