upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/test/tiny_game_exit_code_test.cpp
diff options
context:
space:
mode:
authorOreoFR <noreply@users.noreply.github.com>2026-11-28 05:28:00 +0100
committerOreoFR <noreply@users.noreply.github.com>2026-11-28 05:28:00 +0100
commit5d677b7ba2b2dd5b128455edf2b92bea6da4dcc2 (patch)
treecca8090de22564ac93e738a50eedd77885732956 /runtime/test/tiny_game_exit_code_test.cpp
parent63a73515d1fc26c309ac0d9cd13ec9afd2fa5016 (diff)
cpu_emulation: a CLWB #UD on a site another thread rewrote continues at it (RT-CLWB-PATCH)
Threads that fault on the same CLWB site together lost the race: a #UD handled after another thread rewrote the site decoded CLFLUSHOPT (or the NOP), did not know it and returned EXCEPTION_CONTINUE_SEARCH, which ends the title. - The handler continues at a site that already holds the form written on this host (or the NOP's halfway state): the CPU runs it. - One lock around unprotect, re-check, write and protect again, so two threads never interleave on a page; a site found rewritten under it is not written. - The NOP is written opcode first (66 0F 1F /6 in between is a NOP too). - The sites counter counts each site once, by the thread that wrote it. cpu_emulation_test calls the handler with a made-up #UD, so it runs on hosts with CLWB: first #UD, a second one on the rewritten site, and 16 threads on 2048 fresh execute-read sites. Before the fix 27958 of 32768 concurrent #UDs were passed on, 4810 rewrites were counted for 2048 sites and pages were left writable; with it all checks pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/tiny_game_exit_code_test.cpp')
0 files changed, 0 insertions, 0 deletions