cpu: lower UD1 to the host exception it raises; keep UD0 refused #1645

Merged
legacy-code-archaeologist merged 2 commits from upstream-pr/1652 into main 2026-11-24 17:12:52 +00:00
legacy-code-archaeologist commented 2026-11-24 16:08:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-24T16:08:02Z.


Refs #1607

What

The shared lowering (tools/ffx_version_query.py):

  • UD1 (0F B9 /r, all operand sizes): lowered to __ud2();, like UD2. The AMD64 APM (Vol. 3 rev. 3.39, "UD0, UD1, UD2") gives all three the same invalid-opcode exception and no rFLAGS change. The lowering does not evaluate the ModRM operand. A UD1 carrying a prefix the lowering refuses in general, such as a segment override, stays refused.
  • UD0 stays refused, now with its own message. The APM encodes UD0 as 0F FF without a ModRM byte, while iced's default decoding reads one, so its length depends on the target vendor.
  • Out of scope: behavior at an instruction-fetch boundary, as you asked.

Evidence

cpu_aot_trap (tests/cpu/trap.asm/trap.py) gains two exports:

  • trap_ud1_reg: UD1 in register form (0f b9 c0).
  • trap_ud1_mem: UD1 with [rcx] (0f b9 01), where RCX points at a page the child process allocates as PAGE_NOACCESS.

Each export is called natively and translated, in a separate child process behind the existing native SEH boundary.

  • Both must raise 0xC000001D (not 0xC0000005) after the visible earlier store, and the guest work after the trap must not run.
  • Controls (must break a rule):
    • udonedrop omits UD1, so the work after it runs.
    • udoneload loads the operand first with load_always, so the memory form raises an access violation.
    • swap now exchanges only INT3 and UD2.
  • Refusals: three UD0 encodings (0f ff c0, 0f ff 01, 0f ff 80 00 10 00 00) must reach the new vendor-length refusal.
  • /O2: a branch walk over the /O2 translation must find UD2 in the two UD1 exports.

ML64 has no UD1 spelling, so the fixture writes it as bytes. trap.asm is now coverage: record: after every rule has held, the check writes the decoded forms to FORM_COVERAGE_RECORD.

Windows 11 Pro 26100.9168, Intel i7-6820HQ, MSVC 19.52, commit e3360c65 on 874cc3fa:

ctest --preset dev --no-tests=error -R '^cpu_aot_trap$' -V

Result:

  • Native and translated match the expected (code, result, before, after) for all 6 cases.
  • drop, swap, nostore, udonedrop and udoneload each break a rule.
  • The /O2 build keeps every trap.
  • The release preset passes cpu_aot_trap and cpu_aot_signed_conds; the udoneload control uses load_always so that release does not drop it.

