Skip to content

feat(relinker): support short scalar guest GS instructions - #11661

Open
Felipebmaitan wants to merge 27 commits into
boykopovar:mainfrom
Felipebmaitan:feat/windows-guest-gs-short
Open

Felipebmaitan wants to merge 27 commits into
boykopovar:mainfrom
Felipebmaitan:feat/windows-guest-gs-short

Conversation

@Felipebmaitan

@Felipebmaitan Felipebmaitan commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What

Replay supported three- and four-byte scalar GS memory instructions on Windows by borrowing complete neighboring instructions until the replacement jump fits. Scalar memory followers use the existing protected replay frame without adding GS; bounded register operations, RIP-relative LEA and direct Jcc/JMP use relocated native copies. A libc continue handler resumes borrowed instructions at their replay locations while faults retain their original guest positions. Retrying a repaired follower fault does not repeat the completed GS operation. Normal executable startup and guest-module initialization require the continuation-capable runtime before guest code runs.

Depends on #11628, including its maintainer-requested UD2 fallback changes at 87ef2af. Unsupported GS forms and short instructions with unsupported neighbors retain main's UD2/NOP fallback; unused forms do not block conversion. Entries or branches inside the original GS instruction and relocations touching its own bytes retain the existing conversion refusals. Borrowed-span conflicts use the own-length UD2 fallback described below. No SSE/VEX feature is included.

Both requested adversarial reviews completed against the preserved initial PR 3 commit ef76113. This final branch fixes their two confirmed findings: C6/C7 followers require MOV /0, preventing XBEGIN/XABORT or reserved groups from being copied as ordinary scalar code; short borrowing is disabled for independently decoded overlapping GS/state streams, including a GS instruction entered beyond the overwritten bytes inside a borrowed MOVABS immediate. Regressions cover executable and guest-module paths and preserve safe suffix-entry controls. The RTM finding was proven from the emitted abort displacement; no RTM execution is claimed on this AMD host.

Main remains the intended target. Incremental review starts at the published #11628 head: Felipebmaitan/AnyPS5@914c450...feat/windows-guest-gs-short . The main-target diff includes that unmerged prerequisite stack. Merge order is #11624, #11090, #11276 and #10518 before #11628, then this PR. Their exact heads remain ancestors with original authorship; this PR requests no changes to those contributors' work and does not claim their agreement. Current main abed035 is also merged; #11276 is now merged upstream. No comments or messages were posted to other contributors.

Review follow-up at 199f953a4f26fe08b3a5bfb6267e76e72ad8396e: #11628's address-size execution regressions now belong to the scalar prerequisite itself and have been propagated here. Current main b986c11 is merged. This merge preserves the reviewed guest-GS feature source and tests at bd67c1b; no feature-source changes were needed. Fresh independent component validation passed on Windows and Linux, including the own-length fallback, ordinary relocation preservation, empty discarded metadata/dependency, existing original-instruction entry refusals and valid replay records before/after a pruned candidate. All 70 normalized Windows/native Linux execution dumps match. No performance claim or paired title captures are available or claimed.

Collaborator integration follow-up at 339b7e0fd9bafe4bccbebb27777bb05752534b46: current main 20cfe35 is now an ancestor, including the merged #11090 entry-root protection (33b48ba). The immediate prerequisite is now 00cfc900d6c4feeefc6ac109ea674ee5ca54f939, carrying #11624's removal of the two Windows FS refusal assertions. The production FS refusal and guest-GS behavior remain unchanged. The existing pre-patch GS entry-root checks and regression registration are retained. Fresh production libc/libkernel component builds passed on Windows and Linux/WSL, followed by 9 Windows and 8 Linux selected runtime/relinker checks; each completed within 30 seconds. #11090 and #11276 are merged upstream; #10518 and the remaining declared prerequisites still apply. No console/title or performance verification is claimed.

Tested

