fix(libkernel_sys): only advance vm map timestamp on map changes #26335
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/26335"
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 malekaifa on 2026-11-23T18:18:35Z.
What
get_vm_map_timestampused the broad guest-allocation registry generation, which advances whenever aGuestAllocations::Mutationscope ends. That made the VM-map timestamp change after read-only registry queries even though no mapping or protection changed.This adds a dedicated VM-map generation while preserving the existing broad generation for graphics/cache users:
get_vm_map_timestampreturns the low 32 bits of that dedicated generation.The regression deliberately opens a read-only registry mutation and proves the broad cache generation advances while the VM-map timestamp stays stable. It also exercises a successful
Mutation::Protect, asserting that the timestamp advances once and remains stable on repeated reads.Firmware 13.60
libkernel_sys.sprxroutes this export to syscall 624. The console timestamp arithmetic itself is still not hardware-validated, and host mappings outside the tracker can still be missed; both limits are recorded in technical debt.Tested
Windows VM, MSYS2 UCRT64 GCC 16.2.0, Ninja, Release, exact head
e22118439b8fb37c59c666953a23882bae741c0a, based on upstreammaind767832b324e025cad10211bfd16f660303f6c68.guest_kernel_sys_vm_map_timestamp_tests,guest_dynamic_loader_tests,guest_memory_tests, andguest_allocations_changes_testsbuilt successfully.guest_kernel_sys_vm_map_timestamp,guest_dynamic_loader, andguest_memorypassed (3/3).guest_allocations_changes_tests: direct execution passed.tools/check_conventions.py --base upstream/main --head HEAD: passed.tools/check_test_registration.py --scripts: passed; 347 test scripts are registered.git diff --check upstream/main...HEAD: passed.21e63db792; it was not rerun after this merge-only main refresh.Hosted PR checks for the refreshed head are pending; no hosted result is claimed here.
Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositorySummary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-23T18:18:45Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-23T18:20:01Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
9bdbb44cdf:tools/check_conventions.pypassed.guest_kernel_sys_vm_map_timestamp_testsbuilt cleanly.guest_kernel_sys_vm_map_timestamp):core/libs/prx/libc/include/GuestAllocations.hpp,core/libs/prx/libc/src/GuestAllocations.cpp,core/libs/prx/libkernel_sys/Export.Discovery.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 PrivacyOnion on 2026-11-23T18:30:10Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
111baa860f:tools/check_conventions.pypassed.guest_kernel_sys_vm_map_timestamp_testsbuilt cleanly.guest_kernel_sys_vm_map_timestamp):core/libs/prx/libc/include/GuestAllocations.hpp,core/libs/prx/libc/src/GuestAllocations.cpp,core/libs/prx/libkernel_sys/Export.Discovery.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 PrivacyOnion on 2026-11-23T19:16:22Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
1d8e1604ff:tools/check_conventions.pypassed.guest_kernel_sys_vm_map_timestamp_testsbuilt cleanly.guest_kernel_sys_vm_map_timestamp):core/libs/prx/libc/include/GuestAllocations.hpp,core/libs/prx/libc/src/GuestAllocations.cpp,core/libs/prx/libkernel_sys/Export.Discovery.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 PrivacyOnion on 2026-11-23T19:36:03Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
2b9ea8ab99:tools/check_conventions.pypassed.guest_kernel_sys_vm_map_timestamp_testsbuilt cleanly.guest_kernel_sys_vm_map_timestamp):core/libs/prx/libc/include/GuestAllocations.hpp,core/libs/prx/libc/src/GuestAllocations.cpp,core/libs/prx/libkernel_sys/Export.Discovery.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 catminou4 on 2026-11-23T22:23:17Z.
Review: COMMENTED
Built
libc,libkernel,libkernel_sysandguest_kernel_sys_vm_map_timestamp_testson Linux (x86-64, GCC 11). The test passes on this branch.The test is meaningful for the actual fix: lines 42-43 assert that a registry mutation bumps
GuestAllocationsGenerationwhileget_vm_map_timestampstays unchanged — i.e. the vm map timestamp no longer moves on non-map changes, which is the point of adding a separatemapGeneration. Reserve/map/munmap/protect each advance it, and failed mutations don't. Nomaincontrol is possible sinceGuestAllocationsMapGenerationis new API, but the branch behaviour is well covered.One thing I confirmed while reading:
GuestAllocationsProtectGpualso callsnoteMapChange, so protection changes advance the timestamp too — the test at line 81 expects that, so it's intentional. LGTM.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T02:49:07Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the review covers all five changed files, but no checks were run in this session.
What I ran
Reviewed head
2b9ea8ab99cda8eaf01d8c00a402d963281f5ad1using the prepared diff and pinned reader. No build or tests were run; results reported in the PR description were not independently verified.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build, tests, convention checks, and console behavior were not run or independently verified. The PR description notes that timestamp arithmetic has not been hardware-validated and that host mappings outside the tracker may be missed.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T09:35:10Z.
Review: COMMENTED
f79a1d96-a7ed-4fed-a58c-41385f1072abReviewing files that changed from the base of the PR and between
0dd6b47978andeb7207cfee.core/libs/prx/libc/include/GuestAllocations.hppcore/libs/prx/libc/src/GuestAllocations.cppcore/libs/prx/libkernel_sys/Export.Discovery.cppcore/libs/tests/GuestKernelSysVmMapTimestamp.cppdocs/dev/debt/changes/fix-libkernel-sys-vm-map-timestamp.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T09:57:29Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the reviewed code supports merging, and the author-reported checks are not checks I ran.
What I ran
Reviewed head
eb7207cfee977754efe57a7ec50cb20e39310e73from the prepared diff and source files usingrepo_read.py. No commands or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not run the reported Windows build, test targets, convention check, diff check, or negative control. I did not verify console timestamp behavior or the claimed firmware syscall routing. The files listed as reviewed in the manifest were all read; no changed files were excluded.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T10:03:29Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
21e63db792a2da7e80b2d069ce7fcb169b046858. I read the prepared description, commit list, manifest, diff, and all five changed files. I did not run commands or tests; the test results in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not rerun the reported Windows VM tests, convention check, diff check, or negative control. Console timestamp arithmetic and host mappings outside the tracker are not hardware-validated, as the description and technical-debt note state.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-27T12:25:08Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
21e63db792:tools/check_conventions.pypassed.guest_kernel_sys_vm_map_timestamp_testsbuilt cleanly.guest_kernel_sys_vm_map_timestamp):core/libs/prx/libc/include/GuestAllocations.hpp,core/libs/prx/libc/src/GuestAllocations.cpp,core/libs/prx/libkernel_sys/Export.Discovery.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me