Repository navigation
Conversation
With EFLAGS.TF set, the generic handler still replaces one multibyte CLWB with several NOP instructions. A later visit then has different instruction boundaries. Skip the patch only for instruction stepping and advance by the decoded instruction length, preserving the saved registers and flags. Add a direct-handler regression on registered PAGE_EXECUTE_READ code for three CLWB encodings, two TF-set visits each, protection and register checks, and TF-clear controls that still require the existing NOP patch. The test fails on unmodified official508a0c7; all7 release EH tests pass with the guard. Related:217 introduced hot-patching; active321 dfa332a addresses patch atomicity and late faults, without a TF guard. This patch imports no local batching or321 implementation. No GPU/game run or attached-debugger event trace was performed. Assisted-by: OpenAI Codex (exact model version not exposed)
|
Test run of Tested
Review: With the trap flag ( Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
|
On the overlap with #321 that the description mentions: I checked it at heads
So if #321 lands first, this PR's change mostly becomes unnecessary. The TF check would only matter if the code should stay untouched while a debugger steps at all, in which case it would go at #321's call site ( Read-only, not built. AI-assisted (Claude Code). |
Interesting. I was using 321 but I didn't think it would be an issue, but I will try and see if this gets pushed first. If anything, we can use a debugger for the lower end systems. Good catch! |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
When a debugger single-steps a title on a CPU without CLWB, the exception handler currently replaces the original instruction with several one-byte NOPs. A later visit to the same address sees different instruction boundaries. Keep the instruction bytes while the x86 trap flag is set.
What is in it
Tested
ff37edccb1dabb9e39985b51ecf33a5e352c699a, Windows 11 Pro build 26200, Intel Core i5-10400, NVIDIA GeForce RTX 3060 Ti, driver 32.0.16.1714, Rust 1.100.0 MSVC.508a0c7with the original four-byte CLWB replaced by four NOPs. The release exception-handler tests passed after the change (7 passed, 0 failed, 0 ignored).cargo test --workspacerun with locked dependencies, four test threads and--no-fail-fastcompleted with 681 passed, 0 failed, 41 ignored. Two GPU tests reported a wave64 hardware skip. Both the debug workspace and release CLI builds passed.Regression run
Both runs used the same retail title, RTX 3060 Ti, 60-second limit, offline mode, first-use compute setting and two DXC workers.
Main
PR head
Not tested
The focused test exercises the real exception handler with a saved Windows context. An interactive debugger session and CPUs that execute CLWB natively were outside this test. Optional retail sample tests had no external input.
AI use
OpenAI Codex (GPT-6) assisted with reproducing the behavior, implementing the guard and tests, checking overlap and preparing this report.
I use a temporary Discord to coordinate my work. Anyone helping test XCL or compare results is welcome. Test coordination on Discord