Windows x86-64 WinLibs GCC 15.2.0 UCRT and native Linux x86-64 WSL GCC 13.3.0; synthetic ISA and emitted-program fixtures, no PS5 or title execution.

  • 55 focused Windows relinker tests passed, covering GS execution, fallback, entry roots, branch targets, relocation rejection, fixed-ES decoding, TLS, imports and guest modules.
  • Complete production libc/libkernel component builds and runtime tests on Windows and Linux. Seven Windows runtime/startup tests passed, including direct emitted executable startup, an imported guest function whose result depends on its GS initializer running, missing/state-only/replay-only runtime diagnostics, and per-thread sysarch/inheritance tests. Sixty focused Linux runtime/relinker tests passed. Every selected test finished within 30 seconds locally. After the fallback change and current-main integration: 55 focused Windows relinker checks, 7 Windows production-runtime/startup checks, and 7 Linux production-runtime/relinker checks passed. All 70 normalized Windows/native Linux execution dumps match exactly.
  • 70 rewritten Windows execution fixtures match native Linux GS results, observed memory, arithmetic/direction flags, scratch registers, XMM state and red-zone sentinels. Repaired load/store/atomic faults cover the GS operation and borrowed followers; the locked follower regression checks that retry does not repeat the preceding GS increment. Four-thread short and long atomic tests each reach the expected count of 512.
  • New C6/C7 regressions preserve valid /0 register MOV followers, retain UD2 for transactional followers, leave their bytes intact and execute programs that skip unsupported code. Overlapping scalar, vector and GS-state entry regressions cover executable and guest-module conversion. Relocations in borrowed operands beyond the five overwritten bytes retain the original GS trap and the ordinary relocated follower bytes.
  • Address-size-32 non-SIB ModRM 00/101 cases cover zero, negative, unaligned and store forms with native Linux comparison. A separate native probe confirmed EIP-relative addressing for this encoding; no ISA change was made from an untested interpretation of the review comment on feat(relinker): execute supported scalar guest GS accesses on Windows #11628.
  • The normal full-project configure was attempted and remains blocked by missing SDL2/ffmpeg-core sources. Successful production libc/libkernel component builds are not a claim that the full graphics/media build passed. Pre-existing submodule changes were excluded.
  • Conventions against origin/main, public-header audit and whitespace checks passed. Live overlap results and remaining comparison limits are attached below. No performance, console or title-unblock claim.

Maintenance validation (2026-10-29): exact head 1358bef8f5c8e28a2af940250b8d7e63a68e911b, including main 1189ec3003672bb364dd9f3119ead7b3976e3c83. Complete production libc/libkernel component builds and 11 selected Windows / 8 Linux/WSL runtime/relinker checks passed independently for this layer, each under 30 seconds. Conventions passed against origin/main. Linux follow-up layers used immutable commit snapshots and separate native WSL build outputs. Full graphics/media configuration remains blocked by missing SDL2/FFmpeg sources; no PS5, title or speed verification. Maintainer changes are preserved.

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: feat(relinker): execute supported scalar guest GS accesses on Windows #11628
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
Live overlap scan and comparison limits

No overlaps were reported in compared regions. For otherwise-uncomparable branches, file-level three-way comparisons checked 38 shared incremental files across 27 PRs against this head and the #11628 prerequisite baseline. None became newly conflicting from PR 3. Existing stale documentation/build conflicts remain; #10861's source/API changes merge at file level, while its old GS debt wording conflicts with the prerequisite replay debt. These checks do not claim full combined runtime validation of stale branches.

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 3986 core/libs/prx/libkernel/Pthread/src/Thread.cpp
PR 4563 core/libs/prx/libkernel/Pthread/src/Thread.cpp
PR 4630 core/libs/prx/libkernel/System/src/Exception.cpp
docs/dev/debt/libkernel.md
PR 5021 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libkernel/Pthread/src/Thread.cpp
core/libs/prx/libkernel/System/src/Exception.cpp
core/libs/prx/libkernel/System/src/Process.cpp
core/relinker/CMakeLists.txt
docs/dev/debt/libc.md
docs/dev/debt/libkernel.md
docs/dev/debt/relinker.md
PR 6149 docs/dev/debt/libkernel.md
PR 6713 core/libs/prx/libc/CMakeLists.txt
core/relinker/CMakeLists.txt
core/relinker/elfpatcher/src/windows/WindowsPePatcher.cpp
docs/dev/debt/libc.md
PR 6936 docs/dev/debt/libkernel.md
PR 7081 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 7088 docs/dev/debt/libkernel.md
PR 7105 docs/dev/debt/libkernel.md
PR 7121 docs/dev/debt/libkernel.md
PR 7149 core/libs/prx/libkernel/Pthread/src/Thread.cpp
docs/dev/debt/libkernel.md
PR 7192 core/libs/prx/libc/src/specifics/windows/CrashReport.cpp
core/libs/prx/libkernel/System/src/Exception.cpp
docs/dev/debt/libkernel.md
PR 7201 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libkernel/Pthread/src/Thread.cpp
core/libs/prx/libkernel/System/src/Exception.cpp
core/libs/prx/libkernel/System/src/Process.cpp
PR 7386 docs/dev/debt/libc.md
PR 7447 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
docs/dev/debt/libkernel.md
PR 7509 docs/dev/debt/libkernel.md
PR 7544 docs/dev/debt/libc.md
PR 7648 docs/dev/debt/libc.md
PR 7715 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 7804 core/libs/prx/libkernel/Pthread/src/Thread.cpp
core/libs/prx/libkernel/System/src/Process.cpp
docs/dev/debt/libkernel.md
PR 7851 core/libs/prx/libc/CMakeLists.txt
PR 8150 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8592 core/libs/prx/libkernel/Pthread/src/Thread.cpp
core/libs/prx/libkernel/System/src/Exception.cpp
PR 8605 docs/dev/debt/libkernel.md
PR 9156 docs/dev/debt/libkernel.md
PR 9162 core/libs/prx/libkernel/System/src/Process.cpp
PR 9199 docs/dev/debt/libkernel.md
PR 9284 docs/dev/debt/libkernel.md
PR 9293 docs/dev/debt/libkernel.md
PR 9297 docs/dev/debt/libkernel.md
PR 9302 docs/dev/debt/libkernel.md
PR 9326 docs/dev/debt/libkernel.md
PR 9371 docs/dev/debt/libc.md
PR 9389 docs/dev/debt/libkernel.md
PR 9447 docs/dev/debt/libc.md
PR 9491 docs/dev/debt/libkernel.md
PR 9526 docs/dev/debt/libc.md
PR 9557 docs/dev/debt/libkernel.md
PR 9566 docs/dev/debt/libkernel.md
PR 9575 docs/dev/debt/libkernel.md
PR 9772 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 9775 core/libs/prx/libc/CMakeLists.txt
PR 9863 docs/dev/debt/libc.md
PR 9929 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libkernel/System/src/Process.cpp
docs/dev/debt/libc.md
PR 9947 docs/dev/debt/libkernel.md
PR 10319 docs/dev/debt/libkernel.md
PR 10324 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 10442 docs/dev/debt/libkernel.md
PR 10479 docs/dev/debt/relinker.md
PR 10552 docs/dev/debt/libkernel.md
PR 10558 docs/dev/debt/libkernel.md
PR 10749 docs/dev/debt/libc.md
docs/dev/debt/libkernel.md
PR 10861 core/relinker/CMakeLists.txt
core/relinker/elfpatcher/src/windows/WindowsGuestModuleWriter.cpp
core/relinker/elfpatcher/src/windows/WindowsPePatcher.cpp
core/relinker/elfpatcher/src/windows/WindowsTlsBuilder.cpp
docs/dev/debt/relinker.md
PR 10970 core/relinker/CMakeLists.txt
docs/dev/debt/relinker.md
PR 10983 core/relinker/CMakeLists.txt
docs/dev/debt/relinker.md
PR 11002 docs/dev/debt/libkernel.md
PR 11042 docs/dev/debt/libkernel.md
PR 11061 docs/dev/debt/relinker.md
PR 11085 docs/dev/debt/libkernel.md
PR 11107 core/relinker/CMakeLists.txt
docs/dev/debt/relinker.md
PR 11215 docs/dev/debt/libkernel.md
PR 11223 docs/dev/debt/libkernel.md
PR 11264 docs/dev/debt/libkernel.md
PR 11267 docs/dev/debt/libkernel.md
PR 11332 docs/dev/debt/libc.md
PR 11341 core/libs/prx/libkernel/System/src/Process.cpp
docs/dev/debt/libc.md
docs/dev/debt/libkernel.md
PR 11366 core/relinker/CMakeLists.txt