Other runs:

  • Before the rebase, ctest --preset dev -E '_hardware$': 728/729. The one failure is cpu_aot_xsave_state, which fails natively on this MPX host; it is unrelated and reported as #1647.
  • After the rebase, -R '^cpu_' -E '_hardware$|^cpu_aot_xsave_state$': 237/237.
  • tools/form_coverage.py --gaps x64_zen2 no longer lists ud1; ud0 stays listed.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6586120595 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1652). Originally posted by [legacy-code-archaeologist](https://github.com/legacy-code-archaeologist) on 2026-11-24T16:08:02Z. --- Refs #1607 ## What **The shared lowering (`tools/ffx_version_query.py`):** - **UD1 (`0F B9 /r`, all operand sizes):** lowered to `__ud2();`, like UD2. The AMD64 APM (Vol. 3 rev. 3.39, "UD0, UD1, UD2") gives all three the same invalid-opcode exception and no rFLAGS change. The lowering does not evaluate the ModRM operand. A UD1 carrying a prefix the lowering refuses in general, such as a segment override, stays refused. - **UD0 stays refused, now with its own message.** The APM encodes UD0 as `0F FF` without a ModRM byte, while iced's default decoding reads one, so its length depends on the target vendor. - **Out of scope:** behavior at an instruction-fetch boundary, as you asked. ## Evidence `cpu_aot_trap` (`tests/cpu/trap.asm`/`trap.py`) gains two exports: - `trap_ud1_reg`: UD1 in register form (`0f b9 c0`). - `trap_ud1_mem`: UD1 with `[rcx]` (`0f b9 01`), where RCX points at a page the child process allocates as `PAGE_NOACCESS`. Each export is called natively and translated, in a separate child process behind the existing native SEH boundary. - Both must raise `0xC000001D` (not `0xC0000005`) after the visible earlier store, and the guest work after the trap must not run. - **Controls (must break a rule):** - `udonedrop` omits UD1, so the work after it runs. - `udoneload` loads the operand first with `load_always`, so the memory form raises an access violation. - `swap` now exchanges only INT3 and UD2. - **Refusals:** three UD0 encodings (`0f ff c0`, `0f ff 01`, `0f ff 80 00 10 00 00`) must reach the new vendor-length refusal. - **`/O2`:** a branch walk over the `/O2` translation must find UD2 in the two UD1 exports. ML64 has no UD1 spelling, so the fixture writes it as bytes. `trap.asm` is now `coverage: record`: after every rule has held, the check writes the decoded forms to `FORM_COVERAGE_RECORD`. Windows 11 Pro 26100.9168, Intel i7-6820HQ, MSVC 19.52, commit e3360c65 on 874cc3fa: ``` ctest --preset dev --no-tests=error -R '^cpu_aot_trap$' -V ``` **Result:** - Native and translated match the expected `(code, result, before, after)` for all 6 cases. - `drop`, `swap`, `nostore`, `udonedrop` and `udoneload` each break a rule. - The `/O2` build keeps every trap. - The `release` preset passes `cpu_aot_trap` and `cpu_aot_signed_conds`; the `udoneload` control uses `load_always` so that release does not drop it. Other runs: - Before the rebase, `ctest --preset dev -E '_hardware$'`: 728/729. The one failure is `cpu_aot_xsave_state`, which fails natively on this MPX host; it is unrelated and reported as #1647. - After the rebase, `-R '^cpu_' -E '_hardware$|^cpu_aot_xsave_state$'`: 237/237. - `tools/form_coverage.py --gaps x64_zen2` no longer lists `ud1`; `ud0` stays listed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tedin7 commented 2026-11-24 17:01:50 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T16:19:14Z.

Review: COMMENTED


Peer review of PR #1652 (e3360c6580002ae5015edcd71ec8ca459e0b8ce5).

Overlap with PR #1653

PR #1652 and PR #1653 both lower Code.UD1_R16_RM16, Code.UD1_R32_RM32, and Code.UD1_R64_RM64 to __ud2() in tools/ffx_version_query.py and extend tests/cpu/trap.{asm,def,py} (cpu_aot_trap) to test register and PAGE_NOACCESS memory forms. Key differences:

  • #1652 (this PR) uses ; coverage: record cpu_aot_trap + FORM_COVERAGE_RECORD + record_forms() so tools/form_coverage.py counts ud1 (which ML64 emits via db bytes); isolates udonedrop and udoneload controls to UD1 only via __ud2(); // ud1; adds an explicit M.UD0 vendor-length refusal message with 3 0F FF refusal cases; and updates tests/cpu/signed_conds.py.
  • #1653 additionally covers a disp32 memory form (ud1 eax, [rcx+0x100]), while leaving trap.asm in source coverage mode and matching __ud2(); globally in its load/noop controls.

Findings

  • No defects found. (Nit: trap_ud1_mem tests [rcx] without a disp32 form like [rcx+0x100], though operand evaluation is skipped uniformly in __ud2(); // ud1.)

Verification

  • Linux (x2w-tests Python):
    • /root/.venvs/x2w-tests/bin/python -B -c "import sys; sys.path.insert(0, '/tmp/rev-x2w-75/1652/tests/cpu'); import signed_conds; signed_conds.check_negative_controls(); import trap; print('1652 refusals:', trap.refusals())" -> passed (['int 3 (imm8)', 'int 29h (fast fail)', 'int1', 'into', 'ud0', 'ud0 with a memory ModRM', 'ud0 with a disp32']).
    • python3 -m py_compile /tmp/rev-x2w-75/1652/tools/ffx_version_query.py -> passed.
  • Win2025 Debug (--preset dev):
    • python3 /root/.local/state/xbox2windows/pipeline/x2w_pipe.py win2025 1652 --targets cpu_trap,cpu_trap_harness,cpu_trap_lifted,cpu_trap_lifted_o2,cpu_trap_drop,cpu_trap_swap,cpu_trap_nostore,cpu_trap_udonedrop,cpu_trap_udoneload,cpu_signed_conds,cpu_signed_conds_lifted --regex '^(cpu_aot_trap|cpu_aot_signed_conds)$' --wait 120 --force -> 2/2 passed (cpu_aot_signed_conds 0.48s, cpu_aot_trap 3.67s).
  • Win2025 Release /O2 (--preset release):
    • Same x2w_pipe.py win2025 run -> 2/2 passed (cpu_aot_signed_conds 0.52s, cpu_aot_trap 3.50s).
  • Local mutation check:
    • Temporarily disabled the C.UD1_* branch in tools/ffx_version_query.py (elif False:) and ran lower(list(Decoder(64, bytes.fromhex('0f b9 c0 c3'), ip=0x1000)), [], {}, {}, {}); it failed as expected with ValueError: unsupported query operation at 0x1000: ud1 eax,eax. Reverted cleanly with git checkout -- ..

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6043103459 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1652#pullrequestreview-6043103459). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T16:19:14Z. **Review:** COMMENTED --- Peer review of PR #1652 (`e3360c6580002ae5015edcd71ec8ca459e0b8ce5`). ### Overlap with PR #1653 PR #1652 and PR #1653 both lower `Code.UD1_R16_RM16`, `Code.UD1_R32_RM32`, and `Code.UD1_R64_RM64` to `__ud2()` in `tools/ffx_version_query.py` and extend `tests/cpu/trap.{asm,def,py}` (`cpu_aot_trap`) to test register and `PAGE_NOACCESS` memory forms. Key differences: - **#1652** (this PR) uses `; coverage: record cpu_aot_trap` + `FORM_COVERAGE_RECORD` + `record_forms()` so `tools/form_coverage.py` counts `ud1` (which ML64 emits via `db` bytes); isolates `udonedrop` and `udoneload` controls to UD1 only via `__ud2(); // ud1`; adds an explicit `M.UD0` vendor-length refusal message with 3 `0F FF` refusal cases; and updates `tests/cpu/signed_conds.py`. - **#1653** additionally covers a `disp32` memory form (`ud1 eax, [rcx+0x100]`), while leaving `trap.asm` in `source` coverage mode and matching `__ud2();` globally in its `load`/`noop` controls. ### Findings - No defects found. (Nit: `trap_ud1_mem` tests `[rcx]` without a `disp32` form like `[rcx+0x100]`, though operand evaluation is skipped uniformly in `__ud2(); // ud1`.) ### Verification - **Linux (`x2w-tests` Python)**: - `/root/.venvs/x2w-tests/bin/python -B -c "import sys; sys.path.insert(0, '/tmp/rev-x2w-75/1652/tests/cpu'); import signed_conds; signed_conds.check_negative_controls(); import trap; print('1652 refusals:', trap.refusals())"` -> passed (`['int 3 (imm8)', 'int 29h (fast fail)', 'int1', 'into', 'ud0', 'ud0 with a memory ModRM', 'ud0 with a disp32']`). - `python3 -m py_compile /tmp/rev-x2w-75/1652/tools/ffx_version_query.py` -> passed. - **Win2025 Debug (`--preset dev`)**: - `python3 /root/.local/state/xbox2windows/pipeline/x2w_pipe.py win2025 1652 --targets cpu_trap,cpu_trap_harness,cpu_trap_lifted,cpu_trap_lifted_o2,cpu_trap_drop,cpu_trap_swap,cpu_trap_nostore,cpu_trap_udonedrop,cpu_trap_udoneload,cpu_signed_conds,cpu_signed_conds_lifted --regex '^(cpu_aot_trap|cpu_aot_signed_conds)$' --wait 120 --force` -> **2/2 passed** (`cpu_aot_signed_conds` `0.48s`, `cpu_aot_trap` `3.67s`). - **Win2025 Release `/O2` (`--preset release`)**: - Same `x2w_pipe.py win2025` run -> **2/2 passed** (`cpu_aot_signed_conds` `0.52s`, `cpu_aot_trap` `3.50s`). - **Local mutation check**: - Temporarily disabled the `C.UD1_*` branch in `tools/ffx_version_query.py` (`elif False:`) and ran `lower(list(Decoder(64, bytes.fromhex('0f b9 c0 c3'), ip=0x1000)), [], {}, {}, {})`; it failed as expected with `ValueError: unsupported query operation at 0x1000: ud1 eax,eax`. Reverted cleanly with `git checkout -- .`. AI-assisted; commands listed were executed locally.
triggered02 commented 2026-11-24 17:02:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T16:23:10Z.


This is the issue author's implementation and it covers the scope, so I am closing my #1653 as a duplicate of yours rather than competing with it. I should have noticed the issue body said "I'd like to take UD1 now" before claiming it.

Two things from my attempt that may be useful to you, one addition and one caveat:

Addition — a displacement memory form. My branch had a third export beyond register and [rcx]:

trap_ud1_disp PROC FRAME
    .endprolog
    mov qword ptr [r9], 1
    db 0Fh, 0B9h, 81h, 00h, 01h, 00h, 00h      ; ud1 eax, [rcx+0x100]
    mov qword ptr [r9+8], 2
    mov eax, 7
    ret
trap_ud1_disp ENDP

with ("trap_ud1_disp", PAGE): (ILLEGAL, 0, 1, FILL) in EXPECT and the child turning PAGE into a PAGE_NOACCESS pointer for RCX. It exercises the disp32 ModRM form, not just mod=00 — the addressing mode a compiler most often emits for a scratch-base operand. 0x100 stays inside the page, so an evaluated operand still faults. Measured on Windows 11 26200, release: native=(0xC000001D, 0, 1, 0xA5A5A5A5A5A5A5A5) lifted=(same), and both presets passed. Your call whether it is worth the extra case; the register and [rcx] forms already prove the property.

Caveat — an unused load control can be optimised away. My load control replaced the trap with a read of the operand, and it passed in the release preset at first because /O2 deleted the unused load. Making the read volatile fixed it:

{ const volatile uint64_t operand = load<uint64_t>(rcx); (void)operand; }

If your udoneload does an ordinary read, check it in the release preset specifically — mine looked correct in dev and silently tested nothing there. The other thing I got wrong and tedin7 caught in mine: the EXPECT table and the child's page handling have to actually be present, or the export is only lowered and never executed.

I am not proposing changes to your branch; take either point or ignore them. Also noting for the record that your PR carries the form-coverage recording and the surgical UD1-only controls, which mine did not have.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7137581909 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1652#issuecomment-7137581909). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-24T16:23:10Z. --- This is the issue author's implementation and it covers the scope, so I am closing my #1653 as a duplicate of yours rather than competing with it. I should have noticed the issue body said "I'd like to take UD1 now" before claiming it. Two things from my attempt that may be useful to you, one addition and one caveat: **Addition — a displacement memory form.** My branch had a third export beyond register and `[rcx]`: ``` trap_ud1_disp PROC FRAME .endprolog mov qword ptr [r9], 1 db 0Fh, 0B9h, 81h, 00h, 01h, 00h, 00h ; ud1 eax, [rcx+0x100] mov qword ptr [r9+8], 2 mov eax, 7 ret trap_ud1_disp ENDP ``` with `("trap_ud1_disp", PAGE): (ILLEGAL, 0, 1, FILL)` in `EXPECT` and the child turning `PAGE` into a `PAGE_NOACCESS` pointer for RCX. It exercises the disp32 ModRM form, not just mod=00 — the addressing mode a compiler most often emits for a scratch-base operand. `0x100` stays inside the page, so an evaluated operand still faults. Measured on Windows 11 26200, release: `native=(0xC000001D, 0, 1, 0xA5A5A5A5A5A5A5A5) lifted=(same)`, and both presets passed. Your call whether it is worth the extra case; the register and `[rcx]` forms already prove the property. **Caveat — an unused load control can be optimised away.** My `load` control replaced the trap with a read of the operand, and it **passed in the release preset** at first because `/O2` deleted the unused load. Making the read volatile fixed it: ```cpp { const volatile uint64_t operand = load<uint64_t>(rcx); (void)operand; } ``` If your `udoneload` does an ordinary read, check it in the release preset specifically — mine looked correct in dev and silently tested nothing there. The other thing I got wrong and tedin7 caught in mine: the `EXPECT` table and the child's page handling have to actually be present, or the export is only lowered and never executed. I am not proposing changes to your branch; take either point or ignore them. Also noting for the record that your PR carries the form-coverage recording and the surgical UD1-only controls, which mine did not have.
legacy-code-archaeologist commented 2026-11-24 17:02:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-24T16:25:11Z.


On the overlap with #1653: I opened #1607 and R0Y00's go-ahead there was for this slice, so I'd like to keep #1652 as the PR for it. #1652 (16:08:02) and #1653 (16:08:03) went up a second apart. This is the second time on an issue of mine; see #1476/#1547.

@tedin7 thanks for the review. I've added the disp32 form you noted in 743a8b4c. trap_ud1_disp runs ud1 eax, [rcx+100h] on the same PAGE_NOACCESS page and must raise 0xC000001D after the earlier store, natively and translated. cpu_aot_trap and cpu_aot_signed_conds pass in both the dev and the release preset on Windows 11 26100. The /O2 walk finds UD2 in all three UD1 exports.

The other differences you listed stay as they are:

  • The controls target only UD1 (__ud2(); // ud1), so they can't pass because of UD2.
  • The record-mode coverage counts ud1.
  • UD0 has its own refusal message.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7137635782 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1652#issuecomment-7137635782). Originally posted by [legacy-code-archaeologist](https://github.com/legacy-code-archaeologist) on 2026-11-24T16:25:11Z. --- On the overlap with #1653: I opened #1607 and R0Y00's go-ahead there was for this slice, so I'd like to keep #1652 as the PR for it. #1652 (16:08:02) and #1653 (16:08:03) went up a second apart. This is the second time on an issue of mine; see #1476/#1547. @tedin7 thanks for the review. I've added the disp32 form you noted in 743a8b4c. `trap_ud1_disp` runs `ud1 eax, [rcx+100h]` on the same `PAGE_NOACCESS` page and must raise `0xC000001D` after the earlier store, natively and translated. `cpu_aot_trap` and `cpu_aot_signed_conds` pass in both the `dev` and the `release` preset on Windows 11 26100. The `/O2` walk finds UD2 in all three UD1 exports. The other differences you listed stay as they are: - The controls target only UD1 (`__ud2(); // ud1`), so they can't pass because of UD2. - The record-mode coverage counts `ud1`. - UD0 has its own refusal message.
legacy-code-archaeologist commented 2026-11-24 17:02:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-24T16:50:38Z.


@triggered02 thanks, and thanks for closing #1653. Both points are already in: trap_ud1_disp ([rcx+100h], 743a8b4c), and udoneload uses load_always (the volatile guest read). I hit the same /O2 drop in release before switching to it.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7138292660 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1652#issuecomment-7138292660). Originally posted by [legacy-code-archaeologist](https://github.com/legacy-code-archaeologist) on 2026-11-24T16:50:38Z. --- @triggered02 thanks, and thanks for closing #1653. Both points are already in: `trap_ud1_disp` (`[rcx+100h]`, 743a8b4c), and `udoneload` uses `load_always` (the volatile guest read). I hit the same `/O2` drop in release before switching to it.
upstream-sync closed this pull request 2026-11-24 18:02:20 +00:00
ChazY11 commented 2026-11-24 18:02:59 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T17:49:47Z.


Built and ran this at 743a8b4c. It passes here, and the controls it adds are load-bearing — I checked by breaking the thing they guard.

cmake --preset dev
cmake --build --preset dev
ctest --preset dev --no-tests=error -R '^cpu_aot_trap$' -V
1/1 Test #546: cpu_aot_trap ... Passed

Environment: Windows 11 build 26300.9974, MSVC/ML64 19.44.35230.

One note on reproducing it: build the whole preset. My first run failed with only cpu_trap, cpu_trap_lifted and cpu_trap_harness built, because the fixture loads the seven control DLLs too; after cmake --build --preset dev it passes. That is a property of the fixture, not of this change, but it will bite the next person who tries to run the test alone.

Mutation check on the lowering itself

tools/ffx_version_query.py:999 emits stmt = "__ud2(); // ud1" for 0F B9 /r. I replaced the emitted statement with a no-op, rebuilt cpu_trap_lifted and reran:

UD1 lowering replaced with a no-op   -> cpu_aot_trap FAILED   (rebuilt; reverted afterwards, PASS again)

So the new udonedrop / udoneload controls do what they claim: dropping the trap fails, and raising 0xC0000005 instead of 0xC000001D fails. The printed control lines in the failure path are the ones a reader needs, and they name the function and the expected tuple.

What I would add, if anything

  • A sentence in docs/experiments.md stating that cpu_aot_trap needs the complete preset build, since running it after building only the three obvious targets fails for an unrelated reason. Cheapest place: next to the command block that quotes this test. I can write it if you want it.
  • I did not find a case that distinguishes the memory-operand UD1 path from a plain #UD beyond the inaccessible-page case already there; if the intent is that a readable memory operand also raises 0xC000001D rather than faulting on the access, that is not asserted today. Worth a line either way.

Verdict

Reviewed 743a8b4c. The refusal of UD0 stays, UD1 lowers and traps with the documented codes, and the added controls fail when the lowering is broken. No objections.

Notes

  • AI-assisted review.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7139764574 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1652#issuecomment-7139764574). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-24T17:49:47Z. --- Built and ran this at `743a8b4c`. It passes here, and the controls it adds are load-bearing — I checked by breaking the thing they guard. ```powershell cmake --preset dev cmake --build --preset dev ctest --preset dev --no-tests=error -R '^cpu_aot_trap$' -V ``` ```text 1/1 Test #546: cpu_aot_trap ... Passed ``` Environment: Windows 11 build 26300.9974, MSVC/ML64 19.44.35230. One note on reproducing it: **build the whole preset**. My first run failed with only `cpu_trap`, `cpu_trap_lifted` and `cpu_trap_harness` built, because the fixture loads the seven control DLLs too; after `cmake --build --preset dev` it passes. That is a property of the fixture, not of this change, but it will bite the next person who tries to run the test alone. ## Mutation check on the lowering itself `tools/ffx_version_query.py:999` emits `stmt = "__ud2(); // ud1"` for `0F B9 /r`. I replaced the emitted statement with a no-op, rebuilt `cpu_trap_lifted` and reran: ```text UD1 lowering replaced with a no-op -> cpu_aot_trap FAILED (rebuilt; reverted afterwards, PASS again) ``` So the new `udonedrop` / `udoneload` controls do what they claim: dropping the trap fails, and raising `0xC0000005` instead of `0xC000001D` fails. The printed control lines in the failure path are the ones a reader needs, and they name the function and the expected tuple. ## What I would add, if anything - A sentence in `docs/experiments.md` stating that `cpu_aot_trap` needs the complete preset build, since running it after building only the three obvious targets fails for an unrelated reason. Cheapest place: next to the command block that quotes this test. I can write it if you want it. - I did not find a case that distinguishes the memory-operand UD1 path from a plain `#UD` beyond the inaccessible-page case already there; if the intent is that a *readable* memory operand also raises `0xC000001D` rather than faulting on the access, that is not asserted today. Worth a line either way. ## Verdict Reviewed `743a8b4c`. The refusal of `UD0` stays, `UD1` lowers and traps with the documented codes, and the added controls fail when the lowering is broken. No objections. ## Notes - AI-assisted review.
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
R0Y00/Xbox2Windows!1645
No description provided.