diff options
| author | ImLele69 <gabrieledilauro99@gmail.com> | 2026-11-25 01:58:20 +0100 |
|---|---|---|
| committer | ImLele69 <gabrieledilauro99@gmail.com> | 2026-11-25 01:58:20 +0100 |
| commit | 85b8f5b7f098223a02267667b391ff3d7e984c14 (patch) | |
| tree | 229cd1f2d9038f90e7399a31eb37d632f248afdb /runtime/test/vk_queue_constructor_oom_test.cpp | |
| parent | b4b7756e8c64e7ae8b310288d543db0e428c0796 (diff) | |
cpu_emulation: rewrite CLWB in place at its first #UD (RT-CLWB-PATCH)
On a host without CLWB every execution of the instruction raised #UD and the vectored handler emulated it. The
retail title's GPU upload worker flushes whole buffers with CLWB in a 64-byte loop (exe+0x532f1b0 on 1.0.2.1), so a
buffer cost one exception per cache line; under Wine that kept the worker busy for minutes and the main thread
polling its event in session 0xd, so the boot never left the first-run pages.
The handler now rewrites the instruction at its first #UD: 66 0F AE /6 becomes 66 0F AE /7 (CLFLUSHOPT), the same
operand and length, which also writes the line back; a host without CLFLUSHOPT gets 66 0F 1F /0, a NOP of the same
length. LEONIDA_CLWB_PATCH=0 keeps the old per-execution emulation.
Tested: cpu_emulation_test under Wine 11.21 on an i9-9900KF (no CLWB, has CLFLUSHOPT): both sites rewritten, SIB and
displacement kept, the code runs again. Retail boot on the same machine with #984 + #968 (RTX 2070 SUPER, Fedora 44):
the worker that sat in the CLWB loop at 420, 540 and 660 s now moves on, and the title gets past the first-run pages
into the story load.
AI-assisted: yes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RBZntAmGCDe3LdLjbzZzuc
Diffstat (limited to 'runtime/test/vk_queue_constructor_oom_test.cpp')
0 files changed, 0 insertions, 0 deletions