lulebo and others added 12 commits October 24, 2026 16:31
…ower of two

ElfReader accepted any p_align on an executable's PT_LOAD, and on the
uncovered PT_SCE_RELRO it turns into one, although the gABI says
p_align should be 0, 1 or a power of two. When such a segment starts
on a page that an earlier segment maps with other bytes, the Linux
patcher pads the output one byte at a time to the next offset
congruent to its address modulo that alignment: a 3221-byte executable
with an alignment of 0xfffffffffffffffb ran for 46 s, reached 12.9 GiB
and failed with std::bad_alloc. Both segments are now refused, as the
reader already refuses a PT_TLS alignment that is not a power of two.

The guest module reader takes its headers from the same function, so
the power-of-two half of its own alignment check can no longer fail
and is dropped; its offset congruence check stays. A power-of-two
alignment still reaches the padding, which the relinker technical debt
now records.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code and test review of the incremental #11628..#11661 changes did not find a confirmed defect. I cannot approve the performance claim/evaluation without the required paired captures, though.

Please provide all of the following from the same title, scene, and machine:

  • The aps5-summary.jsonl line for main and the line for this change.
  • Both trace files attached to the PR.
  • The output of python3 tools/trace_digest.py <trace> for each trace.

The current PR description reports synthetic relinker/runtime correctness tests, but contains no performance captures or digest output. Until this evidence is available, the performance impact is unverified. At the time of review, conventions, intake, eligibility, Ubuntu relinker, ASan, register-context and macOS write-watch checks passed; Windows relinker and several macOS jobs were still pending. This review covers the incremental changes after #11628; the prerequisite remains independently reviewable.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Thanks, borrowing the following instructions to fit the jump is a neat way to cover the short forms, and keeping the own-length UD2 when a follower can't be moved is right. One change, same as on #11628: when the borrowed span would cover a branch target or entry point, a relocated operand, or an overlapping instruction stream, please take that same UD2 fallback for the GS instruction instead of failing the conversion. Today those inputs convert on #11628 (the GS instruction becomes a 3-byte UD2), and with this PR they exit 2. A jump to the instruction right after a short GS load is ordinary code. Branch targets are only complete after the scan, so the fallback probably belongs in the final loop before patchGsInstruction, dropping that trap's .ggs/.ggm records. The overlap check also fires for GS instructions in an overlapping stream when no short replay is involved; #11628 skips those, so please keep that. In test_windows_guest_gs_short.py, cases 41-85 would then assert exit 0 and the UD2 bytes rather than the refusals, and the relinker.md line would change to match.

