feat(libs): add four sysctl MIB mappings and an IME setter #8553

Closed
fishingpvalues wants to merge 7 commits from upstream-pr/8553 into main
fishingpvalues commented 2026-10-20 16:25:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fishingpvalues on 2026-10-20T16:25:37Z.


What

Two small exports that titles actually reach:

  • libkernel: sysctlnametomib now resolves kern.smp.maxcpus, kern.stackprot, kern.sched.name and kern.timecounter.hardware to the MIBs measured on a PS5 (firmware 12.70) payload process: {1, 2147482816, 2147482814}, {1, 2147483151}, {1, 2147483182, 2147483181} and {1, 2147482838, 2147482834}. Payloads that probe these names (e.g. allocator probes) no longer get an exception; sysctl by those exact MIBs still returns -1/ENOENT as measured, and writes throw.
  • libSceIme: sceImeSetConsecutiveClauseConversionEnabled stops throwing and returns 0 for any value. PPSA24191 calls it with 1 before every sceImeOpen and opens the panel only when it returns 0; nothing consumes the flag, so no state is stored.

Tested

macOS (Apple Silicon). Both affected test targets compile in a linux/amd64 container build; running the ctests there fails on unmodified main too because the emulated x86_64 CPU lacks AVX/BMI2 which the guest libs' host-CPU check requires. Verified with a source-level smoke script instead: the four mappings match the measured console MIBs, pre-existing table entries are untouched, the short-buffer/size-query/truncation semantics of sysctlnametomib are unchanged, unknown names still throw, and the IME setter no longer calls NotImplemented_nid_no_patch.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: PPSA24191 (IME setter); the sysctl MIB names are probed by payload processes generally
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4938919930 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8553). Originally posted by [fishingpvalues](https://github.com/fishingpvalues) on 2026-10-20T16:25:37Z. --- ### What Two small exports that titles actually reach: - `libkernel`: `sysctlnametomib` now resolves `kern.smp.maxcpus`, `kern.stackprot`, `kern.sched.name` and `kern.timecounter.hardware` to the MIBs measured on a PS5 (firmware 12.70) payload process: {1, 2147482816, 2147482814}, {1, 2147483151}, {1, 2147483182, 2147483181} and {1, 2147482838, 2147482834}. Payloads that probe these names (e.g. allocator probes) no longer get an exception; `sysctl` by those exact MIBs still returns -1/ENOENT as measured, and writes throw. - `libSceIme`: `sceImeSetConsecutiveClauseConversionEnabled` stops throwing and returns 0 for any value. PPSA24191 calls it with 1 before every `sceImeOpen` and opens the panel only when it returns 0; nothing consumes the flag, so no state is stored. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> macOS (Apple Silicon). Both affected test targets compile in a linux/amd64 container build; running the ctests there fails on unmodified main too because the emulated x86_64 CPU lacks AVX/BMI2 which the guest libs' host-CPU check requires. Verified with a source-level smoke script instead: the four mappings match the measured console MIBs, pre-existing table entries are untouched, the short-buffer/size-query/truncation semantics of `sysctlnametomib` are unchanged, unknown names still throw, and the IME setter no longer calls `NotImplemented_nid_no_patch`. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: PPSA24191 (IME setter); the sysctl MIB names are probed by payload processes generally - [x] GPUs tested: n/a - [x] AI-assisted: yes
fishingpvalues commented 2026-10-20 19:00:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fishingpvalues on 2026-10-20T19:00:43Z.


The Build and Progress report runs show "Action required": the author of this PR has no commit or merged PR in the repository yet, so the pull_request-triggered workflows need a collaborator to approve them (Actions tab of the run, or gh workflow run build.yml --repo boykopovar/AnyPS5 --ref main --field pr=8553).

Everything else is green: Conventions, PR labels, PR intake. The pr-overlap note against #6936 is a benign adjacency in docs/dev/debt/libkernel.md (that PR appends a new line after the one this PR updates; the three-way merge is clean and no exports overlap).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6298824143 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8553#issuecomment-6298824143). Originally posted by [fishingpvalues](https://github.com/fishingpvalues) on 2026-10-20T19:00:43Z. --- The `Build` and `Progress report` runs show "Action required": the author of this PR has no commit or merged PR in the repository yet, so the `pull_request`-triggered workflows need a collaborator to approve them (Actions tab of the run, or `gh workflow run build.yml --repo boykopovar/AnyPS5 --ref main --field pr=8553`). Everything else is green: Conventions, PR labels, PR intake. The pr-overlap note against #6936 is a benign adjacency in `docs/dev/debt/libkernel.md` (that PR appends a new line after the one this PR updates; the three-way merge is clean and no exports overlap).
oneandonlydean commented 2026-10-20 23:19:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T23:19:12Z.


@fishingpvalues Thanks. The four mappings use the MIBs already recorded from the console measurement, and the test table covers them.

One small docs request. With the NotImplemented_nid_no_patch call gone, sceImeSetConsecutiveClauseConversionEnabled is a silent stub: it returns 0 and ignores its argument. CONTRIBUTING.md says a silent stub goes under "Silent stubs" in its library's debt file. Its libSceIme.md entry is still under "Unknown function info". Could you move it under "Silent stubs" (next to sceImeOpen), keeping the text about PPSA24191 and the unknowns? The code needs nothing else.

After that, the bar is a full CI run with guest_system_configuration and guest_ime_parameters passing on Linux and Windows. The Build workflow needs a maintainer to start it for a first-time contributor, and we'll do that.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6303972263 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8553#issuecomment-6303972263). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-20T23:19:12Z. --- @fishingpvalues Thanks. The four mappings use the MIBs already recorded from the console measurement, and the test table covers them. One small docs request. With the `NotImplemented_nid_no_patch` call gone, `sceImeSetConsecutiveClauseConversionEnabled` is a silent stub: it returns 0 and ignores its argument. CONTRIBUTING.md says a silent stub goes under "Silent stubs" in its library's debt file. Its `libSceIme.md` entry is still under "Unknown function info". Could you move it under "Silent stubs" (next to `sceImeOpen`), keeping the text about PPSA24191 and the unknowns? The code needs nothing else. After that, the bar is a full CI run with `guest_system_configuration` and `guest_ime_parameters` passing on Linux and Windows. The `Build` workflow needs a maintainer to start it for a first-time contributor, and we'll do that.
fishingpvalues commented 2026-10-21 06:54:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fishingpvalues on 2026-10-21T06:54:00Z.


Moved sceImeSetConsecutiveClauseConversionEnabled under "Silent stubs" next to sceImeOpen, with the PPSA24191 text and unknowns kept (4dc025bb0). Thanks for starting the Build run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6309993264 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8553#issuecomment-6309993264). Originally posted by [fishingpvalues](https://github.com/fishingpvalues) on 2026-10-21T06:54:00Z. --- Moved `sceImeSetConsecutiveClauseConversionEnabled` under "Silent stubs" next to `sceImeOpen`, with the PPSA24191 text and unknowns kept (4dc025bb0). Thanks for starting the Build run.
harisibrar1 commented 2026-10-24 15:38:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-24T15:38:06Z.

Review: APPROVED


Checked against main b607bfdc8b and FreeBSD 11.4 (sys/kern/kern_sysctl.c, kern_exec.c, subr_smp.c, kern_tc.c, sched_ule.c):

  • The four MIBs match the console values main already records (SystemConfiguration.cpp:115-118 and the libkernel.md entry). FreeBSD 11.4 is consistent with them: all eight nodes are OID_AUTO, and sysctl_register_oid counts OID_AUTO numbers down from 0x7fffffff, which gives values near INT_MAX and children numbered below their parents.
  • sysctlbyname on these names still returns ENOENT through IsUnansweredName, as measured; only the name-to-MIB step changes. The branch merges cleanly.
  • Small description note: since 950a21aec8, unknown names return -1/ENOENT rather than throwing; the code and debt text are already right.
  • Optional: the test declares the IME setter with bool while Export.cpp uses std::uint8_t; matching them would keep the declarations consistent.

Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5638811774 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8553#pullrequestreview-5638811774). Originally posted by [harisibrar1](https://github.com/harisibrar1) on 2026-10-24T15:38:06Z. **Review:** APPROVED --- Checked against main b607bfdc8b and FreeBSD 11.4 (sys/kern/kern_sysctl.c, kern_exec.c, subr_smp.c, kern_tc.c, sched_ule.c): - The four MIBs match the console values main already records (SystemConfiguration.cpp:115-118 and the libkernel.md entry). FreeBSD 11.4 is consistent with them: all eight nodes are OID_AUTO, and `sysctl_register_oid` counts OID_AUTO numbers down from 0x7fffffff, which gives values near INT_MAX and children numbered below their parents. - `sysctlbyname` on these names still returns ENOENT through `IsUnansweredName`, as measured; only the name-to-MIB step changes. The branch merges cleanly. - Small description note: since 950a21aec8, unknown names return -1/ENOENT rather than throwing; the code and debt text are already right. - Optional: the test declares the IME setter with `bool` while Export.cpp uses `std::uint8_t`; matching them would keep the declarations consistent. Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!8553
No description provided.