docs(libkernel): name what FreeBSD and the emulators do for an unaligned sceKernelMunmap length #13866
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13866"
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-10-31T10:14:29Z.
What
Adds one entry to the libkernel technical debt:
sceKernelMunmapfails a length that is not a multiple of the 16 KiB guest page withEINVAL, which was taken over from an earlier throw and which no console run has checked. FreeBSD 11.4'skern_munmap(vm_mmap.c#L535-L542) rounds the address down and the length up instead, shadPS4 and fpPS4 round as well, and KytyPS5 does not check the alignment. The guestmunmapalready rounds like FreeBSD (#10550);sceKernelMunmaphas its own path. The entry does not say which behaviour is right and no code or test changes. Forty of the 53 local titles importsceKernelMunmap.Tested
Documentation only.
tools/check_conventions.py --base upstream/mainpasses. Based onmain809c7fa2df, and it merges withmain2db749ef2ewithout a conflict (checked 2026-10-31 10:12 UTC). I read FreeBSD'svm_mmap.c(the blob matchesrelease/11.4.0) and the three emulators at the commits named in the entry (KytyPS5 5e837a9beac82c031868eaad9348d6a48245fb99, shadPS4 0614ce324be092791b758d79f93d9f1ca5b10a81, fpPS4 04cefd43e6fddd1ab033e7980cd356d14c964905), and ourDoMunmapandmunmap_nid_postfix. Not run: a build or a test, because nothing but the debt file changes.Overlap
Checked on 2026-10-31 against
main809c7fa2dfb1b21e2b31b3114b7d51bc14ee88ab(1591 open pull requests, listed at 06:39 UTC; the merge checks ran from 08:54 UTC to 09:05 UTC). I took the changed files of each fromgit diff --name-onlyagainst its merge base (one ref, #13454, could not be fetched; the GitHub file list shows it does not changedocs/dev/debt/libkernel.md). 92 of them change that file.git merge-treeof this head with each of the 92: 39 conflict, and every one of the 39 also conflicts withmainon its own, so none conflicts because of this entry. I put the line after theLocked memory on macOSentry because, after themincoreentry, it conflicted with #12854 and #11042, which each change a neighbouring line. Checked once more on 2026-10-31 at 09:59 UTC againstmain2db749ef2e: of the 63 pull requests opened since 06:30 UTC, five change that file (#13790, #13798, #13824, #13832, #13854) and none of them conflicts with this entry.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
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T10:16:03Z.
Review: APPROVED
Reviewed — looks good
This documentation-only change accurately distinguishes the current
sceKernelMunmapbehavior from the cited alternatives and does not claim the unmeasured console behavior is settled.What I ran
Reviewed head
d7ce0daa231696bfa8ba305d47789025a0151dadagainst base049619c202f00698b6d559817577726fbeb1ca4d; the merge preview was clean. Environment: Linux x86_64, Python 3.11.2. I ran:Results
Unedited convention check output
Not verified
The precheck's test-quality heuristic could not run because
tools/pr_test_quality.pyis absent from its isolated PR checkout. No build or test was run, and hosted checks were queued. Neither limitation affects this documentation-only diff.