@MarcZX10

Copy link
Copy Markdown
Contributor

I checked the base #11628 builder before assessing this. One nuance for the requested fallback and regression tests: a relative branch target inside the base's five-byte replacement jump already fails with Branch enters a guest GS instruction, and an executable entry root in that span already fails with GS trap would overwrite an executable entry point; those are not newly introduced conversion failures in this PR. By contrast, the base only calls RequireNoRelocation for the original GS instruction's bytes, so relocations in newly borrowed follower bytes are a distinct risk that this PR correctly detects rather than letting the relocation overwrite the replacement jump.

I agree the fallback policy should be made explicit for cases this change newly rejects, especially the independently decoded GS/state stream covered by overlappingGs. Please distinguish those from the existing branch/entry refusal cases in the tests and debt note. For the borrowed span, UD2 of the original GS instruction is safe only if the borrowed original bytes remain intact and all associated .ggs/.ggm replay records are discarded.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 3965 core/libs/prx/libc/CMakeLists.txt
core/relinker/elfpatcher/src/windows/WindowsEntryStubBuilder.cpp
docs/dev/debt/libc.md
PR 3986 core/libs/prx/libkernel/Pthread/src/Thread.cpp
PR 4563 core/libs/prx/libkernel/Pthread/src/Thread.cpp
PR 4630 core/libs/prx/libkernel/System/src/Exception.cpp
docs/dev/debt/libkernel.md
PR 5021 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libkernel/Module/src/DynamicLoader.cpp
core/libs/prx/libkernel/Pthread/src/Thread.cpp
core/libs/prx/libkernel/System/src/Exception.cpp
core/libs/prx/libkernel/System/src/Process.cpp
core/relinker/CMakeLists.txt
docs/dev/debt/libc.md
docs/dev/debt/libkernel.md
docs/dev/debt/relinker.md
PR 5303 docs/dev/debt/libc.md
PR 6084 core/libs/prx/libc/CMakeLists.txt
PR 6085 core/libs/prx/libc/CMakeLists.txt
PR 6149 core/relinker/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 6565 docs/dev/debt/libc.md
PR 6740 docs/dev/debt/libkernel.md
PR 6819 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 6936 docs/dev/debt/libkernel.md
PR 7081 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 7088 docs/dev/debt/libkernel.md
PR 7090 docs/dev/debt/libkernel.md
PR 7105 docs/dev/debt/libkernel.md
PR 7121 docs/dev/debt/libkernel.md
PR 7135 docs/dev/debt/libkernel.md
PR 7149 core/libs/prx/libkernel/Pthread/src/Thread.cpp
docs/dev/debt/libkernel.md
PR 7173 core/relinker/CMakeLists.txt
docs/dev/debt/relinker.md
PR 7192 core/libs/prx/libc/src/specifics/windows/CrashReport.cpp
core/libs/prx/libkernel/System/src/Exception.cpp
docs/dev/debt/libkernel.md
PR 7386 docs/dev/debt/libc.md
PR 7447 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
docs/dev/debt/libkernel.md
PR 7464 docs/dev/debt/libkernel.md
PR 7509 docs/dev/debt/libkernel.md
PR 7531 core/relinker/CMakeLists.txt
docs/dev/debt/relinker.md
PR 7532 core/libs/prx/libkernel/Pthread/src/Thread.cpp
core/relinker/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 7544 docs/dev/debt/libc.md
PR 7565 core/libs/prx/libkernel/Pthread/src/Thread.cpp
docs/dev/debt/libkernel.md
PR 7594 core/relinker/elfpatcher/src/windows/WindowsEntryStubBuilder.cpp
PR 7622 core/libs/prx/libc/src/specifics/windows/CrashReport.cpp
PR 7648 docs/dev/debt/libc.md
PR 7715 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 7804 core/libs/prx/libkernel/Pthread/src/Thread.cpp
core/libs/prx/libkernel/System/src/Process.cpp
docs/dev/debt/libkernel.md
PR 7851 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8041 core/libs/prx/libkernel/Pthread/src/Thread.cpp
PR 8150 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8251 core/relinker/CMakeLists.txt
PR 8397 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8417 docs/dev/debt/libc.md
PR 8477 core/libs/prx/libkernel/Pthread/src/Thread.cpp
PR 8497 docs/dev/debt/libkernel.md
PR 8592 core/libs/prx/libkernel/Pthread/src/Thread.cpp
core/libs/prx/libkernel/System/src/Exception.cpp
PR 8605 docs/dev/debt/libkernel.md
PR 8937 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8965 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 9087 docs/dev/debt/libc.md
PR 9156 docs/dev/debt/libkernel.md
PR 9162 core/libs/prx/libkernel/System/src/Process.cpp
PR 9199 docs/dev/debt/libkernel.md
PR 9242 docs/dev/debt/libkernel.md
PR 9293 docs/dev/debt/libkernel.md
PR 9297 docs/dev/debt/libkernel.md
PR 9302 docs/dev/debt/libkernel.md
PR 9326 docs/dev/debt/libkernel.md
PR 9340 docs/dev/debt/libc.md
PR 9371 docs/dev/debt/libc.md
PR 9389 docs/dev/debt/libkernel.md
PR 9447 docs/dev/debt/libc.md
PR 9466 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 9491 docs/dev/debt/libkernel.md
PR 9526 docs/dev/debt/libc.md
PR 9557 docs/dev/debt/libkernel.md
PR 9566 docs/dev/debt/libkernel.md
PR 9584 core/libs/prx/libc/CMakeLists.txt
PR 9677 docs/dev/debt/libc.md
PR 9684 core/libs/prx/libkernel/Pthread/src/Thread.cpp
docs/dev/debt/libkernel.md
PR 9688 docs/dev/debt/libc.md
PR 9761 docs/dev/debt/libc.md
PR 9773 core/libs/prx/libc/CMakeLists.txt
PR 9775 core/libs/prx/libc/CMakeLists.txt
PR 9793 core/relinker/CMakeLists.txt
PR 9798 core/libs/prx/libc/CMakeLists.txt
PR 9843 docs/dev/debt/libkernel.md
PR 9863 docs/dev/debt/libc.md
PR 9867 docs/dev/debt/libc.md
PR 9873 docs/dev/debt/libc.md
PR 9882 docs/dev/debt/libkernel.md
PR 9929 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libkernel/System/src/Process.cpp
docs/dev/debt/libc.md
PR 9935 docs/dev/debt/libc.md
PR 9938 core/libs/prx/libkernel/Pthread/src/Thread.cpp
docs/dev/debt/libkernel.md
PR 9947 docs/dev/debt/libkernel.md
PR 9953 docs/dev/debt/libc.md
PR 9964 docs/dev/debt/libc.md
PR 10002 docs/dev/debt/libc.md
PR 10007 docs/dev/debt/libc.md
PR 10025 docs/dev/debt/libkernel.md
PR 10113 docs/dev/debt/libc.md
PR 10158 docs/dev/debt/libc.md
PR 10165 docs/dev/debt/libc.md
PR 10192 docs/dev/debt/libkernel.md
PR 10200 docs/dev/debt/libc.md
PR 10222 docs/dev/debt/libc.md
PR 10226 docs/dev/debt/libc.md
PR 10229 docs/dev/debt/libc.md
PR 10234 docs/dev/debt/libc.md
PR 10245 docs/dev/debt/libc.md
PR 10247 docs/dev/debt/libc.md
PR 10250 docs/dev/debt/libc.md
PR 10253 docs/dev/debt/libc.md
PR 10265 docs/dev/debt/libc.md
PR 10270 docs/dev/debt/libc.md
PR 10274 docs/dev/debt/libc.md
PR 10315 docs/dev/debt/libc.md
PR 10317 docs/dev/debt/libc.md
PR 10319 docs/dev/debt/libkernel.md
PR 10321 docs/dev/debt/libc.md
PR 10324 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 10325 docs/dev/debt/libc.md
PR 10328 docs/dev/debt/libc.md
PR 10345 docs/dev/debt/libc.md
PR 10349 docs/dev/debt/libc.md
PR 10397 docs/dev/debt/libc.md
PR 10405 docs/dev/debt/libc.md
PR 10442 docs/dev/debt/libkernel.md
PR 10479 docs/dev/debt/relinker.md
PR 10495 core/relinker/CMakeLists.txt
docs/dev/debt/relinker.md
PR 10506 docs/dev/debt/libc.md
PR 10510 docs/dev/debt/libc.md
PR 10512 docs/dev/debt/libc.md
PR 10552 core/libs/prx/libkernel/Module/src/DynamicLoader.cpp
docs/dev/debt/libkernel.md
PR 10558 docs/dev/debt/libkernel.md
PR 10565 docs/dev/debt/libc.md
PR 10569 docs/dev/debt/libc.md
PR 10615 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 10620 docs/dev/debt/libc.md
PR 10645 docs/dev/debt/libkernel.md
PR 10662 core/relinker/relinker/src/parsing/ElfReader.cpp
core/relinker/relinker/tests/ElfReaderBoundsTests.cpp
docs/dev/debt/relinker.md
PR 10729 docs/dev/debt/libc.md
PR 10749 docs/dev/debt/libc.md
docs/dev/debt/libkernel.md
PR 10780 docs/dev/debt/libc.md
PR 10789 docs/dev/debt/libkernel.md
PR 10792 core/relinker/CMakeLists.txt
docs/dev/debt/relinker.md
PR 10810 core/libs/prx/libkernel/Pthread/src/Thread.cpp
docs/dev/debt/libkernel.md
PR 10816 core/libs/prx/libkernel/Pthread/src/Thread.cpp
docs/dev/debt/libkernel.md
PR 10817 core/libs/prx/libkernel/Pthread/src/Thread.cpp
docs/dev/debt/libkernel.md
PR 10895 docs/dev/debt/libc.md
PR 10953 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 10970 core/relinker/CMakeLists.txt
docs/dev/debt/relinker.md
PR 10983 core/relinker/CMakeLists.txt
docs/dev/debt/relinker.md
PR 10987 docs/dev/debt/libc.md
PR 10989 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 11002 docs/dev/debt/libkernel.md
PR 11042 docs/dev/debt/libkernel.md
PR 11077 docs/dev/debt/libc.md
PR 11107 core/relinker/CMakeLists.txt
docs/dev/debt/relinker.md
PR 11109 docs/dev/debt/libc.md
PR 11137 docs/dev/debt/relinker.md
PR 11172 docs/dev/debt/libc.md
PR 11192 docs/dev/debt/relinker.md
PR 11214 docs/dev/debt/libc.md
PR 11215 docs/dev/debt/libkernel.md
PR 11219 docs/dev/debt/libkernel.md
PR 11223 docs/dev/debt/libkernel.md
PR 11247 docs/dev/debt/libkernel.md
PR 11260 docs/dev/debt/libc.md
PR 11262 docs/dev/debt/libc.md
PR 11266 docs/dev/debt/libc.md
PR 11332 docs/dev/debt/libc.md
PR 11432 core/relinker/CMakeLists.txt
core/relinker/elfpatcher/src/windows/WindowsGuestModuleWriter.cpp
core/relinker/elfpatcher/src/windows/WindowsPePatcher.cpp
docs/dev/debt/relinker.md
PR 11487 docs/dev/debt/relinker.md
PR 11525 docs/dev/debt/relinker.md
PR 11565 core/relinker/CMakeLists.txt
PR 11583 core/relinker/elfpatcher/src/windows/WindowsEntryStubBuilder.cpp
core/relinker/elfpatcher/src/windows/WindowsRelocationBuilder.cpp
PR 11621 docs/dev/debt/libc.md
PR 11626 docs/dev/debt/relinker.md
PR 11632 docs/dev/debt/libc.md
PR 11634 docs/dev/debt/libc.md
PR 11664 docs/dev/debt/libc.md
PR 11724 docs/dev/debt/libc.md
PR 11726 docs/dev/debt/libc.md
PR 11733 docs/dev/debt/libc.md
PR 11773 docs/dev/debt/libc.md
PR 11793 docs/dev/debt/libc.md
PR 11831 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 11843 docs/dev/debt/libc.md
PR 11848 docs/dev/debt/libc.md
PR 11849 core/libs/prx/libkernel/Pthread/src/Thread.cpp
docs/dev/debt/libc.md
docs/dev/debt/libkernel.md
PR 11850 docs/dev/debt/libc.md
PR 11870 docs/dev/debt/libc.md
PR 11883 docs/dev/debt/relinker.md
PR 11892 docs/dev/debt/libc.md
PR 11895 docs/dev/debt/libc.md
PR 11896 docs/dev/debt/libkernel.md
PR 11907 docs/dev/debt/libc.md
PR 11939 core/libs/prx/libkernel/System/src/Process.cpp
docs/dev/debt/libkernel.md
PR 11947 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 11991 docs/dev/debt/relinker.md
PR 11993 core/relinker/relinker/src/parsing/ElfReader.cpp
core/relinker/relinker/tests/ElfReaderBoundsTests.cpp
PR 12005 core/libs/prx/libkernel/Pthread/src/Thread.cpp
core/libs/prx/libkernel/System/src/Exception.cpp
PR 12009 core/relinker/relinker/tests/ElfReaderBoundsTests.cpp
PR 12053 docs/dev/debt/libc.md
PR 12057 docs/dev/debt/libc.md
PR 12071 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/src/specifics/windows/CrashReport.cpp
PR 12104 docs/dev/debt/libkernel.md
PR 12122 docs/dev/debt/libc.md
PR 12130 core/libs/prx/libkernel/Pthread/src/Thread.cpp
core/libs/prx/libkernel/System/src/Exception.cpp
PR 12146 core/libs/prx/libc/CMakeLists.txt
PR 12149 docs/dev/debt/libc.md
PR 12170 docs/dev/debt/libkernel.md
PR 12184 docs/dev/debt/libc.md
PR 12202 docs/dev/debt/libkernel.md
PR 12203 core/relinker/relinker/src/guest/GuestImageReader.cpp
PR 12258 core/relinker/CMakeLists.txt
core/relinker/relinker/src/parsing/ElfReader.cpp
PR 12271 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 12282 core/relinker/elfpatcher/src/windows/WindowsTlsBuilder.cpp
PR 12292 docs/dev/debt/libc.md
PR 12363 docs/dev/debt/libc.md
PR 12364 docs/dev/debt/libc.md
PR 12365 docs/dev/debt/libc.md
PR 12397 docs/dev/debt/libc.md
PR 12428 docs/dev/debt/libc.md
PR 12468 docs/dev/debt/libc.md
PR 12480 docs/dev/debt/libc.md
PR 12495 core/relinker/CMakeLists.txt
PR 12510 docs/dev/debt/libc.md
PR 12511 docs/dev/debt/libc.md
PR 12514 docs/dev/debt/libc.md
PR 12518 docs/dev/debt/libc.md
PR 12530 docs/dev/debt/libc.md
PR 12532 docs/dev/debt/libc.md
PR 12544 core/libs/prx/libkernel/Pthread/src/Thread.cpp
PR 12560 docs/dev/debt/libc.md
docs/dev/debt/libkernel.md
PR 12574 docs/dev/debt/libc.md
PR 12586 docs/dev/debt/libc.md
PR 12592 docs/dev/debt/libc.md
PR 12593 docs/dev/debt/libc.md
PR 12594 docs/dev/debt/libc.md
PR 12595 docs/dev/debt/libc.md
PR 12597 docs/dev/debt/libc.md
PR 12598 docs/dev/debt/libc.md
PR 12605 docs/dev/debt/libc.md
PR 12622 docs/dev/debt/libc.md
PR 12627 docs/dev/debt/libc.md
PR 12642 core/libs/prx/libkernel/Pthread/src/Thread.cpp
core/libs/prx/libkernel/System/src/Exception.cpp
PR 12678 core/relinker/CMakeLists.txt
docs/dev/debt/relinker.md
PR 12704 docs/dev/debt/libc.md
PR 12741 docs/dev/debt/libkernel.md
PR 12753 core/libs/prx/libc/CMakeLists.txt
PR 12769 core/relinker/CMakeLists.txt
PR 12777 core/libs/prx/libc/CMakeLists.txt
PR 12780 core/libs/prx/libc/CMakeLists.txt
PR 12781 core/libs/prx/libc/CMakeLists.txt
PR 12822 core/relinker/relinker/src/guest/GuestImageReader.cpp
PR 12826 docs/dev/debt/libkernel.md
PR 12841 docs/dev/debt/libc.md
PR 12849 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 12854 docs/dev/debt/libkernel.md
PR 12882 core/libs/prx/libc/CMakeLists.txt
PR 12883 core/libs/prx/libc/CMakeLists.txt
PR 12884 core/libs/prx/libc/CMakeLists.txt
PR 12885 core/libs/prx/libc/CMakeLists.txt
PR 12886 core/libs/prx/libc/CMakeLists.txt
PR 12887 core/libs/prx/libc/CMakeLists.txt
PR 12888 core/libs/prx/libc/CMakeLists.txt
PR 12889 core/libs/prx/libc/CMakeLists.txt
PR 12890 core/libs/prx/libc/CMakeLists.txt
PR 12892 core/libs/prx/libc/CMakeLists.txt
PR 12908 docs/dev/debt/libkernel.md
PR 12910 core/relinker/relinker/tests/test_tls_function_coverage.py
docs/dev/debt/relinker.md
PR 12911 core/relinker/CMakeLists.txt
PR 12920 docs/dev/debt/libc.md
PR 12922 docs/dev/debt/libkernel.md
PR 12925 docs/dev/debt/libkernel.md
PR 12947 docs/dev/debt/libc.md
PR 12951 docs/dev/debt/relinker.md
PR 12970 docs/dev/debt/libkernel.md
PR 13119 docs/dev/debt/libc.md
PR 13143 core/relinker/CMakeLists.txt
PR 13186 docs/dev/debt/libc.md
PR 13224 docs/dev/debt/libkernel.md
PR 13291 docs/dev/debt/relinker.md
PR 13303 core/libs/prx/libc/CMakeLists.txt
PR 13304 core/libs/prx/libc/CMakeLists.txt
PR 13305 core/libs/prx/libc/CMakeLists.txt
PR 13306 core/libs/prx/libc/CMakeLists.txt
PR 13307 core/libs/prx/libc/CMakeLists.txt
PR 13308 core/libs/prx/libc/CMakeLists.txt
PR 13310 core/libs/prx/libc/CMakeLists.txt
PR 13311 core/libs/prx/libc/CMakeLists.txt
PR 13312 core/libs/prx/libc/CMakeLists.txt
PR 13313 core/libs/prx/libc/CMakeLists.txt
PR 13314 core/libs/prx/libc/CMakeLists.txt
PR 13316 core/libs/prx/libc/CMakeLists.txt
PR 13317 core/libs/prx/libc/CMakeLists.txt
PR 13318 core/libs/prx/libc/CMakeLists.txt
PR 13319 core/libs/prx/libc/CMakeLists.txt
PR 13320 core/libs/prx/libc/CMakeLists.txt
PR 13336 docs/dev/debt/libkernel.md
PR 13378 core/libs/prx/libc/CMakeLists.txt
PR 13379 core/libs/prx/libc/CMakeLists.txt
PR 13380 core/libs/prx/libc/CMakeLists.txt
PR 13381 core/libs/prx/libc/CMakeLists.txt
PR 13382 core/libs/prx/libc/CMakeLists.txt
PR 13383 core/libs/prx/libc/CMakeLists.txt
PR 13385 core/libs/prx/libc/CMakeLists.txt
PR 13386 core/libs/prx/libc/CMakeLists.txt
PR 13387 core/libs/prx/libc/CMakeLists.txt
PR 13389 core/libs/prx/libc/CMakeLists.txt
PR 13390 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 13391 core/libs/prx/libc/CMakeLists.txt
PR 13392 core/libs/prx/libc/CMakeLists.txt
PR 13393 core/libs/prx/libc/CMakeLists.txt
PR 13394 core/libs/prx/libc/CMakeLists.txt
PR 13395 core/libs/prx/libc/CMakeLists.txt
PR 13442 docs/dev/debt/libc.md
PR 13449 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 13472 core/relinker/CMakeLists.txt
PR 13473 core/relinker/CMakeLists.txt
PR 13475 core/relinker/CMakeLists.txt
PR 13477 core/relinker/CMakeLists.txt
PR 13482 core/relinker/CMakeLists.txt
PR 13486 core/relinker/CMakeLists.txt
PR 13499 docs/dev/debt/libc.md
PR 13504 docs/dev/debt/libkernel.md
PR 13506 docs/dev/debt/libkernel.md
PR 13507 docs/dev/debt/libkernel.md
PR 13532 docs/dev/debt/libkernel.md
PR 13537 docs/dev/debt/libkernel.md
PR 13544 docs/dev/debt/libkernel.md
PR 13545 docs/dev/debt/libkernel.md
PR 13552 docs/dev/debt/libkernel.md
PR 13556 docs/dev/debt/libkernel.md
PR 13560 docs/dev/debt/libkernel.md
PR 13576 docs/dev/debt/libkernel.md
PR 13577 docs/dev/debt/libkernel.md
PR 13582 core/libs/prx/libkernel/Pthread/src/Thread.cpp
docs/dev/debt/libkernel.md
PR 13587 docs/dev/debt/libkernel.md
PR 13598 docs/dev/debt/libkernel.md
PR 13600 docs/dev/debt/libkernel.md
PR 13660 core/libs/prx/libkernel/Pthread/src/Thread.cpp
docs/dev/debt/libkernel.md

