fix(libkernel): report Linux file birth times accurately #2115
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2115"
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 STUPIDCONTEM on 2026-10-09T09:03:38Z.
Evidence review (2026-10-09)
Closed by maintainer; not ready to reopen. Required evidence: Title ID and a log showing a title reads and requires st_birthtim; justify the extra stat syscall cost.
Game/title ID: none verified. No PS5 title execution is claimed.
What
Report Linux file creation time from
statx(STATX_BTIME)instead of copying inode status-change time into guestst_birthtim. The previous value changed when file metadata changed, even though the file had not been recreated.Path and descriptor probes require birthtime plus matching inode/device identity, so a path replacement cannot attach another inode's timestamp to an earlier stat result. The optional probe preserves errno. A guarded
SYS_statxsyscall avoids a new glibc statx-symbol dependency; unsupported headers/kernels/filesystems return the unavailable marker {-1, 0}. Other stat fields and non-Linux behavior remain unchanged.FreeBSD stat(2) distinguishes creation time from status-change time. FreeBSD D31468 documents {VNOVAL, 0} as the unavailable-birthtime convention; VNOVAL is -1. The Linux timestamp comes from the documented statx ABI.
Tested
No PS5 title or hardware run was performed. Conventions, whitespace and registration checks passed.
Checklist
6cc0503d; no other open PR implements Linux birthtime (historical base; current readiness not asserted)Imported from boykopovar/AnyPS5. Originally posted by A-Akhil on 2026-10-09T17:05:27Z.
agc_driver_dcc_keys_first_write(which ctest runs) fails the same way on Linux with NVIDIA's driver, and passes on an Intel GPU in the same machine. It traces to0e1d25a8.Arch Linux (kernel 6.18.54-lts), GCC 16.2.1, Release,
main0fdda7be. GTX 1650 Ti (driver 615.71.09) and Intel UHD (CML GT2, Mesa 26.2.3); the GPU picked withANYPS5_GPU.host imports resolve write protection: yes ... imported ranges are comparedhost imports resolve write protection: no ... imported ranges stay watchedan unchanged pending image was uploaded again(DccKeysFirstWrite.cpp:214)With
APS5_NO_HOST_IMPORT=1the NVIDIA run fails the same way.a8b032b2(0e1d25a8's parent), fails at0e1d25a8alone. That check was added in0e1d25a8, so it's a new expectation that the watched path doesn't meet, not an old test that broke.++tracker.generationinGuestMemory::MarkWrittenback after thewatched/coverscheck gets the NVIDIA run past line 214, but then both GPUs faila pending GPU store within the comparison epoch was missed. The compare path needs the unconditional bump, and on the watched path the same bump appears to makeStorageTexture::Refreshtreat an unchanged pending image as changed.CI probably doesn't see this because its device takes the compared path.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:08:57Z.
Closing: no title is shown reading
st_birthtim, and this adds a second syscall to every stat on Linux to fill it. Please reopen with the title ID and the log line if one depends on it.Imported from boykopovar/AnyPS5. Originally posted by STUPIDCONTEM on 2026-10-10T00:40:47Z.
@A-Akhil Thanks for the detailed before/after and NVIDIA-versus-Intel reproduction. This PR changes Linux file timestamps in NativeStat.cpp and does not modify the AGC image/write-tracking paths in your report. Its host tests do not validate that NVIDIA path, and I am not treating the Intel/software-driver passes as evidence against your failure. The report belongs with the DCC/write-tracking changes identified by your bisect; moving the generation increment is not a verified fix given the second failure you observed. This birthtime PR will remain closed pending the maintainer's separate title-evidence request.
Pull request closed