# Conflicts:
#	core/relinker/relinker/tests/test_windows_guest_gs.py
@Felipebmaitan

Felipebmaitan commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

@oneandonlydean @MarcZX10 Addressed the borrowed-span request and policy clarification in bd67c1b, retained by current head 199f953.

Unsafe borrowed entry roots/branch targets, relocated follower operands and independently decoded GS/state streams now keep the original short GS instruction's own-length UD2/NOP fallback. Followers are untouched apart from normal ELF relocations, and the candidate's .ggs/.ggm records are discarded. Branch/root decisions happen after the complete scan. Overlapping GS streams outside short borrowing retain #11628's prior scanner behavior.

The tests distinguish this from existing protections: entries inside the original GS instruction still refuse conversion, and long replay jumps/fallback traps retain their existing entry guards. Borrowed-span cases convert successfully. Relocated follower bytes are compared against an ordinary conversion with the source GS replaced by NOPs. Regressions also check empty discarded metadata/runtime requirements, direct follower entry without libc, and executable/module overlap paths. A runtime fixture executes valid replay records before and after a discarded candidate.

I reran production libc/libkernel component builds and focused Windows/Linux runtime/relinker tests after current-main and prerequisite integration; all 70 normalized Windows/native Linux execution dumps match. Conventions against origin/main passed. The full graphics/media configuration remains blocked by missing SDL2/ffmpeg sources; no console/title verification is claimed.

@Felipebmaitan

Felipebmaitan commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

@MarcZX10 Regarding the performance review: this PR makes no speed or performance claim. The description now states explicitly that no performance measurements or paired title captures were performed.

Its scope is instruction correctness and additional supported GS forms; the evidence is synthetic native Linux/rewritten Windows differential execution and emitted-program/runtime tests. Any performance impact remains unmeasured. There are no main/change title trace files or trace_digest summaries to provide, and I have not presented the correctness-test timings as performance evidence.

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed libc libkernel labels Oct 27, 2026
This was referenced Oct 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants