Skip to content

Qwen3-0.6B inference (12 KB), bare-metal bootable OS (22 KB), and from-scratch Mini-GPT trainer with live Braille TUI (32 KB) in 100% pure x86-64 NASM assembly. Zero C, zero libc, zero dependencies.

Add 04-ring1-kernel-surgeon: Ring -1 AMD SVM hypervisor + MiniCPM5-2B live kernel patcher

Alexey Fateeve7d48837421d
diff --git a/.gitignore b/.gitignore
index ce9886f..2d983e2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+.env
*.o
*.bin
*.asmbin
@@ -5,6 +6,8 @@
*.safetensors
*.ckpt
*.iso
+*.r1m
+*.sqlite*
build/
runs/
models/
diff --git a/04-ring1-kernel-surgeon/.gitignore b/04-ring1-kernel-surgeon/.gitignore
new file mode 100644
index 0000000..615c30a
--- /dev/null
+++ b/04-ring1-kernel-surgeon/.gitignore
@@ -0,0 +1,26 @@
+.env
+.venv/
+build/
+runs/
+models/
+__pycache__/
+*.pyc
+*.r1m
+*.sqlite*
+*.db
+*.log
+*.iso
+*.img
+guest/vmlinuz
+guest/crash_mod/*.ko
+guest/crash_mod/*.o
+guest/crash_mod/*.mod*
+guest/crash_mod/.*.cmd
+guest/crash_mod/Module.symvers
+guest/crash_mod/modules.order
+guest/bench_mod/*.ko
+guest/bench_mod/*.o
+guest/bench_mod/*.mod*
+guest/bench_mod/.*.cmd
+guest/bench_mod/Module.symvers
+guest/bench_mod/modules.order
diff --git a/04-ring1-kernel-surgeon/ARCHITECTURE.md b/04-ring1-kernel-surgeon/ARCHITECTURE.md
new file mode 100644
index 0000000..09c437a
--- /dev/null
+++ b/04-ring1-kernel-surgeon/ARCHITECTURE.md
@@ -0,0 +1,136 @@
+# Ring -1 Kernel Surgeon — Architecture
+
+> **Target Platform:** x86-64 with AMD SVM + NPT (verified under nested `kvm_amd=1` on QEMU/KVM + OVMF UEFI + VNC)
+> **Safety Boundary:** All tests run inside **nested AMD SVM under QEMU/KVM** (`-cpu EPYC,+svm`). The host OS is never modified or rebooted.
+
+---
+
+## 1. Core Concept
+
+**Ring -1 Kernel Surgeon** is a bare-metal Type-1 AMD SVM hypervisor (`Ring -1`) that sits transparently underneath an unmodified Linux kernel (`Ring 0`).
+
+When Ring 0 triggers a fatal exception (e.g., `#PF` NULL-pointer dereference or `#UD` trap in kernel mode), AMD SVM hardware traps into Ring `-1` **before** Linux `do_page_fault` / `oops` / `panic()` can execute:
+1. Ring `-1` walks the guest 4-level page tables (`CR3`) to resolve the faulting `RIP` to a guest physical address (GPA).
+2. Ring `-1` reads the raw faulting machine instruction and captures full guest CPU state (GPRs, CRs, RFLAGS, stack).
+3. Ring `-1` renders a live **Surgical HUD Overlay** directly into the shared linear `efifb` / `vesafb` framebuffer (visible over VNC, completely bypassing guest DRM/VT locks).
+4. Ring `-1` decides a live machine-code patch:
+ - **Stage 1 (Proof of Ring `-1`):** Deterministic x86-64 instruction-length decode (`hv/x86_decode.c`) + live physical-memory patching of the faulting instruction in guest `.text` (bypassing guest `CR0.WP` and read-only PTEs) with an exact-length `0x90` NOP sled.
+ - **Stage 2/3 (AI Surgeon):** `surgeon_handle_fault()` (`hv/surgeon.c`) invokes a freestanding bare-metal local LLM (`MiniCPM5-2B Q4_K_M` packed in `.r1m` over a 2 GiB read-only NVDIMM, executed by `hv/llm_engine.c` across a 24-core LAPIC SMP pool with `XSAVE`/`XRSTOR` FPU isolation) and statically validates the proposed machine-code patch before writing guest physical memory.
+5. Ring `-1` resumes the guest via `VMRUN` (or cleanly delegates via `PASS_TO_LINUX` or freezes safely via `HALT_FOR_DUMP`). When patched, Linux never panics and continues running with its original `uptime` and processes intact.
+
+---
+
+## 2. Boot Chain & Execution Flow
+
+```text
+QEMU (-enable-kvm -cpu EPYC,+svm -vnc :1)
+ └── OVMF UEFI Firmware (sets GOP linear 32-bit BGRX framebuffer)
+ └── GRUB2 UEFI (Multiboot2)
+ ├── Kernel: /boot/surgeon.elf (Ring -1 Hypervisor, 64-bit ELF)
+ ├── Module 1: /boot/vmlinuz (Unmodified Linux 5.15 bzImage)
+ ├── Module 2: /boot/initramfs.cpio.gz (Minimal BusyBox + surgeon_crash.ko)
+ └── [Stage 2] /boot/model.asmbin (Quantized LLM weights in reserved RAM)
+```
+
+Inside `surgeon.elf`:
+1. **`hv/boot.asm` (32-bit -> 64-bit Long Mode):**
+ - Multiboot2 header requests linear 32-bit framebuffer (`1280x720x32` preferred; accepts GOP native resolution) and page-aligned modules.
+ - Sets up 4-level identity-mapped host page tables (`0..4 GiB` via 2 MiB pages, plus dynamic mapping if framebuffer > 4 GiB), GDT with 64-bit code/data + TSS, transitions to 64-bit Long Mode (`hv_main`).
+ - Compiled with `-mno-mmx -mno-sse -mno-sse2 -mno-avx -mno-red-zone` so Ring `-1` never clobbers guest FPU/XMM/AVX state during `#VMEXIT`.
+2. **Multiboot2 Parsing & Hardware Init (`hv/main.c`, `hv/serial.c`, `hv/fb.c`):**
+ - Initializes COM1 (`0x3F8`, 115200 8N1) serial logging.
+ - Parses Multiboot2 tags: framebuffer (`addr`, `width`, `height`, `pitch`, `bpp`, masks), E820 memory map, ACPI RSDP (v1/v2), and modules (`vmlinuz`, `initramfs`).
+ - Renders initial Ring `-1` boot banner onto the linear framebuffer.
+3. **Nested Page Table (NPT) & Memory Isolation (`hv/npt.c`):**
+ - Builds a 4-level AMD NPT covering `0..4 GiB` (plus any >4 GiB framebuffer BAR) with `P|W|U` (`0x07` / `0x87`, since AMD NPT treats all guest accesses as User-mode).
+ - **Ring `-1` Protection:** The hypervisor physical arena (`0x00200000 .. 0x003FFFFF`, 2 MiB) is:
+ 1. Marked `E820_RESERVED` (type 2) in Linux `boot_params.e820_table`.
+ 2. **Unmapped (`Present = 0`) in NPT**, so even a rogue Ring 0 kernel write cannot corrupt Ring `-1` code, VMCB, HSAVE, or future LLM weights.
+4. **Linux 64-bit Direct Boot Loader (`hv/linux_boot.c`):**
+ - Inspects `vmlinuz` bzImage `setup_header` (`0x01F1`), copies the protected-mode kernel payload to `pref_address` (`0x01000000`), relocates `initramfs.cpio.gz` to `0x08000000` (using bounce-safe copy to avoid overlap with GRUB module placement).
+ - Builds `boot_params` ("zero page") at `0x00600000` with:
+ - `screen_info` populated with `VIDEO_TYPE_EFI` (`0x70`) + exact GOP framebuffer geometry (`lfb_base`, `lfb_width`, `lfb_height`, `lfb_depth=32`, `lfb_linelength`, `lfb_size`, RGB bit positions/sizes) so Linux built-in `efifb` binds immediately.
+ - `acpi_rsdp_addr` copied from Multiboot2 ACPI tag.
+ - `e820_table` copied from Multiboot2 mmap with `0x00200000..0x003FFFFF` carved out as `E820_RESERVED`.
+ - Command line at `0x00601000`: `console=tty0 console=ttyS0,115200 earlyprintk=serial,ttyS0,115200 nokaslr panic=0`.
+ - Builds initial 64-bit identity guest page tables (`0..4 GiB`) at `0x00610000` for `startup_64`.
+5. **AMD SVM Activation & `VMRUN` Loop (`hv/svm.c`, `hv/svm_asm.asm`):**
+ - Verifies CPUID `0x80000001` ECX[2] (`SVM`) and `MSR_VM_CR` (`0xC0010114`) SVMDIS=0.
+ - Enables `MSR_EFER.SVME` (bit 12), programs `MSR_VM_HSAVE_PA` (`0xC0010117`) with 4KB-aligned host save area.
+ - Configures 4KB-aligned `VMCB`:
+ - `guest_asid = 1`, `np_enable = 1`, `n_cr3 = npt_pml4_pa`, `g_pat = 0x0007040600070406ULL`.
+ - Intercepts: `VMRUN` (mandatory), `VMMCALL`, `CPUID`, `MSR_PROT` (MSRPM intercepts ONLY `RDMSR/WRMSR` on `MSR_EFER` `0xC0000080`), `SHUTDOWN`, and exceptions `#UD` (vec 6), `#DF` (vec 8), `#PF` (vec 14).
+ - Guest state initialized for Linux 64-bit entry: `RIP = 0x01000200` (`startup_64`), `RSI = 0x00600000` (`&boot_params`), `CR3 = guest_init_pml4`, `EFER = LME|LMA|NXE|SCE|SVME`.
+ - Runs `CLGI -> VMSAVE host -> VMLOAD guest -> VMRUN -> VMSAVE guest -> VMLOAD host` loop.
+
+---
+
+## 3. Physical Memory Map (Stage 1, 2 GiB Guest RAM)
+
+| Physical Range | Size | NPT Mapping | Guest E820 | Owner / Usage |
+|---|---:|---|---|---|
+| `0x0000_0000 .. 0x000F_FFFF` | 1 MiB | 1:1 `P\|W\|U` | BIOS/Low | Low RAM / EBDA / ACPI |
+| `0x0010_0000 .. 0x001F_FFFF` | 1 MiB | 1:1 `P\|W\|U` | Usable | Guest low extended RAM |
+| `0x0020_0000 .. 0x003F_FFFF` | 2 MiB | **UNMAPPED (`0`)** | **`E820_RESERVED`** | **Ring `-1` Hypervisor (ELF, stacks, VMCB, HSAVE, MSRPM, NPT)** |
+| `0x0060_0000 .. 0x0063_FFFF` | 256 KiB | 1:1 `P\|W\|U` | Usable | `boot_params`, cmdline, initial guest PT |
+| `0x0100_0000 .. 0x03FF_FFFF` | 48 MiB | 1:1 `P\|W\|U` | Usable | Linux `vmlinuz` kernel payload & decompression arena |
+| `0x0800_0000 .. 0x09FF_FFFF` | 32 MiB | 1:1 `P\|W\|U` | Usable | `initramfs.cpio.gz` |
+| `0x0A00_0000 .. 0x7DFF_FFFF` | ~1.8 GiB | 1:1 `P\|W\|U` | Usable | Guest Linux RAM |
+| `0x8000_0000 .. 0xFFFF_FFFF` | 2 GiB | 1:1 `P\|W\|U` (+MMIO) | Reserved/MMIO | GOP Linear Framebuffer, PCI MMIO, IOAPIC, LAPIC |
+
+*(In Stage 2, QEMU RAM increases to 6–8 GiB and an additional high physical arena is carved out of E820 and unmapped from NPT to house quantized LLM weights + KV cache.)*
+
+---
+
+## 4. Surgical Intercept & Live-Patch Protocol
+
+### Fast-Path vs. Surgeon-Path Decision
+- **`CPUID` (`0x72`):** Execute host `cpuid`, clear `SVM` bit (`ECX[2]`) on `EAX == 0x80000001` so Linux stays unaware of SVM; advertise `"Ring1Surgeon"` on leaf `0x40000000`; advance `RIP = next_rip`.
+- **`MSR` (`0x7C` on `0xC0000080` `EFER`):**
+ - `RDMSR`: return `vmcb.save.efer & ~EFER_SVME` (transparently hides `SVME`).
+ - `WRMSR`: store `val | EFER_SVME` into `vmcb.save.efer` (prevents guest from clearing `SVME` and triggering `VMEXIT_INVALID`).
+- **`#PF` (`0x4E`, Vector 14):**
+ - If `CPL != 0` **or** `CR2 >= 0x1000` (normal userspace page fault, demand paging, COW, `copy_from_user`): fast re-inject via `VMCB.eventinj` (`vector=14, type=3, EV=1, V=1, err=exitinfo1`) and `vmcb.save.cr2 = exitinfo2`.
+ - If `CPL == 0` **and** `CR2 < 0x1000` (Ring 0 NULL-pointer dereference, e.g. `surgeon_crash.ko` or `sysrq-trigger`): **invoke Surgeon pipeline**.
+- **`#UD` (`0x46`, Vector 6):**
+ - If `CPL != 0`: fast re-inject `#UD` to guest.
+ - If `CPL == 0`: check if faulting bytes are `0F 0B` (`ud2`) from our crash target / Ring 0 fault -> **invoke Surgeon pipeline** (if Linux `BUG()`/`WARN_ON` outside test or configured passthrough, can optionally re-inject; in Stage 1 Ring 0 `#UD` is healed cleanly when triggered via `surgeon_crash` or test).
+- **`VMMCALL` (`0x81`):** Diagnostic hypercall (`RAX = 0x53555247` `"SURG"` returns heal count & hypervisor status; `RAX = 0x53555248` forces HUD redraw).
+
+### Stage 2 Extension Point (`hv/surgeon.h`)
+```c
+typedef struct {
+ uint32_t vector; // 14 (#PF) or 6 (#UD)
+ uint64_t error_code;
+ uint64_t cr2;
+ uint64_t rip_gva;
+ uint64_t rip_gpa;
+ uint8_t orig_bytes[16];
+ uint8_t insn_len;
+ GuestRegs *regs;
+ Vmcb *vmcb;
+} SurgeonContext;
+
+typedef struct {
+ uint8_t patch_bytes[16];
+ uint8_t patch_len;
+ const char *reason; // Shown in Ring -1 HUD overlay
+} SurgeonPatch;
+
+bool surgeon_decide_patch(const SurgeonContext *ctx, SurgeonPatch *out);
+```
+Stage 1 implements `surgeon_decide_patch()` deterministically (exact-length NOP sled verified by `x86_decode_len()`). Stage 2 swaps only this function to call the bare-metal LLM + static machine-code verifier.
+
+---
+
+## 5. Verification Plan (Stage 1)
+
+1. Build `surgeon.elf`, `surgeon_crash.ko`, `initramfs.cpio.gz`, and UEFI bootable `ring1-surgeon.iso` via `make`.
+2. Boot under QEMU nested AMD SVM (`scripts/run_qemu.sh` with `-enable-kvm -cpu EPYC,+svm -vnc :1`).
+3. Confirm in serial log + VNC framebuffer:
+ - Ring `-1` initializes AMD SVM + NPT and launches Linux `5.15.0-185-generic` via `VMRUN`.
+ - Linux mounts `efifb` on the shared linear framebuffer and reaches shell.
+ - `insmod /lib/modules/surgeon_crash.ko` loads cleanly.
+ - `echo pf > /proc/surgeon_crash` triggers a real Ring 0 NULL-pointer dereference (`*(volatile uint32_t *)0 = 0xDEADBEEF`).
+ - Ring `-1` intercepts `#PF`, resolves `RIP` via guest PT walk, draws the **Ring `-1` Surgical HUD Overlay** directly onto the live VNC framebuffer, live-patches the faulting instruction bytes in guest `.text` physical RAM to `NOP`s, and resumes `VMRUN`.
+ - Linux **survives without panicking**, prints confirmation to both VNC console and `ttyS0`, `uptime` continues ticking, and `echo ud > /proc/surgeon_crash` similarly heals a Ring 0 `#UD` (`ud2`) trap live.
diff --git a/04-ring1-kernel-surgeon/Makefile b/04-ring1-kernel-surgeon/Makefile
new file mode 100644
index 0000000..e4b8e62
--- /dev/null
+++ b/04-ring1-kernel-surgeon/Makefile
@@ -0,0 +1,79 @@
+NASM := nasm
+CC := gcc
+LD := ld
+
+BUILD := build
+HV_DIR := hv
+HV_BLD := $(BUILD)/hv
+
+CFLAGS_NOFPU := -m64 -ffreestanding -fno-stack-protector -fno-pic -fno-pie \
+ -mcmodel=small -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -mno-avx \
+ -O2 -Wall -Wextra -Werror -std=gnu11 -I$(HV_DIR)
+
+CFLAGS_AVX2 := -m64 -ffreestanding -fno-stack-protector -fno-pic -fno-pie \
+ -mcmodel=small -mno-red-zone -mavx2 -mfma -mf16c \
+ -O3 -Wall -Wextra -Werror -std=gnu11 -I$(HV_DIR)
+
+AFLAGS := -f elf64
+LDFLAGS := -m elf_x86_64 -nostdlib -T $(HV_DIR)/linker.ld -z max-page-size=0x1000
+
+HV_ELF := $(BUILD)/surgeon.elf
+KO := guest/crash_mod/surgeon_crash.ko
+INITRD := $(BUILD)/initramfs.cpio.gz
+VMLINUZ := guest/vmlinuz
+ISO := $(BUILD)/ring1-surgeon.iso
+
+HV_OBJS := \
+ $(HV_BLD)/boot.o \
+ $(HV_BLD)/svm_asm.o \
+ $(HV_BLD)/ap_trampoline.o \
+ $(HV_BLD)/serial.o \
+ $(HV_BLD)/fb.o \
+ $(HV_BLD)/npt.o \
+ $(HV_BLD)/smp.o \
+ $(HV_BLD)/x86_decode.o \
+ $(HV_BLD)/linux_boot.o \
+ $(HV_BLD)/llm_engine.o \
+ $(HV_BLD)/surgeon.o \
+ $(HV_BLD)/main.o
+
+.PHONY: all hv crash-mod initramfs iso clean
+
+all: iso
+
+$(HV_BLD):
+ mkdir -p $(HV_BLD)
+
+$(HV_BLD)/%.o: $(HV_DIR)/%.asm | $(HV_BLD)
+ $(NASM) $(AFLAGS) $< -o $@
+
+$(HV_BLD)/llm_engine.o: $(HV_DIR)/llm_engine.c $(HV_DIR)/*.h | $(HV_BLD)
+ $(CC) $(CFLAGS_AVX2) -c $< -o $@
+
+$(HV_BLD)/%.o: $(HV_DIR)/%.c $(HV_DIR)/*.h | $(HV_BLD)
+ $(CC) $(CFLAGS_NOFPU) -c $< -o $@
+
+$(HV_ELF): $(HV_OBJS) $(HV_DIR)/linker.ld
+ $(LD) $(LDFLAGS) $(HV_OBJS) -o $@
+ @ls -lh $@
+
+hv: $(HV_ELF)
+
+$(KO): guest/crash_mod/surgeon_crash.c guest/crash_mod/Makefile
+ $(MAKE) -C guest/crash_mod
+
+crash-mod: $(KO)
+
+$(INITRD): $(KO) scripts/build_initramfs.sh | $(HV_BLD)
+ bash scripts/build_initramfs.sh $(KO) $(INITRD)
+
+initramfs: $(INITRD)
+
+$(ISO): $(HV_ELF) $(VMLINUZ) $(INITRD) scripts/mkiso.sh
+ bash scripts/mkiso.sh $(HV_ELF) $(VMLINUZ) $(INITRD) $(ISO)
+
+iso: $(ISO)
+
+clean:
+ rm -rf $(BUILD)/hv $(HV_ELF) $(INITRD) $(ISO)
+ $(MAKE) -C guest/crash_mod clean || true
diff --git a/04-ring1-kernel-surgeon/README.md b/04-ring1-kernel-surgeon/README.md
new file mode 100644
index 0000000..f81284c
--- /dev/null
+++ b/04-ring1-kernel-surgeon/README.md
@@ -0,0 +1,128 @@
+# Ring -1 Kernel Surgeon
+
+Bare-metal Type-1 AMD SVM hypervisor (`Ring -1`) running beneath an unmodified Linux kernel (`Ring 0`) with an embedded freestanding **MiniCPM5-2B (`Q4_K_M`)** diagnostic and live-patching engine.
+
+When Ring 0 triggers a fatal exception (`#PF` NULL-pointer dereference, `#DE` divide-by-zero, or `#UD` trap), AMD SVM hardware traps into Ring `-1` **before** Linux `oops()` / `panic()` can execute. Ring `-1` walks guest page tables, reads the faulting machine instruction and registers, runs **MiniCPM5-2B `Q4_K_M`** across 24 bare-metal LAPIC SMP cores inside an NPT-isolated arena, streams a surgical HUD directly onto the live `efifb` framebuffer, statically validates the proposed x86-64 machine-code patch, writes it into guest physical memory (bypassing guest `CR0.WP` and read-only PTEs), and resumes Linux via `VMRUN` without rebooting — or safely delegates benign exceptions (`PASS_TO_LINUX`) or freezes unrecoverable hazards (`HALT_FOR_DUMP`).
+
+---
+
+## Architecture Highlights
+
+- **Bare-Metal Hypervisor (`build/surgeon.elf`, 75,424 B):** NASM (`boot.asm`, `svm_asm.asm`, `ap_trampoline.asm`) + freestanding zero-libc, zero-libm C (`-ffreestanding -nostdlib`). Fast-path `#VMEXIT` handlers compile with `-mno-mmx -mno-sse -mno-sse2 -mno-avx -mno-red-zone`; `XSAVE`/`XRSTOR` isolates guest FPU/SSE/AVX state around Ring `-1` AVX2+FMA+F16C inference (`hv/llm_engine.c`).
+- **24-Core Bare-Metal SMP Worker Pool (`hv/smp.c`):** Ring `-1` boots up to 24 physical/virtual LAPIC cores (`INIT-SIPI-SIPI`) for parallel quantized matmul while Linux runs on BSP CPU 0 (`nr_cpus=1` or isolated APs).
+- **Hardware AMD NPT Isolation (`hv/npt.c`):** Hypervisor ELF (`0x200000..0x3FFFFF`), 64 MiB KV/scratch arena (`0x70000000..0x73FFFFFF`), and the 2 GiB read-only NVDIMM model (`.r1m` @ `0x100000000`) are all **unmapped (`Present=0`) in AMD NPT** and hidden from the Linux E820 map.
+- **3-Action Safety Policy:** Every fault yields a strict 3-line decision (`DIAGNOSIS`, `ACTION`, `PATCH`) with no `<think>` output:
+ - `PATCH_BYTES` — exact-length x86-64 patch bytes verified by static instruction decoding (`hv/surgeon.c`, `hv/x86_decode.c`) before writing guest RAM.
+ - `PASS_TO_LINUX` — re-injects userspace (`CPL=3`) faults, `_ASM_EXTABLE` probes (`copy_from_user` / `get_user`), and `WARN_ON_ONCE` natively into Linux.
+ - `HALT_FOR_DUMP` — freezes the guest safely when `lock_held=1`, `irq_ctx=1`, `side_effect=1`, `stack_ok=0`, or `obs_complete=0`.
+
+See [ARCHITECTURE.md](ARCHITECTURE.md) for the physical memory map, VMCB setup, and intercept protocol.
+
+---
+
+## Evaluation & Verification Results
+
+### 1. Held-Out Unseen Scenarios (`dataset/scenarios_600.jsonl`: `356 train / 122 val / 122 test`, zero family overlap)
+
+Evaluated with `training/eval_model.py` + `verifier/kvm_verifier.py` (3-tier verifier: L1 schema + Capstone x86-64 safety check, L2 safety contract policy, L3 isolated single-level QEMU/KVM Linux 5.15 Ring 0 execution via `guest/bench_mod/surgeon_bench.ko`):
+
+| Model (`MiniCPM5-2B`) | Test Pass@1 (`n=122`) | Val Pass@1 (`n=122`) | Avg Reward (Test) | Dangerous Continue | Excess Halt | `<think>` Leaks |
+|---|---:|---:|---:|---:|---:|---:|
+| **Base** (`bf16`) | `16.39%` *(20/122)* | `16.39%` *(20/122)* | `-0.5984` | `8.20%` *(10)* | `7.38%` *(9)* | `0` |
+| **SFT** (LoRA merged) | `95.90%` *(117/122)* | `97.54%` *(119/122)* | `+0.9180` | `0.00%` *(0)* | `0.00%` *(0)* | `0` |
+| **GRPO** (KVM-verified RL) | **`97.54%`** *(119/122)* | **`98.36%`** *(120/122)* | **`+0.9508`** | **`0.00%`** *(0)* | **`0.00%`** *(0)* | **`0`** |
+
+Per-category test breakdown (`n=122`, GRPO):
+- `pf_patchable`: `29/32` pass (`0` dangerous)
+- `de_patchable`: `30/30` pass (`0` dangerous)
+- `ud_patchable`: `30/30` pass (`0` dangerous)
+- `pass_to_linux`: `15/15` pass (`0` dangerous)
+- `halt_for_dump`: `15/15` pass (`0` dangerous)
+
+### 2. End-to-End Bare-Metal Ring `-1` Nested-SVM Verification
+
+Verified with `scripts/verify_stage3.py` under QEMU/KVM (`-machine q35,accel=kvm,nvdimm=on -cpu EPYC,+svm -smp 24`) running `MiniCPM5-2B Q4_K_M` (`minicpm5-2b-surgeon.r1m`, 2 GiB NVDIMM) inside Ring `-1` beneath Linux `5.15`:
+- `echo pf > /proc/surgeon_crash`: intercepts `#PF` (`c7 04 25 00 00 00 00 ef be ad de`, 11 B) -> applies `11x 0x90` NOP sled -> Linux survives (`SURVIVED NULL-DEREF!`).
+- `echo de > /proc/surgeon_crash`: intercepts `#DE` (`f7 f1`, `div ecx`, 2 B) -> applies `31 c0` (`xor eax, eax`) -> Linux survives with `quotient=0`.
+- `echo ud > /proc/surgeon_crash`: intercepts `#UD` (`0f 0b`, `ud2`, 2 B) -> applies `90 90` -> Linux survives (`SURVIVED UD2 TRAP!`).
+- `echo extable > /proc/surgeon_crash`: intercepts `_ASM_EXTABLE` `get_user(0x10)` -> outputs `PASS_TO_LINUX` -> Linux handles natively (`rc=-14`).
+- Continuous `uptime` and `boot_id` verified across all recoveries (`VMMCALL` reports `heals=3 l1_cores=24 llm_ready=1`).
+- `echo danger > /proc/surgeon_crash`: intercepts spinlock-held `#PF` (`lock_held=1`) -> outputs `HALT_FOR_DUMP` -> guest frozen cleanly without corruption.
+
+---
+
+## Repository Layout
+
+- `ARCHITECTURE.md` — technical design, physical memory map, NPT isolation, SVM intercepts.
+- `hv/` — bare-metal Ring `-1` AMD SVM hypervisor (`boot.asm`, `svm_asm.asm`, `ap_trampoline.asm`, `main.c`, `npt.c`, `smp.c`, `surgeon.c`, `llm_engine.c`, `x86_decode.c`, `fb.c`, `serial.c`, `linux_boot.c`).
+- `guest/crash_mod/` — **Ring 0 fault-injection test module** (`surgeon_crash.c`, builds `surgeon_crash.ko`, exposes `/proc/surgeon_crash` with `pf | de | ud | extable | danger | status | hud` triggers).
+- `guest/bench_mod/` — **single-level KVM Ring 0 postcondition verifier module** (`surgeon_bench.c`, builds `surgeon_bench.ko`, exposes `/proc/surgeon_bench` for isolated canary/lock/return/repeat-call checks).
+- `dataset/` — 48-scenario pilot (`scenarios.py`, `pilot_scenarios.jsonl`), 600-scenario corpus (`scenarios_600.py`, `scenarios_600.jsonl`), and DeepSeek API distillation pipeline (`generate_deepseek.py`).
+- `verifier/` — 3-tier single-level KVM verifier (`kvm_verifier.py`) with Capstone static checks, policy enforcement, QEMU/KVM execution, and SQLite cache.
+- `training/` — LoRA SFT (`sft_minicpm5.py`), GRPO (`grpo_minicpm5.py`), model evaluation (`eval_model.py`), TensorBoard logger (`tb_logger.py`), and YAML configs (`training/configs/`).
+- `dashboard/` — FastAPI live training & KVM-verifier dashboard (`server.py`).
+- `scripts/` — initramfs/ISO builders (`build_initramfs.sh`, `build_verifier_initramfs.sh`, `mkiso.sh`), QEMU/VNC launchers (`run_qemu.sh`, `run_demo_vnc.sh`), GGUF/`.r1m` packers (`export_gguf.sh`, `pack_r1model.py`), host LLM test (`test_r1_llm.c`), and end-to-end verification (`verify_stage1.py`, `verify_stage3.py`).
+- `Makefile` — builds `build/surgeon.elf`, `guest/crash_mod/surgeon_crash.ko`, `build/initramfs.cpio.gz`, and `build/ring1-surgeon.iso`.
+
+---
+
+## Prerequisites
+
+- **Hardware / Host:** x86-64 AMD CPU with SVM + NPT (`nested=1` in `kvm_amd`) and `/dev/kvm` access for nested QEMU/KVM runs.
+- **Build Tools:** `gcc`, `nasm`, `ld`, `grub-mkstandalone`, `xorriso`, `busybox`, `cpio`, `gzip`, `python3`, OVMF UEFI firmware (`/usr/share/OVMF/OVMF_CODE.fd`), and target Linux kernel headers (`KDIR ?= /lib/modules/5.15.0-185-generic/build`) plus `guest/vmlinuz`.
+- **Python (for verifier / training / dashboard):** `capstone`, `fastapi`, `uvicorn`, `pyyaml`, `httpx`, `torch`, `transformers`, `trl`, `peft`, `datasets`, `tensorboard`, `gguf`.
+
+---
+
+## Build & Run
+
+### 1. Build Hypervisor, Fault-Injection Test Module, and Bootable ISO
+
+```bash
+cd 04-ring1-kernel-surgeon
+# Place or symlink the guest kernel bzImage at guest/vmlinuz
+make hv # Build only build/surgeon.elf (75 KB Ring -1 hypervisor)
+make all # Build surgeon.elf, guest/crash_mod/surgeon_crash.ko, initramfs, and ISO
+```
+
+### 2. Launch Interactive QEMU Nested-SVM + VNC
+
+```bash
+# Default VNC binds 127.0.0.1:5901 (set VNC_BIND=0.0.0.0 for remote access)
+./scripts/run_qemu.sh
+
+# Or run the Stage 3 demo with a packed .r1m NVDIMM model:
+MODEL_R1M=models/minicpm5-2b-surgeon.r1m ./scripts/run_demo_vnc.sh surgeon
+```
+
+Inside the guest shell (`tty0` / `ttyS0`):
+
+```sh
+echo pf > /proc/surgeon_crash # Ring 0 NULL-pointer dereference (#PF)
+echo de > /proc/surgeon_crash # Ring 0 divide-by-zero (#DE)
+echo ud > /proc/surgeon_crash # Ring 0 invalid opcode (#UD / ud2)
+echo extable > /proc/surgeon_crash # Benign _ASM_EXTABLE probe (PASS_TO_LINUX)
+echo danger > /proc/surgeon_crash # Spinlock-held #PF (HALT_FOR_DUMP)
+echo status > /proc/surgeon_crash # Query Ring -1 VMMCALL counters
+uptime && dmesg | tail -n 15
+```
+
+### 3. Verifier, Distillation, SFT/GRPO & Dashboard
+
+```bash
+# 1. Verify single-level KVM verifier (48 golden + adversarial checks)
+python3 verifier/kvm_verifier.py --selftest
+
+# 2. Run DeepSeek API distillation (expects DEEPSEEK_API_KEY in env or .env)
+python3 dataset/generate_deepseek.py --model deepseek-flash --limit 600 --out-dir runs/dataset_600
+
+# 3. Validate SFT & GRPO configs (dry-run)
+python3 training/sft_minicpm5.py --dry-run
+python3 training/grpo_minicpm5.py --dry-run
+
+# 4. Evaluate a checkpoint on the held-out test split
+python3 training/eval_model.py --model-path runs/grpo-minicpm5-2b/merged --tag grpo --split test --out-json runs/eval_grpo_test.json
+
+# 5. Launch TensorBoard (:6006) + Live Web Dashboard (:8780)
+./scripts/run_dashboard.sh
+```
diff --git a/04-ring1-kernel-surgeon/dashboard/server.py b/04-ring1-kernel-surgeon/dashboard/server.py
new file mode 100755
index 0000000..d9aa043
--- /dev/null
+++ b/04-ring1-kernel-surgeon/dashboard/server.py
@@ -0,0 +1,317 @@
+#!/usr/bin/env python3
+"""
+Ring -1 Kernel Surgeon — Live Dashboard (FastAPI, zero external CDN deps)
+Displays all 4 training/verification telemetry charts + live VM verifier queue + Before/After Surgical Examples!
+"""
+from __future__ import annotations
+import glob
+import json
+import os
+import sys
+from collections import Counter
+from typing import Any, Dict, List
+
+from fastapi import FastAPI
+from fastapi.responses import HTMLResponse, JSONResponse
+import uvicorn
+
+PROJ = os.environ.get("SURGEON_PROJ", os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+app = FastAPI(title="Ring -1 Kernel Surgeon — Training & KVM Verifier Dashboard")
+
+def find_latest_pilot_dir() -> str:
+ env_dir = os.environ.get("SURGEON_PILOT_DIR", "").strip()
+ if env_dir and os.path.isdir(env_dir):
+ return env_dir
+ for sym in ["latest_dataset_600", "latest_pilot"]:
+ sp = os.path.join(PROJ, "runs", sym)
+ if os.path.isdir(sp):
+ return os.path.realpath(sp)
+ cands = sorted(
+ glob.glob(os.path.join(PROJ, "runs", "*", "dataset_*")) + glob.glob(os.path.join(PROJ, "runs", "*", "pilot_*")),
+ key=os.path.getmtime, reverse=True
+ )
+ return cands[0] if cands else os.path.join(PROJ, "runs")
+
+def find_latest_events_file() -> str:
+ env_f = os.environ.get("SURGEON_EVENTS_JSONL", "").strip()
+ if env_f and os.path.isfile(env_f):
+ return env_f
+ cands = sorted(glob.glob(os.path.join(PROJ, "runs", "**", "dashboard_events.jsonl"), recursive=True),
+ key=os.path.getmtime, reverse=True)
+ return cands[0] if cands else ""
+
+def load_jsonl(path: str) -> List[dict]:
+ if not path or not os.path.isfile(path):
+ return []
+ out = []
+ with open(path) as f:
+ for line in f:
+ line = line.strip()
+ if line:
+ try: out.append(json.loads(line))
+ except Exception: pass
+ return out
+
[email protected]("/api/state")
+def api_state() -> JSONResponse:
+ pilot_dir = find_latest_pilot_dir()
+ summary_path = os.path.join(pilot_dir, "pilot_summary.json")
+ summary = json.load(open(summary_path)) if os.path.isfile(summary_path) else {}
+ raw_items = load_jsonl(os.path.join(pilot_dir, "teacher_raw.jsonl"))
+ events = load_jsonl(find_latest_events_file())
+
+ examples = []
+ for rec in raw_items:
+ v = rec.get("verify", {})
+ examples.append({
+ "scenario_id": rec.get("scenario_id"),
+ "family_id": rec.get("family_id"),
+ "category": rec.get("category"),
+ "split": rec.get("split"),
+ "model": rec.get("model"),
+ "prompt": rec.get("prompt"),
+ "student_target": rec.get("student_target"),
+ "teacher_reasoning": rec.get("teacher_reasoning", "")[:1500],
+ "expected_action": v.get("expected_action"),
+ "pred_action": v.get("pred_action"),
+ "pred_patch_hex": v.get("pred_patch_hex"),
+ "disasm_patch": v.get("disasm_patch", ""),
+ "reward": v.get("reward"),
+ "passed": v.get("passed"),
+ "vm_verified": v.get("vm_verified"),
+ "dangerous_continue": v.get("dangerous_continue"),
+ "excess_halt": v.get("excess_halt"),
+ "tier": v.get("tier"),
+ "latency_ms": round(float(v.get("latency_ms", 0.0)), 1),
+ "detail": v.get("detail", ""),
+ "boot_id": v.get("boot_id", ""),
+ "uptime": v.get("uptime", ""),
+ })
+
+ return JSONResponse({
+ "pilot_dir": pilot_dir,
+ "summary": summary,
+ "events": events,
+ "examples": examples,
+ "tensorboard_url": f"http://{os.environ.get('SURGEON_HOST', '127.0.0.1')}:{os.environ.get('TB_PORT', '6006')}",
+ })
+
+HTML_PAGE = r"""<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width,initial-scale=1" />
+<title>Ring -1 Kernel Surgeon — Live Training & KVM Verifier</title>
+<style>
+ :root {
+ --bg: #070b14; --panel: #0f1626; --border: #1f2b47; --text: #e5edf8;
+ --muted: #8b9bb8; --cyan: #22d3ee; --green: #34d399; --amber: #fbbf24;
+ --red: #f87171; --violet: #a78bfa;
+ }
+ * { box-sizing: border-box; }
+ body { margin: 0; background: var(--bg); color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
+ header { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); background: #0a101e; }
+ .brand { font-size: 16px; font-weight: 700; color: var(--cyan); letter-spacing: 0.5px; }
+ .sub { font-size: 12px; color: var(--muted); }
+ .pill { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 12px; border: 1px solid var(--border); background: #131c31; color: var(--text); text-decoration: none; margin-left: 8px; }
+ .pill.live { border-color: #065f46; background: #064e3b; color: #a7f3d0; }
+ .wrap { padding: 16px 20px; max-width: 1520px; margin: 0 auto; }
+ .kpi-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
+ .kpi { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
+ .kpi .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; }
+ .kpi .val { font-size: 22px; font-weight: 700; margin-top: 4px; }
+ .grid4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 18px; }
+ .card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
+ .card h3 { margin: 0 0 8px 0; font-size: 13px; color: var(--cyan); display: flex; justify-content: space-between; }
+ .card h3 span { color: var(--muted); font-weight: 400; font-size: 11px; }
+ svg.chart { width: 100%; height: 170px; background: #090e1a; border-radius: 6px; border: 1px solid #162038; }
+ .legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
+ .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
+ .filters { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
+ button.flt { background: #131c31; border: 1px solid var(--border); color: var(--text); padding: 5px 10px; border-radius: 6px; cursor: pointer; font-family: inherit; font-size: 12px; }
+ button.flt.active { border-color: var(--cyan); color: var(--cyan); background: #0c2235; }
+ .ex-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
+ .ex { background: #0b1120; border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
+ .ex.pass { border-left: 3px solid var(--green); }
+ .ex.fail { border-left: 3px solid var(--red); }
+ .ex-hdr { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 12px; }
+ .tag { padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 700; }
+ .tag.pass { background: #064e3b; color: #6ee7b7; }
+ .tag.fail { background: #7f1d1d; color: #fecaca; }
+ .tag.vm { background: #1e3a8a; color: #93c5fd; }
+ pre { background: #060911; border: 1px solid #162038; padding: 8px; border-radius: 6px; font-size: 11px; overflow-x: auto; margin: 6px 0; white-space: pre-wrap; }
+ details summary { cursor: pointer; font-size: 11px; color: var(--amber); margin-top: 4px; }
+ @media (max-width: 1024px) { .kpi-row { grid-template-columns: repeat(3, 1fr); } .grid4, .ex-grid { grid-template-columns: 1fr; } }
+</style>
+</head>
+<body>
+<header>
+ <div>
+ <div class="brand">[ RING -1 KERNEL SURGEON ] // TRAINING + SINGLE-LEVEL KVM VERIFIER</div>
+ <div class="sub" id="runMeta">Loading run metadata...</div>
+ </div>
+ <div>
+ <span class="pill live" id="liveBadge">LIVE SYNC</span>
+ <a class="pill" id="tbLink" href="http://127.0.0.1:6006" target="_blank">Open TensorBoard :6006</a>
+ </div>
+</header>
+<div class="wrap">
+ <div class="kpi-row">
+ <div class="kpi"><div class="lbl">Pilot Pass@1</div><div class="val" id="kPass" style="color:var(--green)">-</div></div>
+ <div class="kpi"><div class="lbl">VM-Verified</div><div class="val" id="kVm" style="color:var(--cyan)">-</div></div>
+ <div class="kpi"><div class="lbl">Dangerous Continue</div><div class="val" id="kDanger" style="color:var(--red)">-</div></div>
+ <div class="kpi"><div class="lbl">KVM p95 Latency</div><div class="val" id="kP95" style="color:var(--amber)">-</div></div>
+ <div class="kpi"><div class="lbl">SFT Clean Pairs</div><div class="val" id="kSft" style="color:var(--violet)">-</div></div>
+ <div class="kpi"><div class="lbl">Teacher API Cost</div><div class="val" id="kCost">-</div></div>
+ </div>
+
+ <div class="grid4">
+ <div class="card">
+ <h3>1. Train Reward &amp; Zero-Variance Groups <span>Panel 1</span></h3>
+ <svg class="chart" id="c1"></svg>
+ <div class="legend"><span><i class="dot" style="background:#34d399"></i>Reward (-2..+1)</span><span><i class="dot" style="background:#fbbf24"></i>Zero-Var Group Frac</span></div>
+ </div>
+ <div class="card">
+ <h3>2. Validation Pass@1 &amp; Safety Rates <span>Panel 2</span></h3>
+ <svg class="chart" id="c2"></svg>
+ <div class="legend"><span><i class="dot" style="background:#22d3ee"></i>Pass@1</span><span><i class="dot" style="background:#f87171"></i>Dangerous Continue</span><span><i class="dot" style="background:#fbbf24"></i>Excess Halt</span></div>
+ </div>
+ <div class="card">
+ <h3>3. Policy Entropy &amp; Action Mix <span>Panel 3</span></h3>
+ <svg class="chart" id="c3"></svg>
+ <div class="legend"><span><i class="dot" style="background:#a78bfa"></i>PATCH_BYTES</span><span><i class="dot" style="background:#22d3ee"></i>PASS_TO_LINUX</span><span><i class="dot" style="background:#fbbf24"></i>HALT_FOR_DUMP</span></div>
+ </div>
+ <div class="card">
+ <h3>4. Single-Level KVM Verifier Telemetry <span>Panel 4 (NO savevm)</span></h3>
+ <svg class="chart" id="c4"></svg>
+ <div class="legend"><span><i class="dot" style="background:#34d399"></i>VM Pass Frac</span><span><i class="dot" style="background:#22d3ee"></i>p95 Latency (s)</span></div>
+ </div>
+ </div>
+
+ <div class="card">
+ <h3>Live Before / After Surgical Examples (KVM-Verified) <span id="exCount"></span></h3>
+ <div class="filters" id="filters"></div>
+ <div class="ex-grid" id="exGrid"></div>
+ </div>
+</div>
+
+<script>
+let STATE = null;
+let ACTIVE_CAT = "ALL";
+
+function drawChart(svgId, seriesList, yMin, yMax) {
+ const svg = document.getElementById(svgId);
+ const W = 640, H = 170, padL = 36, padR = 14, padT = 14, padB = 22;
+ svg.setAttribute("viewBox", `0 0 ${W} ${H}`);
+ let html = "";
+ for (let i = 0; i <= 4; i++) {
+ const y = padT + (H - padT - padB) * (i / 4);
+ const v = (yMax - (yMax - yMin) * (i / 4)).toFixed(2);
+ html += `<line x1="${padL}" y1="${y}" x2="${W-padR}" y2="${y}" stroke="#162038" stroke-width="1"/>`;
+ html += `<text x="${padL-4}" y="${y+3}" fill="#64748b" font-size="9" text-anchor="end">${v}</text>`;
+ }
+ const maxN = Math.max(2, ...seriesList.map(s => s.pts.length));
+ for (const s of seriesList) {
+ if (!s.pts.length) continue;
+ const coords = s.pts.map((v, idx) => {
+ const x = padL + (W - padL - padR) * (s.pts.length === 1 ? 0.5 : idx / (maxN - 1));
+ const clamped = Math.max(yMin, Math.min(yMax, v));
+ const y = padT + (H - padT - padB) * (1 - (clamped - yMin) / (yMax - yMin));
+ return [x, y];
+ });
+ const d = coords.map((c, i) => `${i===0?"M":"L"}${c[0].toFixed(1)},${c[1].toFixed(1)}`).join(" ");
+ html += `<path d="${d}" fill="none" stroke="${s.color}" stroke-width="2"/>`;
+ for (const [x, y] of coords) {
+ html += `<circle cx="${x.toFixed(1)}" cy="${y.toFixed(1)}" r="2.6" fill="${s.color}"/>`;
+ }
+ }
+ svg.innerHTML = html;
+}
+
+function renderExamples() {
+ if (!STATE) return;
+ const exs = STATE.examples.filter(e => {
+ if (ACTIVE_CAT === "ALL") return true;
+ if (ACTIVE_CAT === "FAIL") return !e.passed;
+ return e.category === ACTIVE_CAT;
+ });
+ document.getElementById("exCount").textContent = `Showing ${exs.length} / ${STATE.examples.length}`;
+ document.getElementById("exGrid").innerHTML = exs.map(e => `
+ <div class="ex ${e.passed ? "pass" : "fail"}">
+ <div class="ex-hdr">
+ <div><strong>${e.scenario_id}</strong> <span style="color:var(--muted)">(${e.split} · ${e.category})</span></div>
+ <div>
+ ${e.vm_verified ? `<span class="tag vm">VM ${e.latency_ms}ms</span>` : ""}
+ <span class="tag ${e.passed ? "pass" : "fail"}">${e.passed ? "PASS" : "FAIL"} r=${e.reward}</span>
+ </div>
+ </div>
+ <div style="font-size:11px;color:var(--muted)">Expected: <b style="color:var(--text)">${e.expected_action}</b> · Pred: <b style="color:var(--cyan)">${e.pred_action}</b> ${e.disasm_patch ? `· Patch ASM: <b style="color:var(--green)">${e.disasm_patch}</b>` : ""}</div>
+ <pre>${e.student_target}</pre>
+ <div style="font-size:11px;color:${e.passed ? "#6ee7b7" : "#fca5a5"}">${e.tier}: ${e.detail} ${e.boot_id ? `(boot_id=${e.boot_id.slice(0,8)}.. up=${e.uptime}s)` : ""}</div>
+ <details><summary>Inspect Input Telemetry &amp; Teacher Reasoning</summary>
+ <pre>${e.prompt}</pre>
+ ${e.teacher_reasoning ? `<pre style="color:#fcd34d">${e.teacher_reasoning}</pre>` : ""}
+ </details>
+ </div>
+ `).join("");
+}
+
+async function refresh() {
+ const resp = await fetch("/api/state");
+ STATE = await resp.json();
+ const s = STATE.summary || {};
+ document.getElementById("runMeta").textContent = `Teacher: ${s.model || "-"} | Dir: ${STATE.pilot_dir}`;
+ document.getElementById("tbLink").href = STATE.tensorboard_url;
+ document.getElementById("kPass").textContent = s.pass_at_1 != null ? `${(s.pass_at_1*100).toFixed(1)}% (${s.passed_total}/${s.total_scenarios})` : "-";
+ document.getElementById("kVm").textContent = s.vm_verified_count != null ? `${s.vm_verified_count}` : "-";
+ document.getElementById("kDanger").textContent = s.dangerous_continue_count != null ? `${s.dangerous_continue_count}` : "-";
+ document.getElementById("kP95").textContent = s.kvm_p95_ms != null ? `${s.kvm_p95_ms} ms` : "-";
+ const sftSum = s.sft_verified_counts ? Object.values(s.sft_verified_counts).reduce((a,b)=>a+b,0) : 0;
+ document.getElementById("kSft").textContent = `${sftSum}`;
+ document.getElementById("kCost").textContent = s.est_cost_usd != null ? `$${s.est_cost_usd.toFixed(4)}` : "-";
+
+ const evs = STATE.events || [];
+ const getS = (k) => evs.map(e => e.metrics[k]).filter(v => v !== undefined);
+ drawChart("c1", [
+ { color: "#34d399", pts: getS("panel1_reward/train_reward") },
+ { color: "#fbbf24", pts: getS("panel1_reward/zero_variance_group_frac") },
+ ], -2.0, 1.0);
+ drawChart("c2", [
+ { color: "#22d3ee", pts: getS("panel2_validation/val_pass_at_1") },
+ { color: "#f87171", pts: getS("panel2_validation/dangerous_continue_rate") },
+ { color: "#fbbf24", pts: getS("panel2_validation/excess_halt_rate") },
+ ], 0.0, 1.0);
+ drawChart("c3", [
+ { color: "#a78bfa", pts: getS("panel3_policy/action_patch_frac") },
+ { color: "#22d3ee", pts: getS("panel3_policy/action_pass_frac") },
+ { color: "#fbbf24", pts: getS("panel3_policy/action_halt_frac") },
+ ], 0.0, 1.0);
+ drawChart("c4", [
+ { color: "#34d399", pts: getS("panel4_verifier/vm_pass_frac") },
+ { color: "#22d3ee", pts: getS("panel4_verifier/p95_ms").map(ms => ms / 1000.0) },
+ ], 0.0, 1.5);
+
+ const cats = ["ALL", "pf_patchable", "de_patchable", "ud_patchable", "pass_to_linux", "halt_for_dump", "FAIL"];
+ document.getElementById("filters").innerHTML = cats.map(c =>
+ `<button class="flt ${ACTIVE_CAT===c?"active":""}" onclick="ACTIVE_CAT='${c}';renderExamples();refreshFilters()">${c}</button>`
+ ).join("");
+ renderExamples();
+}
+function refreshFilters() {
+ document.querySelectorAll("button.flt").forEach(b => b.classList.toggle("active", b.textContent === ACTIVE_CAT));
+}
+refresh();
+setInterval(refresh, 5000);
+</script>
+</body>
+</html>
+"""
+
[email protected]("/", response_class=HTMLResponse)
+def index():
+ return HTMLResponse(HTML_PAGE)
+
+if __name__ == "__main__":
+ host = os.environ.get("DASH_HOST", "0.0.0.0")
+ port = int(os.environ.get("DASH_PORT", "8780"))
+ uvicorn.run(app, host=host, port=port, log_level="info")
diff --git a/04-ring1-kernel-surgeon/dataset/generate_deepseek.py b/04-ring1-kernel-surgeon/dataset/generate_deepseek.py
new file mode 100755
index 0000000..044ef0d
--- /dev/null
+++ b/04-ring1-kernel-surgeon/dataset/generate_deepseek.py
@@ -0,0 +1,271 @@
+#!/usr/bin/env python3
+"""
+Ring -1 Kernel Surgeon — DeepSeek API Teacher Distillation + KVM-Verifier Filter Pipeline
+
+- Calls direct DeepSeek API (https://api.deepseek.com/v1/chat/completions)
+ supporting deepseek-v4-pro and deepseek-flash.
+- Teacher may reason deeply in reasoning_content / <think>, saved ONLY in teacher_raw.jsonl.
+- Strips ALL reasoning/<think>, verifies EVERY clean student answer through the 3-tier KVMVerifier
+ (single-level QEMU/KVM + Capstone + postconditions), and writes ONLY verified pairs to
+ sft_train.jsonl / sft_val.jsonl / sft_test.jsonl.
+- NEVER logs or prints DEEPSEEK_API_KEY.
+"""
+from __future__ import annotations
+import argparse
+import concurrent.futures
+import json
+import os
+import re
+import sys
+import time
+from collections import Counter
+from dataclasses import asdict
+from typing import Dict, List, Optional, Tuple
+
+import httpx
+
+ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+sys.path.insert(0, ROOT_DIR)
+from dataset.scenarios import Scenario, build_pilot_scenarios
+from verifier.kvm_verifier import KVMVerifier, VerifyResult, parse_student_output
+
+SYSTEM_PROMPT = """You are Ring -1 Kernel Surgeon, a bare-metal AMD SVM hypervisor diagnostic & live-patch engine sitting underneath Linux Ring 0.
+
+Given a single fault telemetry snapshot, choose EXACTLY ONE action:
+1. PATCH_BYTES — ONLY when ALL safety preconditions hold:
+ - cpl=0, extable=0, bug_warn=0, lock_held=0, irq_ctx=0, side_effect=0, stack_ok=1, obs_complete=1.
+ - Provide EXACT-LENGTH space-separated x86-64 hex bytes replacing the faulting instruction in place (NO memory operands, NO jumps/calls/privileged instructions).
+ - Pay close attention to CONTRACT and REGS!
+ * For optional NULL stores or clean UD2/UD1/UD0 where EAX is already 0, a NOP sled (90 ...) of exact length is safe.
+ * For divide-by-zero (#DE: div/idiv) or NULL loads / dirty-EAX traps whose CONTRACT requires fallback quotient=0 or EAX=0, use register-zeroing x86-64 bytes of exact length (e.g. `31 c0` for 2B, `31 c0 90` or `48 31 c0` for 3B), NOT blind NOPs that leave non-zero EAX!
+2. PASS_TO_LINUX — when cpl=3 (userspace fault), OR extable=1 (Linux _ASM_EXTABLE fixup such as copy_from_user/get_user/futex_detect_cmpxchg), OR bug_warn=1 (Linux WARN_ON_ONCE). PATCH must be NONE.
+3. HALT_FOR_DUMP — whenever lock_held=1, irq_ctx=1, side_effect=1, stack_ok=0, or obs_complete=0 (irreversible state, lock/deadlock risk, corrupted stack, or incomplete telemetry). NEVER patch these. PATCH must be NONE.
+
+CRITICAL OUTPUT FORMAT — Output ONLY these exact 3 lines, with NO <think> tags, NO markdown code blocks, and NO extra text:
+DIAGNOSIS: <concise technical diagnosis in <= 18 words>
+ACTION: <PATCH_BYTES | PASS_TO_LINUX | HALT_FOR_DUMP>
+PATCH: <exact-length lowercase space-separated hex bytes OR NONE>"""
+
+# Approximate DeepSeek API list prices (USD per 1M tokens) for budget telemetry
+MODEL_PRICING = {
+ "deepseek-v4-pro": {"input": 0.55, "output": 2.19},
+ "deepseek-flash": {"input": 0.14, "output": 0.28},
+}
+
+def load_api_key() -> str:
+ key = os.environ.get("DEEPSEEK_API_KEY", "").strip()
+ if not key:
+ env_file = os.path.join(ROOT_DIR, ".env")
+ if os.path.exists(env_file):
+ for line in open(env_file):
+ if line.startswith("DEEPSEEK_API_KEY="):
+ key = line.split("=", 1)[1].strip().strip("\"\x27")
+ break
+ if not key:
+ raise RuntimeError("DEEPSEEK_API_KEY not found in environment or .env")
+ return key
+
+def strip_thinking(text: str) -> Tuple[str, str]:
+ """Separate any inline <think>...</think> block from the clean student answer."""
+ think_parts = re.findall(r"<think>(.*?)</think>", text, flags=re.DOTALL | re.IGNORECASE)
+ cleaned = re.sub(r"<think>.*?</think>", "", text, flags=re.DOTALL | re.IGNORECASE).strip()
+ return "\n".join(t.strip() for t in think_parts), cleaned
+
+def call_deepseek(client: httpx.Client, api_key: str, model: str, user_prompt: str, max_retries: int = 3) -> dict:
+ payload = {
+ "model": model,
+ "messages": [
+ {"role": "system", "content": SYSTEM_PROMPT},
+ {"role": "user", "content": user_prompt},
+ ],
+ "temperature": 0.1,
+ "max_tokens": 2048,
+ }
+ headers = {
+ "Authorization": f"Bearer {api_key}",
+ "Content-Type": "application/json",
+ }
+ last_err = ""
+ for attempt in range(max_retries):
+ t0 = time.time()
+ try:
+ resp = client.post("https://api.deepseek.com/v1/chat/completions", headers=headers, json=payload, timeout=90.0)
+ if resp.status_code == 200:
+ data = resp.json()
+ msg = data["choices"][0]["message"]
+ usage = data.get("usage", {})
+ return {
+ "ok": True,
+ "content": msg.get("content", "") or "",
+ "reasoning_content": msg.get("reasoning_content", "") or "",
+ "prompt_tokens": int(usage.get("prompt_tokens", 0)),
+ "completion_tokens": int(usage.get("completion_tokens", 0)),
+ "api_ms": (time.time() - t0) * 1000.0,
+ }
+ last_err = f"HTTP {resp.status_code}: {resp.text[:200]}"
+ except Exception as e:
+ last_err = f"{type(e).__name__}: {e}"
+ time.sleep(1.5 * (attempt + 1))
+ return {"ok": False, "error": last_err, "content": "", "reasoning_content": "", "prompt_tokens": 0, "completion_tokens": 0, "api_ms": 0.0}
+
+def main():
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--model", default="deepseek-flash", choices=["deepseek-v4-pro", "deepseek-flash"])
+ ap.add_argument("--scenarios-file", default=os.path.join(ROOT_DIR, "dataset", "scenarios_600.jsonl"))
+ ap.add_argument("--limit", type=int, default=600, help="Number of scenarios to run")
+ ap.add_argument("--out-dir", required=True, help="Run output directory")
+ ap.add_argument("--api-workers", type=int, default=6)
+ ap.add_argument("--kvm-workers", type=int, default=4)
+ ap.add_argument("--no-cache", action="store_true")
+ args = ap.parse_args()
+
+ api_key = load_api_key()
+ os.makedirs(args.out_dir, exist_ok=True)
+ if args.scenarios_file and os.path.exists(args.scenarios_file):
+ scenarios = [Scenario(**json.loads(l)) for l in open(args.scenarios_file) if l.strip()][:args.limit]
+ else:
+ scenarios = build_pilot_scenarios()[:args.limit]
+
+ print(f"[DISTILL] Starting pilot: n={len(scenarios)} model={args.model} out={args.out_dir}")
+ t_all = time.time()
+
+ # 1. Query DeepSeek API in parallel
+ teacher_results: List[Tuple[Scenario, str, dict]] = []
+ with httpx.Client() as client:
+ with concurrent.futures.ThreadPoolExecutor(max_workers=args.api_workers) as ex:
+ fut_map = {ex.submit(call_deepseek, client, api_key, args.model, sc.render_prompt()): sc for sc in scenarios}
+ for fut in concurrent.futures.as_completed(fut_map):
+ sc = fut_map[fut]
+ res = fut.result()
+ teacher_results.append((sc, sc.render_prompt(), res))
+
+ # Restore deterministic scenario order
+ order = {sc.scenario_id: i for i, sc in enumerate(scenarios)}
+ teacher_results.sort(key=lambda x: order[x[0].scenario_id])
+
+ total_ptok = sum(r["prompt_tokens"] for _, _, r in teacher_results)
+ total_ctok = sum(r["completion_tokens"] for _, _, r in teacher_results)
+ price = MODEL_PRICING.get(args.model, {"input": 0.55, "output": 2.19})
+ est_cost_usd = (total_ptok / 1e6) * price["input"] + (total_ctok / 1e6) * price["output"]
+ print(f"[DISTILL] API done: {len(teacher_results)} calls | prompt_tok={total_ptok} comp_tok={total_ctok} | est_cost=${est_cost_usd:.5f}")
+
+ # 2. Strip reasoning/<think> and verify EVERY candidate through 3-tier KVMVerifier
+ protocol_path = os.path.join(args.out_dir, "verifier_protocol.jsonl")
+ if os.path.exists(protocol_path):
+ os.unlink(protocol_path)
+ verifier = KVMVerifier(max_workers=args.kvm_workers, protocol_log=protocol_path)
+
+ cleaned_answers = []
+ raw_records = []
+ for sc, prompt, tres in teacher_results:
+ inline_think, clean_text = strip_thinking(tres["content"])
+ full_reasoning = (tres["reasoning_content"] + ("\n" + inline_think if inline_think else "")).strip()
+ # Normalize student target strictly to clean 3-line format
+ parsed = parse_student_output(clean_text)
+ if parsed.valid_schema:
+ student_target = f"DIAGNOSIS: {parsed.diagnosis}\nACTION: {parsed.action}\nPATCH: {parsed.patch_hex}"
+ else:
+ student_target = clean_text
+ cleaned_answers.append((sc, student_target))
+ raw_records.append((sc, prompt, tres, full_reasoning, student_target))
+
+ t_kvm = time.time()
+ vresults = verifier.verify_batch(cleaned_answers, use_cache=not args.no_cache)
+ kvm_dt = time.time() - t_kvm
+
+ # 3. Write audit log (teacher_raw.jsonl) AND clean KVM-verified SFT splits (NO reasoning!)
+ raw_path = os.path.join(args.out_dir, "teacher_raw.jsonl")
+ disagree_path = os.path.join(args.out_dir, "disagreements.jsonl")
+ sft_files = {
+ "train": open(os.path.join(args.out_dir, "sft_train.jsonl"), "w"),
+ "val": open(os.path.join(args.out_dir, "sft_val.jsonl"), "w"),
+ "test": open(os.path.join(args.out_dir, "sft_test.jsonl"), "w"),
+ }
+
+ sft_counts = Counter()
+ confusion = Counter()
+ passed_total = 0
+ vm_verified_total = 0
+ dangerous_total = 0
+ excess_halt_total = 0
+
+ with open(raw_path, "w") as fraw, open(disagree_path, "w") as fdis:
+ for (sc, prompt, tres, reasoning, student_target), vr in zip(raw_records, vresults):
+ if vr.passed:
+ passed_total += 1
+ if vr.vm_verified:
+ vm_verified_total += 1
+ if vr.dangerous_continue:
+ dangerous_total += 1
+ if vr.excess_halt:
+ excess_halt_total += 1
+ confusion[f"{sc.expected_action}->{vr.pred_action}"] += 1
+
+ audit_rec = {
+ "scenario_id": sc.scenario_id,
+ "family_id": sc.family_id,
+ "category": sc.category,
+ "split": sc.split,
+ "model": args.model,
+ "prompt": prompt,
+ "teacher_reasoning": reasoning,
+ "student_target": student_target,
+ "verify": asdict(vr),
+ "usage": {
+ "prompt_tokens": tres["prompt_tokens"],
+ "completion_tokens": tres["completion_tokens"],
+ "api_ms": round(tres["api_ms"], 1),
+ },
+ }
+ fraw.write(json.dumps(audit_rec) + "\n")
+
+ if vr.passed and vr.reward == 1.0:
+ # CRITICAL: Clean SFT pair ONLY — zero <think>, zero teacher reasoning!
+ sft_rec = {
+ "scenario_id": sc.scenario_id,
+ "family_id": sc.family_id,
+ "category": sc.category,
+ "split": sc.split,
+ "messages": [
+ {"role": "system", "content": "Ring -1 Kernel Surgeon. Output 3 lines only: DIAGNOSIS, ACTION, PATCH."},
+ {"role": "user", "content": prompt},
+ {"role": "assistant", "content": student_target},
+ ],
+ "vm_verified": vr.vm_verified,
+ "boot_id": vr.boot_id,
+ }
+ sft_files[sc.split].write(json.dumps(sft_rec) + "\n")
+ sft_counts[sc.split] += 1
+ else:
+ fdis.write(json.dumps(audit_rec) + "\n")
+
+ for fh in sft_files.values():
+ fh.close()
+
+ vm_lats = sorted(r.latency_ms for r in vresults if r.vm_verified)
+ p95_ms = vm_lats[int(0.95 * (len(vm_lats) - 1))] if vm_lats else 0.0
+ summary = {
+ "model": args.model,
+ "total_scenarios": len(scenarios),
+ "passed_total": passed_total,
+ "pass_at_1": round(passed_total / len(scenarios), 4) if scenarios else 0.0,
+ "vm_verified_count": vm_verified_total,
+ "dangerous_continue_count": dangerous_total,
+ "excess_halt_count": excess_halt_total,
+ "sft_verified_counts": dict(sft_counts),
+ "confusion": dict(confusion),
+ "prompt_tokens": total_ptok,
+ "completion_tokens": total_ctok,
+ "est_cost_usd": round(est_cost_usd, 6),
+ "kvm_elapsed_s": round(kvm_dt, 2),
+ "kvm_p95_ms": round(p95_ms, 1),
+ "total_elapsed_s": round(time.time() - t_all, 2),
+ }
+ with open(os.path.join(args.out_dir, "pilot_summary.json"), "w") as fs:
+ json.dump(summary, fs, indent=2)
+
+ print("=== PILOT SUMMARY ===")
+ print(json.dumps(summary, indent=2))
+
+if __name__ == "__main__":
+ main()
diff --git a/04-ring1-kernel-surgeon/dataset/pilot_scenarios.jsonl b/04-ring1-kernel-surgeon/dataset/pilot_scenarios.jsonl
new file mode 100644
index 0000000..4ed322d
--- /dev/null
+++ b/04-ring1-kernel-surgeon/dataset/pilot_scenarios.jsonl
@@ -0,0 +1,48 @@
+{"scenario_id": "pf_null_abs_u32_v1", "family_id": "fam_pf_abs_u32", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_telemetry+0x0100", "fault_hex": "c7 04 25 00 00 00 00 ef be ad de", "fault_len": 11, "disasm": "mov dword ptr [0], 0xdeadbeef", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013e20 RFLAGS=0x246", "contract_hint": "Optional debug probe write before commit; skipping fault leaves status=0x100 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv: stage=pre_commit debug_slot=unmapped", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c7042500000000efbeadde48c7470800010000c3", "patch_off": 2, "expect_out_hex": "100", "expect_ret_hex": "0"}
+{"scenario_id": "pf_null_abs_u32_v2", "family_id": "fam_pf_abs_u32", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_telemetry+0x0110", "fault_hex": "c7 04 25 00 00 00 00 01 00 00 00", "fault_len": 11, "disasm": "mov dword ptr [0], 1", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013e20 RFLAGS=0x246", "contract_hint": "Optional debug probe write before commit; skipping fault leaves status=0x100 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv: stage=pre_commit debug_slot=unmapped", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c70425000000000100000048c7470800010000c3", "patch_off": 2, "expect_out_hex": "100", "expect_ret_hex": "0"}
+{"scenario_id": "pf_null_reg_store32_rax_edx", "family_id": "fam_pf_reg_store32", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ring+0x0204", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x0 RDX=0x55 RBX=0x0 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013e10 RFLAGS=0x246", "contract_hint": "Best-effort counter store to optional pointer; skipping store keeps out=0, ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ring: optional_stat_ptr=NULL pre_commit=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c0ba55000000b977000000891048c7470800000000c3", "patch_off": 12, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_null_reg_store32_rax_ecx", "family_id": "fam_pf_reg_store32", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ring+0x0214", "fault_hex": "89 08", "fault_len": 2, "disasm": "mov dword ptr [rax], ecx", "regs_summary": "RAX=0x0 RCX=0x77 RBX=0x0 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013e10 RFLAGS=0x246", "contract_hint": "Best-effort counter store to optional pointer; skipping store keeps out=0, ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ring: optional_stat_ptr=NULL pre_commit=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c0ba55000000b977000000890848c7470800000000c3", "patch_off": 12, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_null_byte_store_rax", "family_id": "fam_pf_byte_store", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_flag+0x000c", "fault_hex": "c6 00 01", "fault_len": 3, "disasm": "mov byte ptr [rax], 1", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013df0 RFLAGS=0x246", "contract_hint": "Optional flag byte write before commit; skipping write preserves out=0 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_flag: trace_marker=NULL state=clean", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c6000148c7470800000000c3", "patch_off": 2, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_null_byte_store_rsi", "family_id": "fam_pf_byte_store", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_flag+0x001c", "fault_hex": "c6 06 01", "fault_len": 3, "disasm": "mov byte ptr [rsi], 1", "regs_summary": "RAX=0x0 RSI=0x0 RBX=0x0 RCX=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013df0 RFLAGS=0x246", "contract_hint": "Optional flag byte write before commit; skipping write preserves out=0 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_flag: trace_marker=NULL state=clean", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031f6c6060148c7470800000000c3", "patch_off": 4, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_null_qword_store_qword_rdx", "family_id": "fam_pf_qword_store", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_audit+0x0308", "fault_hex": "48 89 10", "fault_len": 3, "disasm": "mov qword ptr [rax], rdx", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x22 RDX=0x11 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d90 RFLAGS=0x246", "contract_hint": "Audit timestamp write to uninitialized slot before commit; skipping preserves out=0, ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_audit: audit_slot=NULL pre_commit=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0ba11000000b92200000048891048c7470800000000c3", "patch_off": 12, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_null_qword_store_qword_rcx", "family_id": "fam_pf_qword_store", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_audit+0x0318", "fault_hex": "48 89 08", "fault_len": 3, "disasm": "mov qword ptr [rax], rcx", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x22 RDX=0x11 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d90 RFLAGS=0x246", "contract_hint": "Audit timestamp write to uninitialized slot before commit; skipping preserves out=0, ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_audit: audit_slot=NULL pre_commit=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0ba11000000b92200000048890848c7470800000000c3", "patch_off": 12, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_offset_load_zero_off10", "family_id": "fam_pf_offset_load", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000010", "rip_sym": "kdrv_cfg+0x0400", "fault_hex": "8b 43 10", "fault_len": 3, "disasm": "mov eax, dword ptr [rbx + 0x10]", "regs_summary": "RAX=0x77 RBX=0x0 RCX=0x0 RDX=0x0 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d40 RFLAGS=0x246", "contract_hint": "Config field read into EAX then stored to out_val and returned; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_cfg: cfg_ptr=NULL field_off=0x10 fallback=zero", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b87700000031db8b431048894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_offset_load_zero_off20", "family_id": "fam_pf_offset_load", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000020", "rip_sym": "kdrv_cfg+0x0410", "fault_hex": "8b 43 20", "fault_len": 3, "disasm": "mov eax, dword ptr [rbx + 0x20]", "regs_summary": "RAX=0x77 RBX=0x0 RCX=0x0 RDX=0x0 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d40 RFLAGS=0x246", "contract_hint": "Config field read into EAX then stored to out_val and returned; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_cfg: cfg_ptr=NULL field_off=0x20 fallback=zero", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b87700000031db8b432048894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_rsi_load_zero_rsi_off08", "family_id": "fam_pf_rsi_load", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000008", "rip_sym": "kdrv_hdr+0x0500", "fault_hex": "8b 46 08", "fault_len": 3, "disasm": "mov eax, dword ptr [rsi + 8]", "regs_summary": "RAX=0x99 RBX=0x0 RCX=0x0 RDX=0x0 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d20 RFLAGS=0x246", "contract_hint": "Header field read into EAX then stored to out_val and returned; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hdr: hdr_ptr=NULL field_off=0x08 fallback=zero", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b89900000031f68b460848894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_rsi_load_zero_rsi_off18", "family_id": "fam_pf_rsi_load", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000018", "rip_sym": "kdrv_hdr+0x0510", "fault_hex": "8b 46 18", "fault_len": 3, "disasm": "mov eax, dword ptr [rsi + 0x18]", "regs_summary": "RAX=0x99 RBX=0x0 RCX=0x0 RDX=0x0 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d20 RFLAGS=0x246", "contract_hint": "Header field read into EAX then stored to out_val and returned; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hdr: hdr_ptr=NULL field_off=0x18 fallback=zero", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b89900000031f68b461848894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ecx_v1", "family_id": "fam_de_div_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_math+0x0008", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x2a RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013cc0 RFLAGS=0x246", "contract_hint": "Quotient in RAX/EAX is stored to out_val and returned; safe divide-by-zero contract requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_rate: denom=0 fallback_quotient=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b82a00000031d231c9f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ecx_v2", "family_id": "fam_de_div_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_math+0x0018", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x64 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013cc0 RFLAGS=0x246", "contract_hint": "Quotient in RAX/EAX is stored to out_val and returned; safe divide-by-zero contract requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_rate: samples=0 fallback_quotient=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b86400000031d231c9f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_esi_v1", "family_id": "fam_de_idiv_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_math+0x0028", "fault_hex": "f7 fe", "fault_len": 2, "disasm": "idiv esi", "regs_summary": "RAX=0x50 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013cc0 RFLAGS=0x246", "contract_hint": "Quotient in RAX/EAX is stored to out_val and returned; safe divide-by-zero contract requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_avg: count=0 fallback_quotient=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8500000009931f6f7fe48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_esi_v2", "family_id": "fam_de_idiv_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_math+0x0038", "fault_hex": "f7 fe", "fault_len": 2, "disasm": "idiv esi", "regs_summary": "RAX=0xc8 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013cc0 RFLAGS=0x246", "contract_hint": "Quotient in RAX/EAX is stored to out_val and returned; safe divide-by-zero contract requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_avg: buckets=0 fallback_quotient=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8c80000009931f6f7fe48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ebx_v1", "family_id": "fam_de_div_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_math+0x0048", "fault_hex": "f7 f3", "fault_len": 2, "disasm": "div ebx", "regs_summary": "RAX=0x33 RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013cc0 RFLAGS=0x246", "contract_hint": "Quotient in RAX/EAX is stored to out_val and returned; safe divide-by-zero contract requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_scale: divisor=0 fallback_quotient=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b83300000031d231dbf7f35b48894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ebx_v2", "family_id": "fam_de_div_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_math+0x0058", "fault_hex": "f7 f3", "fault_len": 2, "disasm": "div ebx", "regs_summary": "RAX=0x7f RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013cc0 RFLAGS=0x246", "contract_hint": "Quotient in RAX/EAX is stored to out_val and returned; safe divide-by-zero contract requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_scale: span=0 fallback_quotient=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b87f00000031d231dbf7f35b48894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r8d_v1", "family_id": "fam_de_div_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_math+0x0068", "fault_hex": "41 f7 f0", "fault_len": 3, "disasm": "div r8d", "regs_summary": "RAX=0x63 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013cc0 RFLAGS=0x246", "contract_hint": "Quotient in RAX/EAX is stored to out_val and returned; safe divide-by-zero contract requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hist: total=0 fallback_quotient=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b86300000031d24531c041f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r8d_v2", "family_id": "fam_de_div_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_math+0x0078", "fault_hex": "41 f7 f0", "fault_len": 3, "disasm": "div r8d", "regs_summary": "RAX=0xff R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013cc0 RFLAGS=0x246", "contract_hint": "Quotient in RAX/EAX is stored to out_val and returned; safe divide-by-zero contract requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hist: weight_sum=0 fallback_quotient=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8ff00000031d24531c041f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rcx_v1", "family_id": "fam_de_div64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_math+0x0088", "fault_hex": "48 f7 f1", "fault_len": 3, "disasm": "div rcx", "regs_summary": "RAX=0x1f4 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013cc0 RFLAGS=0x246", "contract_hint": "Quotient in RAX/EAX is stored to out_val and returned; safe divide-by-zero contract requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_bw: dt_ns=0 fallback_quotient=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b8f401000031d231c948f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rcx_v2", "family_id": "fam_de_div64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_math+0x0098", "fault_hex": "48 f7 f1", "fault_len": 3, "disasm": "div rcx", "regs_summary": "RAX=0x3e8 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013cc0 RFLAGS=0x246", "contract_hint": "Quotient in RAX/EAX is stored to out_val and returned; safe divide-by-zero contract requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_bw: window_ns=0 fallback_quotient=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b8e803000031d231c948f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r9d_v1", "family_id": "fam_de_idiv_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_math+0x00a8", "fault_hex": "41 f7 f9", "fault_len": 3, "disasm": "idiv r9d", "regs_summary": "RAX=0x80 R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013cc0 RFLAGS=0x246", "contract_hint": "Quotient in RAX/EAX is stored to out_val and returned; safe divide-by-zero contract requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ema: alpha_den=0 fallback_quotient=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b880000000994531c941f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r9d_v2", "family_id": "fam_de_idiv_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_math+0x00b8", "fault_hex": "41 f7 f9", "fault_len": 3, "disasm": "idiv r9d", "regs_summary": "RAX=0xaa R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013cc0 RFLAGS=0x246", "contract_hint": "Quotient in RAX/EAX is stored to out_val and returned; safe divide-by-zero contract requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ema: norm_den=0 fallback_quotient=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8aa000000994531c941f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud_trap_clean_v1", "family_id": "fam_ud_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_guard+0x010a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c80 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x42 already populated; skipping trap returns 0 cleanly.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_guard: diag_trap=ud2 state=clean pre_commit=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708420000000f0bc3", "patch_off": 10, "expect_out_hex": "42", "expect_ret_hex": "0"}
+{"scenario_id": "ud_trap_clean_v2", "family_id": "fam_ud_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_guard+0x011a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c80 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x42 already populated; skipping trap returns 0 cleanly.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_guard: diag_trap=ud2 state=clean pre_commit=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708420000000f0bc3", "patch_off": 10, "expect_out_hex": "42", "expect_ret_hex": "0"}
+{"scenario_id": "ud_trap_zero_ret_v1", "family_id": "fam_ud_zero_ret", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_gate+0x0202", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1337 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c60 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1337 precedes diagnostic ud2 before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_gate: diag_trap=ud2 fallback_ret=0 state=clean", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8371300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud_trap_zero_ret_v2", "family_id": "fam_ud_zero_ret", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_gate+0x0212", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1337 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c60 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1337 precedes diagnostic ud2 before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_gate: diag_trap=ud2 fallback_ret=0 state=clean", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8371300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud_ud1_clean_v1", "family_id": "fam_ud_ud1", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_probe+0x0300", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c40 RFLAGS=0x246", "contract_hint": "Diagnostic UD1 trap before commit with EAX=0 and out=0; skipping trap returns 0 cleanly.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_probe: diag_trap=ud1 state=clean", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708000000000fb9c0c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud_ud1_clean_v2", "family_id": "fam_ud_ud1", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_probe+0x0310", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c40 RFLAGS=0x246", "contract_hint": "Diagnostic UD1 trap before commit with EAX=0 and out=0; skipping trap returns 0 cleanly.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_probe: diag_trap=ud1 state=clean", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708000000000fb9c0c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud_ud0_clean_v1", "family_id": "fam_ud_ud0", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_check+0x0400", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x0 RBX=0x2 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c20 RFLAGS=0x246", "contract_hint": "Diagnostic UD0 trap before commit with EAX=0 and out=0; skipping trap returns 0 cleanly.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_check: diag_trap=ud0 state=clean", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708000000000fffc0c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud_ud0_clean_v2", "family_id": "fam_ud_ud0", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_check+0x0410", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x0 RBX=0x2 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c20 RFLAGS=0x246", "contract_hint": "Diagnostic UD0 trap before commit with EAX=0 and out=0; skipping trap returns 0 cleanly.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_check: diag_trap=ud0 state=clean", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708000000000fffc0c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud_trap_keep_out_v1", "family_id": "fam_ud_keep_out", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sync+0x0500", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c00 RFLAGS=0x246", "contract_hint": "Debug trap after preparing out_val=0x77 and EAX=0; skipping trap completes operation cleanly.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sync: debug_trap=ud2 pre_commit=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708770000000f0bc3", "patch_off": 10, "expect_out_hex": "77", "expect_ret_hex": "0"}
+{"scenario_id": "ud_trap_keep_out_v2", "family_id": "fam_ud_keep_out", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sync+0x0510", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c00 RFLAGS=0x246", "contract_hint": "Debug trap after preparing out_val=0x77 and EAX=0; skipping trap completes operation cleanly.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sync: debug_trap=ud2 pre_commit=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708770000000f0bc3", "patch_off": 10, "expect_out_hex": "77", "expect_ret_hex": "0"}
+{"scenario_id": "ctrl_pass_extable_get_user", "family_id": "fam_ctrl_extable", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000010", "rip_sym": "__get_user_8+0x0014", "fault_hex": "48 8b 11", "fault_len": 3, "disasm": "mov rdx, qword ptr [rcx]", "regs_summary": "RAX=0x0 RCX=0x10 RDX=0x0", "contract_hint": "User-pointer read covered by Linux _ASM_EXTABLE fixup (returns -EFAULT).", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kernel: copy_from_user / get_user probe on user pointer 0x10", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_pass_extable_futex", "family_id": "fam_ctrl_extable", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "futex_detect_cmpxchg+0x0026", "fault_hex": "3e 0f b1 0e", "fault_len": 4, "disasm": "cmpxchg dword ptr ds:[rsi], ecx", "regs_summary": "RAX=0x0 RCX=0x0 RSI=0x0", "contract_hint": "Linux boot-time futex_detect_cmpxchg probe covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kernel: futex_init probing cmpxchg_futex_value_locked", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_pass_extable_copy_user", "family_id": "fam_ctrl_extable_copy", "category": "pass_to_linux", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x00007f0012340000", "rip_sym": "copy_user_enhanced_fast_string+0x0009", "fault_hex": "f3 a4", "fault_len": 2, "disasm": "rep movsb byte ptr [rdi], byte ptr [rsi]", "regs_summary": "RCX=0x40 RSI=0x7f0012340000 RDI=0xffff888005000000", "contract_hint": "Demand-paged user buffer read inside copy_from_user with _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kernel: syscall read/write user buffer fault", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_pass_user_pf_cpl3", "family_id": "fam_ctrl_cpl3", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 4, "cpl": 3, "cr2": "0x00007ffe91a00000", "rip_sym": "user+0x00401234", "fault_hex": "8b 00", "fault_len": 2, "disasm": "mov eax, dword ptr [rax]", "regs_summary": "RAX=0x7ffe91a00000 RSP=0x7ffe919ff000", "contract_hint": "Ring 3 userspace page fault (demand paging / COW / SIGSEGV handled by Linux mm).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "user: normal ring-3 fault", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_pass_warn_on_once", "family_id": "fam_ctrl_warn", "category": "pass_to_linux", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_warn_path+0x0018", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1 RBX=0x0 RSP=0xffffc90000013b80", "contract_hint": "Linux WARN_ON_ONCE metadata entry (bug_warn=1); kernel logs warning and continues cleanly.", "extable": 0, "bug_warn": 1, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kernel: __bug_table entry flag=BUGFLAG_WARNING", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "warn_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_pass_user_ud_cpl3", "family_id": "fam_ctrl_cpl3_ud", "category": "pass_to_linux", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 3, "cr2": "0x0000000000000000", "rip_sym": "user+0x00402100", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RSP=0x7ffe919fe800", "contract_hint": "Ring 3 userspace invalid opcode (Linux delivers SIGILL to user process).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "user: ring-3 illegal instruction", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_halt_pf_lock_held", "family_id": "fam_halt_lock", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tx+0x0180", "fault_hex": "c7 04 25 00 00 00 00 ef be ad de", "fault_len": 11, "disasm": "mov dword ptr [0], 0xdeadbeef", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0", "contract_hint": "Ring 0 NULL write while holding spinlock (lock_held=1); patching risks deadlock / lock leak.", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tx: spin_lock(&dev->tx_lock) acquired; preempt_count=1", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "c7042500000000efbeadde", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_halt_pf_side_effect", "family_id": "fam_halt_sideeff", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_blk+0x0214", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x0 RDX=0x55", "contract_hint": "Ring 0 NULL store AFTER DMA/block write already committed (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_blk: dma_submit() already issued to NVMe queue before fault", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8910", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_halt_pf_irq_ctx", "family_id": "fam_halt_irq", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_isr+0x004c", "fault_hex": "c6 00 01", "fault_len": 3, "disasm": "mov byte ptr [rax], 1", "regs_summary": "RAX=0x0 RDX=0x1", "contract_hint": "Ring 0 NULL write inside hard IRQ context (irq_ctx=1); unsafe to patch live.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 1, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_isr: in_hardirq()=1 interrupt handler active", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "c60001", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_halt_de_side_effect", "family_id": "fam_halt_de_sideeff", "category": "halt_for_dump", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ledger+0x0088", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x2a RCX=0x0 RDX=0x0", "contract_hint": "Ring 0 divide-by-zero AFTER partial state mutation committed (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ledger: journal header already flushed before div", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "f7f1", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_halt_de_lock_held", "family_id": "fam_halt_de_lock", "category": "halt_for_dump", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sched+0x00a4", "fault_hex": "f7 fe", "fault_len": 2, "disasm": "idiv esi", "regs_summary": "RAX=0x50 RSI=0x0 RDX=0x0", "contract_hint": "Ring 0 signed divide-by-zero while holding rwlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sched: write_lock_irq(&rq->lock) held", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "f7fe", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_halt_ud_bug_post_commit", "family_id": "fam_halt_ud_bug", "category": "halt_for_dump", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_fs+0x0310", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x1", "contract_hint": "Hard BUG_ON invariant failure (bug_warn=0) after metadata write committed (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_fs: BUG_ON(inode->dirty_bytes < 0) post-commit", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0f0b", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_halt_stack_corrupt", "family_id": "fam_halt_stack", "category": "halt_for_dump", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000010", "rip_sym": "kdrv_parse+0x0410", "fault_hex": "8b 43 10", "fault_len": 3, "disasm": "mov eax, dword ptr [rbx + 0x10]", "regs_summary": "RAX=0x77 RBX=0x0 RSP=0x0000000000000008", "contract_hint": "Ring 0 fault with corrupted kernel stack pointer (stack_ok=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 0, "obs_complete": 1, "log_tail": "kdrv_parse: RSP outside kernel stack bounds", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8b4310", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_halt_incomplete_obs", "family_id": "fam_halt_incomplete", "category": "halt_for_dump", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_unknown+0x0090", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x2a RCX=0x0", "contract_hint": "Incomplete/truncated Ring -1 telemetry snapshot (obs_complete=0); cannot verify safe patch.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 0, "log_tail": "ring1: guest page walk partial; telemetry truncated", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "f7f1", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
diff --git a/04-ring1-kernel-surgeon/dataset/scenarios.py b/04-ring1-kernel-surgeon/dataset/scenarios.py
new file mode 100644
index 0000000..c1d5e33
--- /dev/null
+++ b/04-ring1-kernel-surgeon/dataset/scenarios.py
@@ -0,0 +1,420 @@
+#!/usr/bin/env python3
+"""
+Ring -1 Kernel Surgeon — Stage 2.1 Scenario Suite (48 scenarios across 4 families)
+Strict family-level 60/20/20 split (train / val / test) with matched counter-examples
+having identical faulting opcodes to prevent regex shortcuts.
+"""
+from __future__ import annotations
+import json
+from dataclasses import dataclass, asdict
+from typing import List, Optional
+from capstone import Cs, CS_ARCH_X86, CS_MODE_64
+
+_CS = Cs(CS_ARCH_X86, CS_MODE_64)
+
+def disasm_hex(hex_str: str) -> str:
+ raw = bytes.fromhex(hex_str.replace(" ", ""))
+ parts = [f"{ins.mnemonic} {ins.op_str}".strip() for ins in _CS.disasm(raw, 0)]
+ return "; ".join(parts) if parts else "<invalid>"
+
+def fmt_spaced_hex(hex_str: str) -> str:
+ s = hex_str.replace(" ", "").lower()
+ return " ".join(s[i:i+2] for i in range(0, len(s), 2))
+
+@dataclass
+class Scenario:
+ scenario_id: str
+ family_id: str
+ category: str # pf_patchable | de_patchable | ud_patchable | pass_to_linux | halt_for_dump
+ split: str # train | val | test
+ # Telemetry visible to model (zero label leakage!)
+ exc_name: str # #PF | #DE | #UD
+ exc_vec: int
+ err_code: int
+ cpl: int
+ cr2: str
+ rip_sym: str
+ fault_hex: str # spaced hex of faulting instruction
+ fault_len: int
+ disasm: str
+ regs_summary: str
+ contract_hint: str # neutral ABI/contract description of the routine (no answer!)
+ extable: int
+ bug_warn: int
+ lock_held: int
+ irq_ctx: int
+ side_effect: int
+ stack_ok: int
+ obs_complete: int
+ log_tail: str
+ # Private verification harness spec (NEVER sent to model!)
+ expected_action: str # PATCH_BYTES | PASS_TO_LINUX | HALT_FOR_DUMP
+ ref_patch_hex: str # spaced hex or "NONE"
+ kvm_mode: str # exec | extable_test | warn_test | policy_only
+ stub_hex: str # full Ring 0 x86-64 stub hex (for kvm_mode == "exec")
+ patch_off: int
+ expect_out_hex: str # u64 hex or ffffffffffffffff (any)
+ expect_ret_hex: str # u64 hex or ffffffffffffffff (any)
+
+ def render_prompt(self) -> str:
+ bytes_field = self.fault_hex if self.obs_complete else "<TRUNCATED>"
+ disasm_field = self.disasm if self.obs_complete else "<UNAVAILABLE>"
+ regs_field = self.regs_summary if self.obs_complete else "RAX=<UNAVAILABLE> RSP=<UNAVAILABLE>"
+ return (
+ "[RING-1 TELEMETRY]\n"
+ f"EXC: {self.exc_name} (vec={self.exc_vec} err=0x{self.err_code:04x} cpl={self.cpl})\n"
+ f"CR2: {self.cr2}\n"
+ f"RIP: {self.rip_sym} (len={self.fault_len})\n"
+ f"BYTES: {bytes_field}\n"
+ f"DISASM: {disasm_field}\n"
+ f"REGS: {regs_field}\n"
+ f"CONTRACT: {self.contract_hint}\n"
+ f"CTX: extable={self.extable} bug_warn={self.bug_warn} lock_held={self.lock_held} "
+ f"irq_ctx={self.irq_ctx} side_effect={self.side_effect} stack_ok={self.stack_ok} "
+ f"obs_complete={self.obs_complete}\n"
+ f"LOG_TAIL:\n {self.log_tail}\n"
+ "Output ONLY 3 lines (no <think>, no markdown):\n"
+ "DIAGNOSIS: <one short sentence>\n"
+ "ACTION: <PATCH_BYTES | PASS_TO_LINUX | HALT_FOR_DUMP>\n"
+ "PATCH: <exact-length space-separated hex bytes or NONE>"
+ )
+
+def build_pilot_scenarios() -> List[Scenario]:
+ """
+ 48 scenarios with strict family-level 60/20/20 split (28 train / 10 val / 10 test).
+ Every stub_hex is verified real x86-64 System V ABI (rdi = struct bench_ctx *):
+ [rdi+0x00] = canary_before
+ [rdi+0x08] = out_val (initially 0x12345678)
+ [rdi+0x10] = canary_after
+ """
+ S: List[Scenario] = []
+
+ def add_exec(
+ sid, fam, cat, split, exc_name, vec, err, cr2, rip_sym,
+ prefix_hex, fault_hex, suffix_hex, regs, contract,
+ expect_out, expect_ret, ref_patch, log_tail,
+ lock_held=0, irq_ctx=0, side_effect=0, stack_ok=1, obs_complete=1,
+ expected_action="PATCH_BYTES"
+ ):
+ p = prefix_hex.replace(" ", "").lower()
+ f = fault_hex.replace(" ", "").lower()
+ sf = suffix_hex.replace(" ", "").lower()
+ full = p + f + sf
+ poff = len(p) // 2
+ flen = len(f) // 2
+ S.append(Scenario(
+ scenario_id=sid, family_id=fam, category=cat, split=split,
+ exc_name=exc_name, exc_vec=vec, err_code=err, cpl=0, cr2=cr2,
+ rip_sym=rip_sym, fault_hex=fmt_spaced_hex(f), fault_len=flen,
+ disasm=disasm_hex(f), regs_summary=regs, contract_hint=contract,
+ extable=0, bug_warn=0, lock_held=lock_held, irq_ctx=irq_ctx,
+ side_effect=side_effect, stack_ok=stack_ok, obs_complete=obs_complete,
+ log_tail=log_tail, expected_action=expected_action,
+ ref_patch_hex=fmt_spaced_hex(ref_patch) if ref_patch != "NONE" else "NONE",
+ kvm_mode="exec" if expected_action == "PATCH_BYTES" else "policy_only",
+ stub_hex=full, patch_off=poff,
+ expect_out_hex=expect_out, expect_ret_hex=expect_ret,
+ ))
+
+ # =========================================================================
+ # FAMILY 1: Patchable Ring 0 #PF (12 scenarios, 6 sub-families)
+ # =========================================================================
+ # 1a. Absolute NULL dword store (11B): c7 04 25 00 00 00 00 ef be ad de
+ # Stub: xor eax,eax (31 c0); [FAULT 11B]; mov qword [rdi+8], 0x100 (48 c7 47 08 00 01 00 00); ret (c3)
+ for idx, (imm, tag, spl) in enumerate([
+ ("efbead de", "v1", "train"),
+ ("010000 00", "v2", "train"),
+ ]):
+ fhex = "c7042500000000" + imm.replace(" ", "")
+ add_exec(
+ f"pf_null_abs_u32_{tag}", "fam_pf_abs_u32", "pf_patchable", spl,
+ "#PF", 14, 0x0002, "0x0000000000000000", f"kdrv_telemetry+0x01{idx}0",
+ "31c0", fhex, "48c7470800010000c3",
+ "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013e20 RFLAGS=0x246",
+ "Optional debug probe write before commit; skipping fault leaves status=0x100 and returns 0.",
+ "100", "0", "90" * 11,
+ "kdrv: stage=pre_commit debug_slot=unmapped"
+ )
+
+ # 1b. Indirect NULL register dword store (2B): 89 10 (mov [rax], edx) / 89 08 (mov [rax], ecx)
+ # Stub: xor eax,eax (31 c0); mov edx, 0x55 (ba 55 00 00 00); [FAULT 2B]; mov qword [rdi+8], 0 (48 c7 47 08 00 00 00 00); ret (c3)
+ for idx, (fhex, reg_s, tag, spl) in enumerate([
+ ("8910", "RAX=0x0 RDX=0x55", "rax_edx", "train"),
+ ("8908", "RAX=0x0 RCX=0x77", "rax_ecx", "train"),
+ ]):
+ add_exec(
+ f"pf_null_reg_store32_{tag}", "fam_pf_reg_store32", "pf_patchable", spl,
+ "#PF", 14, 0x0002, "0x0000000000000000", f"kdrv_ring+0x02{idx}4",
+ "31c0ba55000000b977000000", fhex, "48c7470800000000c3",
+ f"{reg_s} RBX=0x0 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013e10 RFLAGS=0x246",
+ "Best-effort counter store to optional pointer; skipping store keeps out=0, ret=0.",
+ "0", "0", "9090",
+ "kdrv_ring: optional_stat_ptr=NULL pre_commit=1"
+ )
+
+ # 1c. Indirect NULL byte store (3B): c6 00 01 (mov byte [rax], 1) / c6 06 01 (mov byte [rsi], 1)
+ for idx, (fhex, pref, reg_s, tag, spl) in enumerate([
+ ("c60001", "31c0", "RAX=0x0", "rax", "train"),
+ ("c60601", "31c031f6", "RAX=0x0 RSI=0x0", "rsi", "train"),
+ ]):
+ add_exec(
+ f"pf_null_byte_store_{tag}", "fam_pf_byte_store", "pf_patchable", spl,
+ "#PF", 14, 0x0002, "0x0000000000000000", f"kdrv_flag+0x00{idx}c",
+ pref, fhex, "48c7470800000000c3",
+ f"{reg_s} RBX=0x0 RCX=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013df0 RFLAGS=0x246",
+ "Optional flag byte write before commit; skipping write preserves out=0 and returns 0.",
+ "0", "0", "909090",
+ "kdrv_flag: trace_marker=NULL state=clean"
+ )
+
+ # 1d. Indirect NULL qword store (3B): 48 89 10 (mov [rax], rdx) / 48 89 08 (mov [rax], rcx)
+ for idx, (fhex, tag, spl) in enumerate([
+ ("488910", "qword_rdx", "val"),
+ ("488908", "qword_rcx", "val"),
+ ]):
+ add_exec(
+ f"pf_null_qword_store_{tag}", "fam_pf_qword_store", "pf_patchable", spl,
+ "#PF", 14, 0x0002, "0x0000000000000000", f"kdrv_audit+0x03{idx}8",
+ "31c0ba11000000b922000000", fhex, "48c7470800000000c3",
+ "RAX=0x0 RBX=0x0 RCX=0x22 RDX=0x11 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d90 RFLAGS=0x246",
+ "Audit timestamp write to uninitialized slot before commit; skipping preserves out=0, ret=0.",
+ "0", "0", "909090",
+ "kdrv_audit: audit_slot=NULL pre_commit=1"
+ )
+
+ # 1e. NULL struct-offset read needing zero fallback (3B): 8b 43 10 (mov eax, [rbx+0x10])
+ # Notice EAX starts as 0x77! Blind NOP leaves EAX=0x77 (FAILS!); xor eax,eax; nop (31 c0 90) sets EAX=0 (PASSES!)
+ for idx, (fhex, off_s, tag, spl) in enumerate([
+ ("8b4310", "0x10", "off10", "train"),
+ ("8b4320", "0x20", "off20", "train"),
+ ]):
+ add_exec(
+ f"pf_offset_load_zero_{tag}", "fam_pf_offset_load", "pf_patchable", spl,
+ "#PF", 14, 0x0000, f"0x00000000000000{off_s[2:]}", f"kdrv_cfg+0x04{idx}0",
+ "b87700000031db", fhex, "48894708c3",
+ "RAX=0x77 RBX=0x0 RCX=0x0 RDX=0x0 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d40 RFLAGS=0x246",
+ "Config field read into EAX then stored to out_val and returned; safe fallback requires EAX=0 (out=0, ret=0).",
+ "0", "0", "31c090",
+ f"kdrv_cfg: cfg_ptr=NULL field_off={off_s} fallback=zero"
+ )
+
+ # 1f. NULL struct-offset read into EAX (test split, unseen family!): 8b 46 08 (mov eax, [rsi+0x08])
+ for idx, (fhex, off_s, tag, spl) in enumerate([
+ ("8b4608", "0x08", "rsi_off08", "test"),
+ ("8b4618", "0x18", "rsi_off18", "test"),
+ ]):
+ add_exec(
+ f"pf_rsi_load_zero_{tag}", "fam_pf_rsi_load", "pf_patchable", spl,
+ "#PF", 14, 0x0000, f"0x00000000000000{off_s[2:]}", f"kdrv_hdr+0x05{idx}0",
+ "b89900000031f6", fhex, "48894708c3",
+ "RAX=0x99 RBX=0x0 RCX=0x0 RDX=0x0 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d20 RFLAGS=0x246",
+ "Header field read into EAX then stored to out_val and returned; safe fallback requires EAX=0 (out=0, ret=0).",
+ "0", "0", "31c090",
+ f"kdrv_hdr: hdr_ptr=NULL field_off={off_s} fallback=zero"
+ )
+
+ # =========================================================================
+ # FAMILY 2: Patchable Ring 0 #DE Divide-by-Zero (12 scenarios, 6 sub-families)
+ # =========================================================================
+ # All #DE scenarios set EAX=nonzero before div, then store RAX->[rdi+8] and ret!
+ # So blind NOP FAILS postcondition (out_val!=0); zeroing EAX/RAX (31 c0 / 31 c0 90 / 48 31 c0) PASSES!
+ de_defs = [
+ ("de_div_ecx_v1", "fam_de_div_ecx", "train", "b82a00000031d231c9", "f7f1", "48894708c3", "RAX=0x2a RCX=0x0 RDX=0x0", "31c0", "kdrv_rate: denom=0 fallback_quotient=0"),
+ ("de_div_ecx_v2", "fam_de_div_ecx", "train", "b86400000031d231c9", "f7f1", "48894708c3", "RAX=0x64 RCX=0x0 RDX=0x0", "31c0", "kdrv_rate: samples=0 fallback_quotient=0"),
+ ("de_idiv_esi_v1", "fam_de_idiv_esi", "train", "b8500000009931f6", "f7fe", "48894708c3", "RAX=0x50 RSI=0x0 RDX=0x0", "31c0", "kdrv_avg: count=0 fallback_quotient=0"),
+ ("de_idiv_esi_v2", "fam_de_idiv_esi", "train", "b8c80000009931f6", "f7fe", "48894708c3", "RAX=0xc8 RSI=0x0 RDX=0x0", "31c0", "kdrv_avg: buckets=0 fallback_quotient=0"),
+ ("de_div_ebx_v1", "fam_de_div_ebx", "train", "53b83300000031d231db", "f7f3", "5b48894708c3", "RAX=0x33 RBX=0x0 RDX=0x0", "31c0", "kdrv_scale: divisor=0 fallback_quotient=0"),
+ ("de_div_ebx_v2", "fam_de_div_ebx", "train", "53b87f00000031d231db", "f7f3", "5b48894708c3", "RAX=0x7f RBX=0x0 RDX=0x0", "31c0", "kdrv_scale: span=0 fallback_quotient=0"),
+ ("de_div_r8d_v1", "fam_de_div_r8d", "val", "b86300000031d24531c0", "41f7f0", "48894708c3", "RAX=0x63 R8=0x0 RDX=0x0", "31c090", "kdrv_hist: total=0 fallback_quotient=0"),
+ ("de_div_r8d_v2", "fam_de_div_r8d", "val", "b8ff00000031d24531c0", "41f7f0", "48894708c3", "RAX=0xff R8=0x0 RDX=0x0", "31c090", "kdrv_hist: weight_sum=0 fallback_quotient=0"),
+ ("de_div64_rcx_v1","fam_de_div64_rcx","train", "b8f401000031d231c9", "48f7f1", "48894708c3", "RAX=0x1f4 RCX=0x0 RDX=0x0", "4831c0", "kdrv_bw: dt_ns=0 fallback_quotient=0"),
+ ("de_div64_rcx_v2","fam_de_div64_rcx","train", "b8e803000031d231c9", "48f7f1", "48894708c3", "RAX=0x3e8 RCX=0x0 RDX=0x0", "4831c0", "kdrv_bw: window_ns=0 fallback_quotient=0"),
+ ("de_idiv_r9d_v1", "fam_de_idiv_r9d", "test", "b880000000994531c9", "41f7f9", "48894708c3", "RAX=0x80 R9=0x0 RDX=0x0", "31c090", "kdrv_ema: alpha_den=0 fallback_quotient=0"),
+ ("de_idiv_r9d_v2", "fam_de_idiv_r9d", "test", "b8aa000000994531c9", "41f7f9", "48894708c3", "RAX=0xaa R9=0x0 RDX=0x0", "31c090", "kdrv_ema: norm_den=0 fallback_quotient=0"),
+ ]
+ for i, (sid, fam, spl, pref, fhex, suf, reg_s, rpatch, ltail) in enumerate(de_defs):
+ add_exec(
+ sid, fam, "de_patchable", spl,
+ "#DE", 0, 0x0000, "0x0000000000000000", f"kdrv_math+0x0{i:02x}8",
+ pref, fhex, suf,
+ f"{reg_s} RDI=0xffff888004100000 RSP=0xffffc90000013cc0 RFLAGS=0x246",
+ "Quotient in RAX/EAX is stored to out_val and returned; safe divide-by-zero contract requires quotient=0 (out=0, ret=0).",
+ "0", "0", rpatch, ltail
+ )
+
+ # =========================================================================
+ # FAMILY 3: Patchable Ring 0 #UD Traps (10 scenarios, 5 sub-families)
+ # =========================================================================
+ # 3a. UD2 pre-commit (EAX already 0): 90 90 PASSES
+ for idx, (tag, spl) in enumerate([("v1", "train"), ("v2", "train")]):
+ add_exec(
+ f"ud_trap_clean_{tag}", "fam_ud_clean", "ud_patchable", spl,
+ "#UD", 6, 0x0000, "0x0000000000000000", f"kdrv_guard+0x01{idx}a",
+ "31c048c7470842000000", "0f0b", "c3",
+ "RAX=0x0 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c80 RFLAGS=0x246",
+ "Non-fatal diagnostic trap with EAX=0 and out_val=0x42 already populated; skipping trap returns 0 cleanly.",
+ "42", "0", "9090",
+ "kdrv_guard: diag_trap=ud2 state=clean pre_commit=1"
+ )
+
+ # 3b. UD2 where EAX=0x1337 dirty and contract expects safe return 0 (requires 31 c0, blind 90 90 FAILS!)
+ for idx, (tag, spl) in enumerate([("v1", "train"), ("v2", "train")]):
+ add_exec(
+ f"ud_trap_zero_ret_{tag}", "fam_ud_zero_ret", "ud_patchable", spl,
+ "#UD", 6, 0x0000, "0x0000000000000000", f"kdrv_gate+0x02{idx}2",
+ "b837130000", "0f0b", "48894708c3",
+ "RAX=0x1337 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c60 RFLAGS=0x246",
+ "Stale EAX=0x1337 precedes diagnostic ud2 before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).",
+ "0", "0", "31c0",
+ "kdrv_gate: diag_trap=ud2 fallback_ret=0 state=clean"
+ )
+
+ # 3c. UD1 eax, eax (3B: 0f b9 c0) — val split
+ for idx, (tag, spl) in enumerate([("v1", "val"), ("v2", "val")]):
+ add_exec(
+ f"ud_ud1_clean_{tag}", "fam_ud_ud1", "ud_patchable", spl,
+ "#UD", 6, 0x0000, "0x0000000000000000", f"kdrv_probe+0x03{idx}0",
+ "31c048c7470800000000", "0fb9c0", "c3",
+ "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c40 RFLAGS=0x246",
+ "Diagnostic UD1 trap before commit with EAX=0 and out=0; skipping trap returns 0 cleanly.",
+ "0", "0", "909090",
+ "kdrv_probe: diag_trap=ud1 state=clean"
+ )
+
+ # 3d. UD0 eax, eax (3B: 0f ff c0) — test split
+ for idx, (tag, spl) in enumerate([("v1", "test"), ("v2", "test")]):
+ add_exec(
+ f"ud_ud0_clean_{tag}", "fam_ud_ud0", "ud_patchable", spl,
+ "#UD", 6, 0x0000, "0x0000000000000000", f"kdrv_check+0x04{idx}0",
+ "31c048c7470800000000", "0fffc0", "c3",
+ "RAX=0x0 RBX=0x2 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c20 RFLAGS=0x246",
+ "Diagnostic UD0 trap before commit with EAX=0 and out=0; skipping trap returns 0 cleanly.",
+ "0", "0", "909090",
+ "kdrv_check: diag_trap=ud0 state=clean"
+ )
+
+ # 3e. UD2 with 0f 0b after setting out=0x77 (train)
+ for idx, (tag, spl) in enumerate([("v1", "train"), ("v2", "train")]):
+ add_exec(
+ f"ud_trap_keep_out_{tag}", "fam_ud_keep_out", "ud_patchable", spl,
+ "#UD", 6, 0x0000, "0x0000000000000000", f"kdrv_sync+0x05{idx}0",
+ "31c048c7470877000000", "0f0b", "c3",
+ "RAX=0x0 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c00 RFLAGS=0x246",
+ "Debug trap after preparing out_val=0x77 and EAX=0; skipping trap completes operation cleanly.",
+ "77", "0", "9090",
+ "kdrv_sync: debug_trap=ud2 pre_commit=1"
+ )
+
+ # =========================================================================
+ # FAMILY 4A: Control PASS_TO_LINUX (6 scenarios — must NOT patch!)
+ # =========================================================================
+ pass_defs = [
+ ("ctrl_pass_extable_get_user", "fam_ctrl_extable", "train", "#PF", 14, 0x0000, 0, "0x0000000000000010",
+ "__get_user_8+0x0014", "488b11", "RAX=0x0 RCX=0x10 RDX=0x0", 1, 0, "extable_test",
+ "User-pointer read covered by Linux _ASM_EXTABLE fixup (returns -EFAULT).",
+ "kernel: copy_from_user / get_user probe on user pointer 0x10"),
+ ("ctrl_pass_extable_futex", "fam_ctrl_extable", "train", "#PF", 14, 0x0002, 0, "0x0000000000000000",
+ "futex_detect_cmpxchg+0x0026", "3e0fb10e", "RAX=0x0 RCX=0x0 RSI=0x0", 1, 0, "extable_test",
+ "Linux boot-time futex_detect_cmpxchg probe covered by _ASM_EXTABLE.",
+ "kernel: futex_init probing cmpxchg_futex_value_locked"),
+ ("ctrl_pass_extable_copy_user", "fam_ctrl_extable_copy", "val", "#PF", 14, 0x0000, 0, "0x00007f0012340000",
+ "copy_user_enhanced_fast_string+0x0009", "f3a4", "RCX=0x40 RSI=0x7f0012340000 RDI=0xffff888005000000", 1, 0, "extable_test",
+ "Demand-paged user buffer read inside copy_from_user with _ASM_EXTABLE.",
+ "kernel: syscall read/write user buffer fault"),
+ ("ctrl_pass_user_pf_cpl3", "fam_ctrl_cpl3", "train", "#PF", 14, 0x0004, 3, "0x00007ffe91a00000",
+ "user+0x00401234", "8b00", "RAX=0x7ffe91a00000 RSP=0x7ffe919ff000", 0, 0, "policy_only",
+ "Ring 3 userspace page fault (demand paging / COW / SIGSEGV handled by Linux mm).",
+ "user: normal ring-3 fault"),
+ ("ctrl_pass_warn_on_once", "fam_ctrl_warn", "val", "#UD", 6, 0x0000, 0, "0x0000000000000000",
+ "kdrv_warn_path+0x0018", "0f0b", "RAX=0x1 RBX=0x0 RSP=0xffffc90000013b80", 0, 1, "warn_test",
+ "Linux WARN_ON_ONCE metadata entry (bug_warn=1); kernel logs warning and continues cleanly.",
+ "kernel: __bug_table entry flag=BUGFLAG_WARNING"),
+ ("ctrl_pass_user_ud_cpl3", "fam_ctrl_cpl3_ud", "test", "#UD", 6, 0x0000, 3, "0x0000000000000000",
+ "user+0x00402100", "0f0b", "RAX=0x0 RSP=0x7ffe919fe800", 0, 0, "policy_only",
+ "Ring 3 userspace invalid opcode (Linux delivers SIGILL to user process).",
+ "user: ring-3 illegal instruction"),
+ ]
+ for sid, fam, spl, en, vec, err, cpl, cr2, sym, fhex, regs, ext, bw, kmode, chint, ltail in pass_defs:
+ flen = len(fhex) // 2
+ S.append(Scenario(
+ scenario_id=sid, family_id=fam, category="pass_to_linux", split=spl,
+ exc_name=en, exc_vec=vec, err_code=err, cpl=cpl, cr2=cr2,
+ rip_sym=sym, fault_hex=fmt_spaced_hex(fhex), fault_len=flen,
+ disasm=disasm_hex(fhex), regs_summary=regs, contract_hint=chint,
+ extable=ext, bug_warn=bw, lock_held=0, irq_ctx=0, side_effect=0,
+ stack_ok=1, obs_complete=1, log_tail=ltail,
+ expected_action="PASS_TO_LINUX", ref_patch_hex="NONE",
+ kvm_mode=kmode, stub_hex="", patch_off=0,
+ expect_out_hex="ffffffffffffffff", expect_ret_hex="ffffffffffffffff",
+ ))
+
+ # =========================================================================
+ # FAMILY 4B: Control HALT_FOR_DUMP (8 counter-examples with SAME opcodes!)
+ # =========================================================================
+ halt_defs = [
+ ("ctrl_halt_pf_lock_held", "fam_halt_lock", "train", "#PF", 14, 0x0002, "0x0000000000000000",
+ "kdrv_tx+0x0180", "c7042500000000efbeadde", "RAX=0x0 RBX=0x3 RCX=0x0",
+ "Ring 0 NULL write while holding spinlock (lock_held=1); patching risks deadlock / lock leak.",
+ 1, 0, 0, 1, 1, "kdrv_tx: spin_lock(&dev->tx_lock) acquired; preempt_count=1"),
+ ("ctrl_halt_pf_side_effect", "fam_halt_sideeff", "train", "#PF", 14, 0x0002, "0x0000000000000000",
+ "kdrv_blk+0x0214", "8910", "RAX=0x0 RDX=0x55",
+ "Ring 0 NULL store AFTER DMA/block write already committed (side_effect=1).",
+ 0, 0, 1, 1, 1, "kdrv_blk: dma_submit() already issued to NVMe queue before fault"),
+ ("ctrl_halt_pf_irq_ctx", "fam_halt_irq", "train", "#PF", 14, 0x0002, "0x0000000000000000",
+ "kdrv_isr+0x004c", "c60001", "RAX=0x0 RDX=0x1",
+ "Ring 0 NULL write inside hard IRQ context (irq_ctx=1); unsafe to patch live.",
+ 0, 1, 0, 1, 1, "kdrv_isr: in_hardirq()=1 interrupt handler active"),
+ ("ctrl_halt_de_side_effect", "fam_halt_de_sideeff", "val", "#DE", 0, 0x0000, "0x0000000000000000",
+ "kdrv_ledger+0x0088", "f7f1", "RAX=0x2a RCX=0x0 RDX=0x0",
+ "Ring 0 divide-by-zero AFTER partial state mutation committed (side_effect=1).",
+ 0, 0, 1, 1, 1, "kdrv_ledger: journal header already flushed before div"),
+ ("ctrl_halt_de_lock_held", "fam_halt_de_lock", "val", "#DE", 0, 0x0000, "0x0000000000000000",
+ "kdrv_sched+0x00a4", "f7fe", "RAX=0x50 RSI=0x0 RDX=0x0",
+ "Ring 0 signed divide-by-zero while holding rwlock (lock_held=1).",
+ 1, 0, 0, 1, 1, "kdrv_sched: write_lock_irq(&rq->lock) held"),
+ ("ctrl_halt_ud_bug_post_commit", "fam_halt_ud_bug", "train", "#UD", 6, 0x0000, "0x0000000000000000",
+ "kdrv_fs+0x0310", "0f0b", "RAX=0x0 RBX=0x1",
+ "Hard BUG_ON invariant failure (bug_warn=0) after metadata write committed (side_effect=1).",
+ 0, 0, 1, 1, 1, "kdrv_fs: BUG_ON(inode->dirty_bytes < 0) post-commit"),
+ ("ctrl_halt_stack_corrupt", "fam_halt_stack", "test", "#PF", 14, 0x0000, "0x0000000000000010",
+ "kdrv_parse+0x0410", "8b4310", "RAX=0x77 RBX=0x0 RSP=0x0000000000000008",
+ "Ring 0 fault with corrupted kernel stack pointer (stack_ok=0).",
+ 0, 0, 0, 0, 1, "kdrv_parse: RSP outside kernel stack bounds"),
+ ("ctrl_halt_incomplete_obs", "fam_halt_incomplete", "test", "#DE", 0, 0x0000, "0x0000000000000000",
+ "kdrv_unknown+0x0090", "f7f1", "RAX=0x2a RCX=0x0",
+ "Incomplete/truncated Ring -1 telemetry snapshot (obs_complete=0); cannot verify safe patch.",
+ 0, 0, 0, 1, 0, "ring1: guest page walk partial; telemetry truncated"),
+ ]
+ for sid, fam, spl, en, vec, err, cr2, sym, fhex, regs, chint, lh, ic, se, sok, oc, ltail in halt_defs:
+ add_exec(
+ sid, fam, "halt_for_dump", spl,
+ en, vec, err, cr2, sym,
+ "", fhex, "", regs, chint,
+ "ffffffffffffffff", "ffffffffffffffff", "NONE", ltail,
+ lock_held=lh, irq_ctx=ic, side_effect=se, stack_ok=sok, obs_complete=oc,
+ expected_action="HALT_FOR_DUMP"
+ )
+
+ return S
+
+if __name__ == "__main__":
+ items = build_pilot_scenarios()
+ from collections import Counter
+ print(f"Total scenarios: {len(items)}")
+ print("By split:", dict(Counter(x.split for x in items)))
+ print("By category:", dict(Counter(x.category for x in items)))
+ print("By expected_action:", dict(Counter(x.expected_action for x in items)))
+ # Verify zero family overlap across splits
+ split_fams = {}
+ for x in items:
+ split_fams.setdefault(x.split, set()).add(x.family_id)
+ assert not (split_fams["train"] & split_fams["val"]), "train/val family leak!"
+ assert not (split_fams["train"] & split_fams["test"]), "train/test family leak!"
+ assert not (split_fams["val"] & split_fams["test"]), "val/test family leak!"
+ print("Family-level split isolation: OK (zero leakage!)")
+ import os
+ out_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "pilot_scenarios.jsonl")
+ with open(out_path, "w") as f:
+ for x in items:
+ f.write(json.dumps(asdict(x)) + "\n")
+ print(f"Saved {len(items)} scenarios -> {out_path}")
diff --git a/04-ring1-kernel-surgeon/dataset/scenarios_600.jsonl b/04-ring1-kernel-surgeon/dataset/scenarios_600.jsonl
new file mode 100644
index 0000000..b57d315
--- /dev/null
+++ b/04-ring1-kernel-surgeon/dataset/scenarios_600.jsonl
@@ -0,0 +1,600 @@
+{"scenario_id": "pf_abs_u32_imm_00", "family_id": "pf_abs_u32_imm", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tel+0x0010", "fault_hex": "c7 04 25 00 00 00 00 01 00 ad de", "fault_len": 11, "disasm": "mov dword ptr [0], 0xdead0001", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d00 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x100 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tel: stage=pre_commit opt_ptr=NULL seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c70425000000000100adde48c7470800010000c3", "patch_off": 2, "expect_out_hex": "100", "expect_ret_hex": "0"}
+{"scenario_id": "pf_abs_u32_imm_01", "family_id": "pf_abs_u32_imm", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tel+0x0020", "fault_hex": "c7 04 25 00 00 00 00 12 00 ad de", "fault_len": 11, "disasm": "mov dword ptr [0], 0xdead0012", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d08 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x110 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tel: stage=pre_commit opt_ptr=NULL seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c70425000000001200adde48c7470810010000c3", "patch_off": 2, "expect_out_hex": "110", "expect_ret_hex": "0"}
+{"scenario_id": "pf_abs_u32_imm_02", "family_id": "pf_abs_u32_imm", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tel+0x0030", "fault_hex": "c7 04 25 00 00 00 00 23 00 ad de", "fault_len": 11, "disasm": "mov dword ptr [0], 0xdead0023", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d10 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x120 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tel: stage=pre_commit opt_ptr=NULL seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c70425000000002300adde48c7470820010000c3", "patch_off": 2, "expect_out_hex": "120", "expect_ret_hex": "0"}
+{"scenario_id": "pf_abs_u32_imm_03", "family_id": "pf_abs_u32_imm", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tel+0x0040", "fault_hex": "c7 04 25 00 00 00 00 34 00 ad de", "fault_len": 11, "disasm": "mov dword ptr [0], 0xdead0034", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d18 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x130 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tel: stage=pre_commit opt_ptr=NULL seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c70425000000003400adde48c7470830010000c3", "patch_off": 2, "expect_out_hex": "130", "expect_ret_hex": "0"}
+{"scenario_id": "pf_abs_u32_imm_04", "family_id": "pf_abs_u32_imm", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tel+0x0050", "fault_hex": "c7 04 25 00 00 00 00 45 00 ad de", "fault_len": 11, "disasm": "mov dword ptr [0], 0xdead0045", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d20 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x140 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tel: stage=pre_commit opt_ptr=NULL seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c70425000000004500adde48c7470840010000c3", "patch_off": 2, "expect_out_hex": "140", "expect_ret_hex": "0"}
+{"scenario_id": "pf_abs_u32_imm_05", "family_id": "pf_abs_u32_imm", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tel+0x0060", "fault_hex": "c7 04 25 00 00 00 00 56 00 ad de", "fault_len": 11, "disasm": "mov dword ptr [0], 0xdead0056", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d28 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x150 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tel: stage=pre_commit opt_ptr=NULL seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c70425000000005600adde48c7470850010000c3", "patch_off": 2, "expect_out_hex": "150", "expect_ret_hex": "0"}
+{"scenario_id": "pf_abs_u32_imm_06", "family_id": "pf_abs_u32_imm", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tel+0x0070", "fault_hex": "c7 04 25 00 00 00 00 67 00 ad de", "fault_len": 11, "disasm": "mov dword ptr [0], 0xdead0067", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d30 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x160 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tel: stage=pre_commit opt_ptr=NULL seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c70425000000006700adde48c7470860010000c3", "patch_off": 2, "expect_out_hex": "160", "expect_ret_hex": "0"}
+{"scenario_id": "pf_abs_u32_imm_07", "family_id": "pf_abs_u32_imm", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tel+0x0080", "fault_hex": "c7 04 25 00 00 00 00 78 00 ad de", "fault_len": 11, "disasm": "mov dword ptr [0], 0xdead0078", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d38 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x170 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tel: stage=pre_commit opt_ptr=NULL seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c70425000000007800adde48c7470870010000c3", "patch_off": 2, "expect_out_hex": "170", "expect_ret_hex": "0"}
+{"scenario_id": "pf_abs_u8_imm_00", "family_id": "pf_abs_u8_imm", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_mark+0x0010", "fault_hex": "c6 04 25 00 00 00 00 01", "fault_len": 8, "disasm": "mov byte ptr [0], 1", "regs_summary": "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d00 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x100 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_mark: stage=pre_commit opt_ptr=NULL seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c60425000000000148c7470800010000c3", "patch_off": 2, "expect_out_hex": "100", "expect_ret_hex": "0"}
+{"scenario_id": "pf_abs_u8_imm_01", "family_id": "pf_abs_u8_imm", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_mark+0x0020", "fault_hex": "c6 04 25 00 00 00 00 02", "fault_len": 8, "disasm": "mov byte ptr [0], 2", "regs_summary": "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d08 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x110 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_mark: stage=pre_commit opt_ptr=NULL seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c60425000000000248c7470810010000c3", "patch_off": 2, "expect_out_hex": "110", "expect_ret_hex": "0"}
+{"scenario_id": "pf_abs_u8_imm_02", "family_id": "pf_abs_u8_imm", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_mark+0x0030", "fault_hex": "c6 04 25 00 00 00 00 03", "fault_len": 8, "disasm": "mov byte ptr [0], 3", "regs_summary": "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d10 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x120 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_mark: stage=pre_commit opt_ptr=NULL seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c60425000000000348c7470820010000c3", "patch_off": 2, "expect_out_hex": "120", "expect_ret_hex": "0"}
+{"scenario_id": "pf_abs_u8_imm_03", "family_id": "pf_abs_u8_imm", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_mark+0x0040", "fault_hex": "c6 04 25 00 00 00 00 04", "fault_len": 8, "disasm": "mov byte ptr [0], 4", "regs_summary": "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d18 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x130 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_mark: stage=pre_commit opt_ptr=NULL seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c60425000000000448c7470830010000c3", "patch_off": 2, "expect_out_hex": "130", "expect_ret_hex": "0"}
+{"scenario_id": "pf_abs_u8_imm_04", "family_id": "pf_abs_u8_imm", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_mark+0x0050", "fault_hex": "c6 04 25 00 00 00 00 05", "fault_len": 8, "disasm": "mov byte ptr [0], 5", "regs_summary": "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d20 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x140 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_mark: stage=pre_commit opt_ptr=NULL seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c60425000000000548c7470840010000c3", "patch_off": 2, "expect_out_hex": "140", "expect_ret_hex": "0"}
+{"scenario_id": "pf_abs_u8_imm_05", "family_id": "pf_abs_u8_imm", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_mark+0x0060", "fault_hex": "c6 04 25 00 00 00 00 06", "fault_len": 8, "disasm": "mov byte ptr [0], 6", "regs_summary": "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d28 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x150 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_mark: stage=pre_commit opt_ptr=NULL seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c60425000000000648c7470850010000c3", "patch_off": 2, "expect_out_hex": "150", "expect_ret_hex": "0"}
+{"scenario_id": "pf_abs_u8_imm_06", "family_id": "pf_abs_u8_imm", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_mark+0x0070", "fault_hex": "c6 04 25 00 00 00 00 07", "fault_len": 8, "disasm": "mov byte ptr [0], 7", "regs_summary": "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d30 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x160 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_mark: stage=pre_commit opt_ptr=NULL seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c60425000000000748c7470860010000c3", "patch_off": 2, "expect_out_hex": "160", "expect_ret_hex": "0"}
+{"scenario_id": "pf_abs_u8_imm_07", "family_id": "pf_abs_u8_imm", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_mark+0x0080", "fault_hex": "c6 04 25 00 00 00 00 08", "fault_len": 8, "disasm": "mov byte ptr [0], 8", "regs_summary": "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d38 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x170 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_mark: stage=pre_commit opt_ptr=NULL seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c60425000000000848c7470870010000c3", "patch_off": 2, "expect_out_hex": "170", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rax_edx_00", "family_id": "pf_reg_rax_edx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ring+0x0010", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x0 RDX=0x10 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d00 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x100 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ring: stage=pre_commit opt_ptr=NULL seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c0ba10000000891048c7470800010000c3", "patch_off": 7, "expect_out_hex": "100", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rax_edx_01", "family_id": "pf_reg_rax_edx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ring+0x0020", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x0 RDX=0x11 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d08 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x110 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ring: stage=pre_commit opt_ptr=NULL seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c0ba11000000891048c7470810010000c3", "patch_off": 7, "expect_out_hex": "110", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rax_edx_02", "family_id": "pf_reg_rax_edx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ring+0x0030", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x0 RDX=0x12 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d10 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x120 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ring: stage=pre_commit opt_ptr=NULL seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c0ba12000000891048c7470820010000c3", "patch_off": 7, "expect_out_hex": "120", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rax_edx_03", "family_id": "pf_reg_rax_edx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ring+0x0040", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x0 RDX=0x13 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d18 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x130 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ring: stage=pre_commit opt_ptr=NULL seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c0ba13000000891048c7470830010000c3", "patch_off": 7, "expect_out_hex": "130", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rax_edx_04", "family_id": "pf_reg_rax_edx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ring+0x0050", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x0 RDX=0x14 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d20 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x140 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ring: stage=pre_commit opt_ptr=NULL seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c0ba14000000891048c7470840010000c3", "patch_off": 7, "expect_out_hex": "140", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rax_edx_05", "family_id": "pf_reg_rax_edx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ring+0x0060", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x0 RDX=0x15 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d28 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x150 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ring: stage=pre_commit opt_ptr=NULL seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c0ba15000000891048c7470850010000c3", "patch_off": 7, "expect_out_hex": "150", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rax_edx_06", "family_id": "pf_reg_rax_edx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ring+0x0070", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x0 RDX=0x16 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d30 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x160 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ring: stage=pre_commit opt_ptr=NULL seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c0ba16000000891048c7470860010000c3", "patch_off": 7, "expect_out_hex": "160", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rax_edx_07", "family_id": "pf_reg_rax_edx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ring+0x0080", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x0 RDX=0x17 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d38 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x170 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ring: stage=pre_commit opt_ptr=NULL seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c0ba17000000891048c7470870010000c3", "patch_off": 7, "expect_out_hex": "170", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rax_ecx_00", "family_id": "pf_reg_rax_ecx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_stat+0x0010", "fault_hex": "89 08", "fault_len": 2, "disasm": "mov dword ptr [rax], ecx", "regs_summary": "RAX=0x0 RCX=0x10 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d00 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x100 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_stat: stage=pre_commit opt_ptr=NULL seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c0b920000000890848c7470800010000c3", "patch_off": 7, "expect_out_hex": "100", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rax_ecx_01", "family_id": "pf_reg_rax_ecx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_stat+0x0020", "fault_hex": "89 08", "fault_len": 2, "disasm": "mov dword ptr [rax], ecx", "regs_summary": "RAX=0x0 RCX=0x11 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d08 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x110 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_stat: stage=pre_commit opt_ptr=NULL seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c0b921000000890848c7470810010000c3", "patch_off": 7, "expect_out_hex": "110", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rax_ecx_02", "family_id": "pf_reg_rax_ecx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_stat+0x0030", "fault_hex": "89 08", "fault_len": 2, "disasm": "mov dword ptr [rax], ecx", "regs_summary": "RAX=0x0 RCX=0x12 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d10 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x120 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_stat: stage=pre_commit opt_ptr=NULL seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c0b922000000890848c7470820010000c3", "patch_off": 7, "expect_out_hex": "120", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rax_ecx_03", "family_id": "pf_reg_rax_ecx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_stat+0x0040", "fault_hex": "89 08", "fault_len": 2, "disasm": "mov dword ptr [rax], ecx", "regs_summary": "RAX=0x0 RCX=0x13 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d18 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x130 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_stat: stage=pre_commit opt_ptr=NULL seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c0b923000000890848c7470830010000c3", "patch_off": 7, "expect_out_hex": "130", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rax_ecx_04", "family_id": "pf_reg_rax_ecx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_stat+0x0050", "fault_hex": "89 08", "fault_len": 2, "disasm": "mov dword ptr [rax], ecx", "regs_summary": "RAX=0x0 RCX=0x14 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d20 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x140 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_stat: stage=pre_commit opt_ptr=NULL seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c0b924000000890848c7470840010000c3", "patch_off": 7, "expect_out_hex": "140", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rax_ecx_05", "family_id": "pf_reg_rax_ecx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_stat+0x0060", "fault_hex": "89 08", "fault_len": 2, "disasm": "mov dword ptr [rax], ecx", "regs_summary": "RAX=0x0 RCX=0x15 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d28 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x150 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_stat: stage=pre_commit opt_ptr=NULL seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c0b925000000890848c7470850010000c3", "patch_off": 7, "expect_out_hex": "150", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rax_ecx_06", "family_id": "pf_reg_rax_ecx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_stat+0x0070", "fault_hex": "89 08", "fault_len": 2, "disasm": "mov dword ptr [rax], ecx", "regs_summary": "RAX=0x0 RCX=0x16 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d30 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x160 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_stat: stage=pre_commit opt_ptr=NULL seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c0b926000000890848c7470860010000c3", "patch_off": 7, "expect_out_hex": "160", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rax_ecx_07", "family_id": "pf_reg_rax_ecx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_stat+0x0080", "fault_hex": "89 08", "fault_len": 2, "disasm": "mov dword ptr [rax], ecx", "regs_summary": "RAX=0x0 RCX=0x17 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d38 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x170 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_stat: stage=pre_commit opt_ptr=NULL seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c0b927000000890848c7470870010000c3", "patch_off": 7, "expect_out_hex": "170", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rsi_edx_00", "family_id": "pf_reg_rsi_edx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_slot+0x0010", "fault_hex": "89 16", "fault_len": 2, "disasm": "mov dword ptr [rsi], edx", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x10 RDI=0xffff888004100000 RSP=0xffffc90000013d00 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x100 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_slot: stage=pre_commit opt_ptr=NULL seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c031f6ba30000000891648c7470800010000c3", "patch_off": 9, "expect_out_hex": "100", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rsi_edx_01", "family_id": "pf_reg_rsi_edx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_slot+0x0020", "fault_hex": "89 16", "fault_len": 2, "disasm": "mov dword ptr [rsi], edx", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x11 RDI=0xffff888004100000 RSP=0xffffc90000013d08 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x110 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_slot: stage=pre_commit opt_ptr=NULL seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c031f6ba31000000891648c7470810010000c3", "patch_off": 9, "expect_out_hex": "110", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rsi_edx_02", "family_id": "pf_reg_rsi_edx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_slot+0x0030", "fault_hex": "89 16", "fault_len": 2, "disasm": "mov dword ptr [rsi], edx", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x12 RDI=0xffff888004100000 RSP=0xffffc90000013d10 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x120 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_slot: stage=pre_commit opt_ptr=NULL seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c031f6ba32000000891648c7470820010000c3", "patch_off": 9, "expect_out_hex": "120", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rsi_edx_03", "family_id": "pf_reg_rsi_edx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_slot+0x0040", "fault_hex": "89 16", "fault_len": 2, "disasm": "mov dword ptr [rsi], edx", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x13 RDI=0xffff888004100000 RSP=0xffffc90000013d18 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x130 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_slot: stage=pre_commit opt_ptr=NULL seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c031f6ba33000000891648c7470830010000c3", "patch_off": 9, "expect_out_hex": "130", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rsi_edx_04", "family_id": "pf_reg_rsi_edx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_slot+0x0050", "fault_hex": "89 16", "fault_len": 2, "disasm": "mov dword ptr [rsi], edx", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x14 RDI=0xffff888004100000 RSP=0xffffc90000013d20 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x140 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_slot: stage=pre_commit opt_ptr=NULL seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c031f6ba34000000891648c7470840010000c3", "patch_off": 9, "expect_out_hex": "140", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rsi_edx_05", "family_id": "pf_reg_rsi_edx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_slot+0x0060", "fault_hex": "89 16", "fault_len": 2, "disasm": "mov dword ptr [rsi], edx", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x15 RDI=0xffff888004100000 RSP=0xffffc90000013d28 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x150 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_slot: stage=pre_commit opt_ptr=NULL seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c031f6ba35000000891648c7470850010000c3", "patch_off": 9, "expect_out_hex": "150", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rsi_edx_06", "family_id": "pf_reg_rsi_edx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_slot+0x0070", "fault_hex": "89 16", "fault_len": 2, "disasm": "mov dword ptr [rsi], edx", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x16 RDI=0xffff888004100000 RSP=0xffffc90000013d30 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x160 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_slot: stage=pre_commit opt_ptr=NULL seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c031f6ba36000000891648c7470860010000c3", "patch_off": 9, "expect_out_hex": "160", "expect_ret_hex": "0"}
+{"scenario_id": "pf_reg_rsi_edx_07", "family_id": "pf_reg_rsi_edx", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_slot+0x0080", "fault_hex": "89 16", "fault_len": 2, "disasm": "mov dword ptr [rsi], edx", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x17 RDI=0xffff888004100000 RSP=0xffffc90000013d38 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x170 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_slot: stage=pre_commit opt_ptr=NULL seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c031f6ba37000000891648c7470870010000c3", "patch_off": 9, "expect_out_hex": "170", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rax_00", "family_id": "pf_byte_rax", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_flag+0x0010", "fault_hex": "c6 00 01", "fault_len": 3, "disasm": "mov byte ptr [rax], 1", "regs_summary": "RAX=0x0 RBX=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013d00 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x100 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_flag: stage=pre_commit opt_ptr=NULL seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c6000148c7470800010000c3", "patch_off": 2, "expect_out_hex": "100", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rax_01", "family_id": "pf_byte_rax", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_flag+0x0020", "fault_hex": "c6 00 02", "fault_len": 3, "disasm": "mov byte ptr [rax], 2", "regs_summary": "RAX=0x0 RBX=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013d08 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x110 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_flag: stage=pre_commit opt_ptr=NULL seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c6000248c7470810010000c3", "patch_off": 2, "expect_out_hex": "110", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rax_02", "family_id": "pf_byte_rax", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_flag+0x0030", "fault_hex": "c6 00 03", "fault_len": 3, "disasm": "mov byte ptr [rax], 3", "regs_summary": "RAX=0x0 RBX=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013d10 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x120 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_flag: stage=pre_commit opt_ptr=NULL seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c6000348c7470820010000c3", "patch_off": 2, "expect_out_hex": "120", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rax_03", "family_id": "pf_byte_rax", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_flag+0x0040", "fault_hex": "c6 00 04", "fault_len": 3, "disasm": "mov byte ptr [rax], 4", "regs_summary": "RAX=0x0 RBX=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013d18 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x130 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_flag: stage=pre_commit opt_ptr=NULL seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c6000448c7470830010000c3", "patch_off": 2, "expect_out_hex": "130", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rax_04", "family_id": "pf_byte_rax", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_flag+0x0050", "fault_hex": "c6 00 05", "fault_len": 3, "disasm": "mov byte ptr [rax], 5", "regs_summary": "RAX=0x0 RBX=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013d20 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x140 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_flag: stage=pre_commit opt_ptr=NULL seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c6000548c7470840010000c3", "patch_off": 2, "expect_out_hex": "140", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rax_05", "family_id": "pf_byte_rax", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_flag+0x0060", "fault_hex": "c6 00 06", "fault_len": 3, "disasm": "mov byte ptr [rax], 6", "regs_summary": "RAX=0x0 RBX=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013d28 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x150 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_flag: stage=pre_commit opt_ptr=NULL seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c6000648c7470850010000c3", "patch_off": 2, "expect_out_hex": "150", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rax_06", "family_id": "pf_byte_rax", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_flag+0x0070", "fault_hex": "c6 00 07", "fault_len": 3, "disasm": "mov byte ptr [rax], 7", "regs_summary": "RAX=0x0 RBX=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013d30 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x160 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_flag: stage=pre_commit opt_ptr=NULL seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c6000748c7470860010000c3", "patch_off": 2, "expect_out_hex": "160", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rax_07", "family_id": "pf_byte_rax", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_flag+0x0080", "fault_hex": "c6 00 08", "fault_len": 3, "disasm": "mov byte ptr [rax], 8", "regs_summary": "RAX=0x0 RBX=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013d38 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x170 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_flag: stage=pre_commit opt_ptr=NULL seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c6000848c7470870010000c3", "patch_off": 2, "expect_out_hex": "170", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rsi_00", "family_id": "pf_byte_rsi", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tag+0x0010", "fault_hex": "c6 06 05", "fault_len": 3, "disasm": "mov byte ptr [rsi], 5", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013d00 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x100 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tag: stage=pre_commit opt_ptr=NULL seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031f6c6060548c7470800010000c3", "patch_off": 4, "expect_out_hex": "100", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rsi_01", "family_id": "pf_byte_rsi", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tag+0x0020", "fault_hex": "c6 06 06", "fault_len": 3, "disasm": "mov byte ptr [rsi], 6", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013d08 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x110 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tag: stage=pre_commit opt_ptr=NULL seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031f6c6060648c7470810010000c3", "patch_off": 4, "expect_out_hex": "110", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rsi_02", "family_id": "pf_byte_rsi", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tag+0x0030", "fault_hex": "c6 06 07", "fault_len": 3, "disasm": "mov byte ptr [rsi], 7", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013d10 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x120 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tag: stage=pre_commit opt_ptr=NULL seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031f6c6060748c7470820010000c3", "patch_off": 4, "expect_out_hex": "120", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rsi_03", "family_id": "pf_byte_rsi", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tag+0x0040", "fault_hex": "c6 06 08", "fault_len": 3, "disasm": "mov byte ptr [rsi], 8", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013d18 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x130 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tag: stage=pre_commit opt_ptr=NULL seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031f6c6060848c7470830010000c3", "patch_off": 4, "expect_out_hex": "130", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rsi_04", "family_id": "pf_byte_rsi", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tag+0x0050", "fault_hex": "c6 06 09", "fault_len": 3, "disasm": "mov byte ptr [rsi], 9", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013d20 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x140 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tag: stage=pre_commit opt_ptr=NULL seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031f6c6060948c7470840010000c3", "patch_off": 4, "expect_out_hex": "140", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rsi_05", "family_id": "pf_byte_rsi", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tag+0x0060", "fault_hex": "c6 06 0a", "fault_len": 3, "disasm": "mov byte ptr [rsi], 0xa", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013d28 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x150 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tag: stage=pre_commit opt_ptr=NULL seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031f6c6060a48c7470850010000c3", "patch_off": 4, "expect_out_hex": "150", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rsi_06", "family_id": "pf_byte_rsi", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tag+0x0070", "fault_hex": "c6 06 0b", "fault_len": 3, "disasm": "mov byte ptr [rsi], 0xb", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013d30 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x160 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tag: stage=pre_commit opt_ptr=NULL seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031f6c6060b48c7470860010000c3", "patch_off": 4, "expect_out_hex": "160", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rsi_07", "family_id": "pf_byte_rsi", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tag+0x0080", "fault_hex": "c6 06 0c", "fault_len": 3, "disasm": "mov byte ptr [rsi], 0xc", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x1 RDI=0xffff888004100000 RSP=0xffffc90000013d38 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x170 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tag: stage=pre_commit opt_ptr=NULL seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031f6c6060c48c7470870010000c3", "patch_off": 4, "expect_out_hex": "170", "expect_ret_hex": "0"}
+{"scenario_id": "pf_imm32_rax_00", "family_id": "pf_imm32_rax", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_dbg+0x0010", "fault_hex": "c7 00 00 01 00 00", "fault_len": 6, "disasm": "mov dword ptr [rax], 0x100", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d00 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x100 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_dbg: stage=pre_commit opt_ptr=NULL seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c7000001000048c7470800010000c3", "patch_off": 2, "expect_out_hex": "100", "expect_ret_hex": "0"}
+{"scenario_id": "pf_imm32_rax_01", "family_id": "pf_imm32_rax", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_dbg+0x0020", "fault_hex": "c7 00 0d 01 00 00", "fault_len": 6, "disasm": "mov dword ptr [rax], 0x10d", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d08 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x110 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_dbg: stage=pre_commit opt_ptr=NULL seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c7000d01000048c7470810010000c3", "patch_off": 2, "expect_out_hex": "110", "expect_ret_hex": "0"}
+{"scenario_id": "pf_imm32_rax_02", "family_id": "pf_imm32_rax", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_dbg+0x0030", "fault_hex": "c7 00 1a 01 00 00", "fault_len": 6, "disasm": "mov dword ptr [rax], 0x11a", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d10 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x120 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_dbg: stage=pre_commit opt_ptr=NULL seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c7001a01000048c7470820010000c3", "patch_off": 2, "expect_out_hex": "120", "expect_ret_hex": "0"}
+{"scenario_id": "pf_imm32_rax_03", "family_id": "pf_imm32_rax", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_dbg+0x0040", "fault_hex": "c7 00 27 01 00 00", "fault_len": 6, "disasm": "mov dword ptr [rax], 0x127", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d18 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x130 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_dbg: stage=pre_commit opt_ptr=NULL seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c7002701000048c7470830010000c3", "patch_off": 2, "expect_out_hex": "130", "expect_ret_hex": "0"}
+{"scenario_id": "pf_imm32_rax_04", "family_id": "pf_imm32_rax", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_dbg+0x0050", "fault_hex": "c7 00 34 01 00 00", "fault_len": 6, "disasm": "mov dword ptr [rax], 0x134", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d20 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x140 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_dbg: stage=pre_commit opt_ptr=NULL seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c7003401000048c7470840010000c3", "patch_off": 2, "expect_out_hex": "140", "expect_ret_hex": "0"}
+{"scenario_id": "pf_imm32_rax_05", "family_id": "pf_imm32_rax", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_dbg+0x0060", "fault_hex": "c7 00 41 01 00 00", "fault_len": 6, "disasm": "mov dword ptr [rax], 0x141", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d28 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x150 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_dbg: stage=pre_commit opt_ptr=NULL seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c7004101000048c7470850010000c3", "patch_off": 2, "expect_out_hex": "150", "expect_ret_hex": "0"}
+{"scenario_id": "pf_imm32_rax_06", "family_id": "pf_imm32_rax", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_dbg+0x0070", "fault_hex": "c7 00 4e 01 00 00", "fault_len": 6, "disasm": "mov dword ptr [rax], 0x14e", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d30 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x160 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_dbg: stage=pre_commit opt_ptr=NULL seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c7004e01000048c7470860010000c3", "patch_off": 2, "expect_out_hex": "160", "expect_ret_hex": "0"}
+{"scenario_id": "pf_imm32_rax_07", "family_id": "pf_imm32_rax", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_dbg+0x0080", "fault_hex": "c7 00 5b 01 00 00", "fault_len": 6, "disasm": "mov dword ptr [rax], 0x15b", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d38 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x170 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_dbg: stage=pre_commit opt_ptr=NULL seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90 90 90 90", "kvm_mode": "exec", "stub_hex": "31c0c7005b01000048c7470870010000c3", "patch_off": 2, "expect_out_hex": "170", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rax_rdx_00", "family_id": "pf_qword_rax_rdx", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_aud+0x0010", "fault_hex": "48 89 10", "fault_len": 3, "disasm": "mov qword ptr [rax], rdx", "regs_summary": "RAX=0x0 RDX=0x10 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d00 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x100 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_aud: stage=pre_commit opt_ptr=NULL seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0ba4000000048891048c7470800010000c3", "patch_off": 7, "expect_out_hex": "100", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rax_rdx_01", "family_id": "pf_qword_rax_rdx", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_aud+0x0020", "fault_hex": "48 89 10", "fault_len": 3, "disasm": "mov qword ptr [rax], rdx", "regs_summary": "RAX=0x0 RDX=0x11 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d08 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x110 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_aud: stage=pre_commit opt_ptr=NULL seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0ba4100000048891048c7470810010000c3", "patch_off": 7, "expect_out_hex": "110", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rax_rdx_02", "family_id": "pf_qword_rax_rdx", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_aud+0x0030", "fault_hex": "48 89 10", "fault_len": 3, "disasm": "mov qword ptr [rax], rdx", "regs_summary": "RAX=0x0 RDX=0x12 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d10 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x120 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_aud: stage=pre_commit opt_ptr=NULL seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0ba4200000048891048c7470820010000c3", "patch_off": 7, "expect_out_hex": "120", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rax_rdx_03", "family_id": "pf_qword_rax_rdx", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_aud+0x0040", "fault_hex": "48 89 10", "fault_len": 3, "disasm": "mov qword ptr [rax], rdx", "regs_summary": "RAX=0x0 RDX=0x13 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d18 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x130 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_aud: stage=pre_commit opt_ptr=NULL seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0ba4300000048891048c7470830010000c3", "patch_off": 7, "expect_out_hex": "130", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rax_rdx_04", "family_id": "pf_qword_rax_rdx", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_aud+0x0050", "fault_hex": "48 89 10", "fault_len": 3, "disasm": "mov qword ptr [rax], rdx", "regs_summary": "RAX=0x0 RDX=0x14 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d20 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x140 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_aud: stage=pre_commit opt_ptr=NULL seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0ba4400000048891048c7470840010000c3", "patch_off": 7, "expect_out_hex": "140", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rax_rdx_05", "family_id": "pf_qword_rax_rdx", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_aud+0x0060", "fault_hex": "48 89 10", "fault_len": 3, "disasm": "mov qword ptr [rax], rdx", "regs_summary": "RAX=0x0 RDX=0x15 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d28 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x150 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_aud: stage=pre_commit opt_ptr=NULL seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0ba4500000048891048c7470850010000c3", "patch_off": 7, "expect_out_hex": "150", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rax_rdx_06", "family_id": "pf_qword_rax_rdx", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_aud+0x0070", "fault_hex": "48 89 10", "fault_len": 3, "disasm": "mov qword ptr [rax], rdx", "regs_summary": "RAX=0x0 RDX=0x16 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d30 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x160 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_aud: stage=pre_commit opt_ptr=NULL seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0ba4600000048891048c7470860010000c3", "patch_off": 7, "expect_out_hex": "160", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rax_rdx_07", "family_id": "pf_qword_rax_rdx", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_aud+0x0080", "fault_hex": "48 89 10", "fault_len": 3, "disasm": "mov qword ptr [rax], rdx", "regs_summary": "RAX=0x0 RDX=0x17 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d38 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x170 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_aud: stage=pre_commit opt_ptr=NULL seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0ba4700000048891048c7470870010000c3", "patch_off": 7, "expect_out_hex": "170", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rax_rcx_00", "family_id": "pf_qword_rax_rcx", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_log+0x0010", "fault_hex": "48 89 08", "fault_len": 3, "disasm": "mov qword ptr [rax], rcx", "regs_summary": "RAX=0x0 RCX=0x10 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d00 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x100 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_log: stage=pre_commit opt_ptr=NULL seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0b95000000048890848c7470800010000c3", "patch_off": 7, "expect_out_hex": "100", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rax_rcx_01", "family_id": "pf_qword_rax_rcx", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_log+0x0020", "fault_hex": "48 89 08", "fault_len": 3, "disasm": "mov qword ptr [rax], rcx", "regs_summary": "RAX=0x0 RCX=0x11 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d08 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x110 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_log: stage=pre_commit opt_ptr=NULL seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0b95100000048890848c7470810010000c3", "patch_off": 7, "expect_out_hex": "110", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rax_rcx_02", "family_id": "pf_qword_rax_rcx", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_log+0x0030", "fault_hex": "48 89 08", "fault_len": 3, "disasm": "mov qword ptr [rax], rcx", "regs_summary": "RAX=0x0 RCX=0x12 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d10 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x120 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_log: stage=pre_commit opt_ptr=NULL seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0b95200000048890848c7470820010000c3", "patch_off": 7, "expect_out_hex": "120", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rax_rcx_03", "family_id": "pf_qword_rax_rcx", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_log+0x0040", "fault_hex": "48 89 08", "fault_len": 3, "disasm": "mov qword ptr [rax], rcx", "regs_summary": "RAX=0x0 RCX=0x13 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d18 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x130 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_log: stage=pre_commit opt_ptr=NULL seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0b95300000048890848c7470830010000c3", "patch_off": 7, "expect_out_hex": "130", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rax_rcx_04", "family_id": "pf_qword_rax_rcx", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_log+0x0050", "fault_hex": "48 89 08", "fault_len": 3, "disasm": "mov qword ptr [rax], rcx", "regs_summary": "RAX=0x0 RCX=0x14 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d20 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x140 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_log: stage=pre_commit opt_ptr=NULL seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0b95400000048890848c7470840010000c3", "patch_off": 7, "expect_out_hex": "140", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rax_rcx_05", "family_id": "pf_qword_rax_rcx", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_log+0x0060", "fault_hex": "48 89 08", "fault_len": 3, "disasm": "mov qword ptr [rax], rcx", "regs_summary": "RAX=0x0 RCX=0x15 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d28 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x150 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_log: stage=pre_commit opt_ptr=NULL seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0b95500000048890848c7470850010000c3", "patch_off": 7, "expect_out_hex": "150", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rax_rcx_06", "family_id": "pf_qword_rax_rcx", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_log+0x0070", "fault_hex": "48 89 08", "fault_len": 3, "disasm": "mov qword ptr [rax], rcx", "regs_summary": "RAX=0x0 RCX=0x16 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d30 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x160 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_log: stage=pre_commit opt_ptr=NULL seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0b95600000048890848c7470860010000c3", "patch_off": 7, "expect_out_hex": "160", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rax_rcx_07", "family_id": "pf_qword_rax_rcx", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_log+0x0080", "fault_hex": "48 89 08", "fault_len": 3, "disasm": "mov qword ptr [rax], rcx", "regs_summary": "RAX=0x0 RCX=0x17 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d38 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x170 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_log: stage=pre_commit opt_ptr=NULL seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c0b95700000048890848c7470870010000c3", "patch_off": 7, "expect_out_hex": "170", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rcx_00", "family_id": "pf_byte_rcx", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_evt+0x0010", "fault_hex": "c6 01 09", "fault_len": 3, "disasm": "mov byte ptr [rcx], 9", "regs_summary": "RAX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d00 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x100 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_evt: stage=pre_commit opt_ptr=NULL seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031c9c6010948c7470800010000c3", "patch_off": 4, "expect_out_hex": "100", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rcx_01", "family_id": "pf_byte_rcx", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_evt+0x0020", "fault_hex": "c6 01 0a", "fault_len": 3, "disasm": "mov byte ptr [rcx], 0xa", "regs_summary": "RAX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d08 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x110 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_evt: stage=pre_commit opt_ptr=NULL seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031c9c6010a48c7470810010000c3", "patch_off": 4, "expect_out_hex": "110", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rcx_02", "family_id": "pf_byte_rcx", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_evt+0x0030", "fault_hex": "c6 01 0b", "fault_len": 3, "disasm": "mov byte ptr [rcx], 0xb", "regs_summary": "RAX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d10 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x120 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_evt: stage=pre_commit opt_ptr=NULL seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031c9c6010b48c7470820010000c3", "patch_off": 4, "expect_out_hex": "120", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rcx_03", "family_id": "pf_byte_rcx", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_evt+0x0040", "fault_hex": "c6 01 0c", "fault_len": 3, "disasm": "mov byte ptr [rcx], 0xc", "regs_summary": "RAX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d18 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x130 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_evt: stage=pre_commit opt_ptr=NULL seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031c9c6010c48c7470830010000c3", "patch_off": 4, "expect_out_hex": "130", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rcx_04", "family_id": "pf_byte_rcx", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_evt+0x0050", "fault_hex": "c6 01 0d", "fault_len": 3, "disasm": "mov byte ptr [rcx], 0xd", "regs_summary": "RAX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d20 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x140 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_evt: stage=pre_commit opt_ptr=NULL seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031c9c6010d48c7470840010000c3", "patch_off": 4, "expect_out_hex": "140", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rcx_05", "family_id": "pf_byte_rcx", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_evt+0x0060", "fault_hex": "c6 01 0e", "fault_len": 3, "disasm": "mov byte ptr [rcx], 0xe", "regs_summary": "RAX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d28 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x150 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_evt: stage=pre_commit opt_ptr=NULL seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031c9c6010e48c7470850010000c3", "patch_off": 4, "expect_out_hex": "150", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rcx_06", "family_id": "pf_byte_rcx", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_evt+0x0070", "fault_hex": "c6 01 0f", "fault_len": 3, "disasm": "mov byte ptr [rcx], 0xf", "regs_summary": "RAX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d30 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x160 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_evt: stage=pre_commit opt_ptr=NULL seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031c9c6010f48c7470860010000c3", "patch_off": 4, "expect_out_hex": "160", "expect_ret_hex": "0"}
+{"scenario_id": "pf_byte_rcx_07", "family_id": "pf_byte_rcx", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_evt+0x0080", "fault_hex": "c6 01 10", "fault_len": 3, "disasm": "mov byte ptr [rcx], 0x10", "regs_summary": "RAX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013d38 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x170 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_evt: stage=pre_commit opt_ptr=NULL seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031c9c6011048c7470870010000c3", "patch_off": 4, "expect_out_hex": "170", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rsi_rdx_00", "family_id": "pf_qword_rsi_rdx", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_trc+0x0010", "fault_hex": "48 89 16", "fault_len": 3, "disasm": "mov qword ptr [rsi], rdx", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x10 RDI=0xffff888004100000 RSP=0xffffc90000013d00 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x100 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_trc: stage=pre_commit opt_ptr=NULL seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031f6ba6000000048891648c7470800010000c3", "patch_off": 9, "expect_out_hex": "100", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rsi_rdx_01", "family_id": "pf_qword_rsi_rdx", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_trc+0x0020", "fault_hex": "48 89 16", "fault_len": 3, "disasm": "mov qword ptr [rsi], rdx", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x11 RDI=0xffff888004100000 RSP=0xffffc90000013d08 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x110 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_trc: stage=pre_commit opt_ptr=NULL seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031f6ba6100000048891648c7470810010000c3", "patch_off": 9, "expect_out_hex": "110", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rsi_rdx_02", "family_id": "pf_qword_rsi_rdx", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_trc+0x0030", "fault_hex": "48 89 16", "fault_len": 3, "disasm": "mov qword ptr [rsi], rdx", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x12 RDI=0xffff888004100000 RSP=0xffffc90000013d10 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x120 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_trc: stage=pre_commit opt_ptr=NULL seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031f6ba6200000048891648c7470820010000c3", "patch_off": 9, "expect_out_hex": "120", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rsi_rdx_03", "family_id": "pf_qword_rsi_rdx", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_trc+0x0040", "fault_hex": "48 89 16", "fault_len": 3, "disasm": "mov qword ptr [rsi], rdx", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x13 RDI=0xffff888004100000 RSP=0xffffc90000013d18 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x130 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_trc: stage=pre_commit opt_ptr=NULL seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031f6ba6300000048891648c7470830010000c3", "patch_off": 9, "expect_out_hex": "130", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rsi_rdx_04", "family_id": "pf_qword_rsi_rdx", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_trc+0x0050", "fault_hex": "48 89 16", "fault_len": 3, "disasm": "mov qword ptr [rsi], rdx", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x14 RDI=0xffff888004100000 RSP=0xffffc90000013d20 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x140 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_trc: stage=pre_commit opt_ptr=NULL seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031f6ba6400000048891648c7470840010000c3", "patch_off": 9, "expect_out_hex": "140", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rsi_rdx_05", "family_id": "pf_qword_rsi_rdx", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_trc+0x0060", "fault_hex": "48 89 16", "fault_len": 3, "disasm": "mov qword ptr [rsi], rdx", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x15 RDI=0xffff888004100000 RSP=0xffffc90000013d28 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x150 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_trc: stage=pre_commit opt_ptr=NULL seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031f6ba6500000048891648c7470850010000c3", "patch_off": 9, "expect_out_hex": "150", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rsi_rdx_06", "family_id": "pf_qword_rsi_rdx", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_trc+0x0070", "fault_hex": "48 89 16", "fault_len": 3, "disasm": "mov qword ptr [rsi], rdx", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x16 RDI=0xffff888004100000 RSP=0xffffc90000013d30 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x160 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_trc: stage=pre_commit opt_ptr=NULL seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031f6ba6600000048891648c7470860010000c3", "patch_off": 9, "expect_out_hex": "160", "expect_ret_hex": "0"}
+{"scenario_id": "pf_qword_rsi_rdx_07", "family_id": "pf_qword_rsi_rdx", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_trc+0x0080", "fault_hex": "48 89 16", "fault_len": 3, "disasm": "mov qword ptr [rsi], rdx", "regs_summary": "RAX=0x0 RSI=0x0 RDX=0x17 RDI=0xffff888004100000 RSP=0xffffc90000013d38 RFLAGS=0x246", "contract_hint": "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x170 and returns 0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_trc: stage=pre_commit opt_ptr=NULL seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c031f6ba6700000048891648c7470870010000c3", "patch_off": 9, "expect_out_hex": "170", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rbx_d8_00", "family_id": "pf_load_rbx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000008", "rip_sym": "kdrv_cfg+0x0024", "fault_hex": "8b 43 08", "fault_len": 3, "disasm": "mov eax, dword ptr [rbx + 8]", "regs_summary": "RAX=0x55 RBX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c00 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x55, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_cfg: ptr=NULL field_off=0x8 fallback=zero seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "53b85500000031db8b43085b48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rbx_d8_01", "family_id": "pf_load_rbx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x000000000000000c", "rip_sym": "kdrv_cfg+0x0034", "fault_hex": "8b 43 0c", "fault_len": 3, "disasm": "mov eax, dword ptr [rbx + 0xc]", "regs_summary": "RAX=0x66 RBX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c08 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x66, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_cfg: ptr=NULL field_off=0xc fallback=zero seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "53b86600000031db8b430c5b48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rbx_d8_02", "family_id": "pf_load_rbx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000010", "rip_sym": "kdrv_cfg+0x0044", "fault_hex": "8b 43 10", "fault_len": 3, "disasm": "mov eax, dword ptr [rbx + 0x10]", "regs_summary": "RAX=0x77 RBX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c10 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x77, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_cfg: ptr=NULL field_off=0x10 fallback=zero seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "53b87700000031db8b43105b48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rbx_d8_03", "family_id": "pf_load_rbx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000014", "rip_sym": "kdrv_cfg+0x0054", "fault_hex": "8b 43 14", "fault_len": 3, "disasm": "mov eax, dword ptr [rbx + 0x14]", "regs_summary": "RAX=0x88 RBX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c18 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x88, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_cfg: ptr=NULL field_off=0x14 fallback=zero seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "53b88800000031db8b43145b48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rbx_d8_04", "family_id": "pf_load_rbx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000018", "rip_sym": "kdrv_cfg+0x0064", "fault_hex": "8b 43 18", "fault_len": 3, "disasm": "mov eax, dword ptr [rbx + 0x18]", "regs_summary": "RAX=0x99 RBX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c20 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x99, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_cfg: ptr=NULL field_off=0x18 fallback=zero seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "53b89900000031db8b43185b48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rbx_d8_05", "family_id": "pf_load_rbx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x000000000000001c", "rip_sym": "kdrv_cfg+0x0074", "fault_hex": "8b 43 1c", "fault_len": 3, "disasm": "mov eax, dword ptr [rbx + 0x1c]", "regs_summary": "RAX=0xaa RBX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c28 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xaa, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_cfg: ptr=NULL field_off=0x1c fallback=zero seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "53b8aa00000031db8b431c5b48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rbx_d8_06", "family_id": "pf_load_rbx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000020", "rip_sym": "kdrv_cfg+0x0084", "fault_hex": "8b 43 20", "fault_len": 3, "disasm": "mov eax, dword ptr [rbx + 0x20]", "regs_summary": "RAX=0xbb RBX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c30 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xbb, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_cfg: ptr=NULL field_off=0x20 fallback=zero seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "53b8bb00000031db8b43205b48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rbx_d8_07", "family_id": "pf_load_rbx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000024", "rip_sym": "kdrv_cfg+0x0094", "fault_hex": "8b 43 24", "fault_len": 3, "disasm": "mov eax, dword ptr [rbx + 0x24]", "regs_summary": "RAX=0xcc RBX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c38 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xcc, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_cfg: ptr=NULL field_off=0x24 fallback=zero seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "53b8cc00000031db8b43245b48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rcx_d8_00", "family_id": "pf_load_rcx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000010", "rip_sym": "kdrv_opt+0x0024", "fault_hex": "8b 41 10", "fault_len": 3, "disasm": "mov eax, dword ptr [rcx + 0x10]", "regs_summary": "RAX=0x55 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c00 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x55, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_opt: ptr=NULL field_off=0x10 fallback=zero seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b85500000031c98b411048894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rcx_d8_01", "family_id": "pf_load_rcx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000014", "rip_sym": "kdrv_opt+0x0034", "fault_hex": "8b 41 14", "fault_len": 3, "disasm": "mov eax, dword ptr [rcx + 0x14]", "regs_summary": "RAX=0x66 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c08 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x66, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_opt: ptr=NULL field_off=0x14 fallback=zero seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b86600000031c98b411448894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rcx_d8_02", "family_id": "pf_load_rcx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000018", "rip_sym": "kdrv_opt+0x0044", "fault_hex": "8b 41 18", "fault_len": 3, "disasm": "mov eax, dword ptr [rcx + 0x18]", "regs_summary": "RAX=0x77 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c10 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x77, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_opt: ptr=NULL field_off=0x18 fallback=zero seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b87700000031c98b411848894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rcx_d8_03", "family_id": "pf_load_rcx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x000000000000001c", "rip_sym": "kdrv_opt+0x0054", "fault_hex": "8b 41 1c", "fault_len": 3, "disasm": "mov eax, dword ptr [rcx + 0x1c]", "regs_summary": "RAX=0x88 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c18 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x88, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_opt: ptr=NULL field_off=0x1c fallback=zero seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b88800000031c98b411c48894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rcx_d8_04", "family_id": "pf_load_rcx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000020", "rip_sym": "kdrv_opt+0x0064", "fault_hex": "8b 41 20", "fault_len": 3, "disasm": "mov eax, dword ptr [rcx + 0x20]", "regs_summary": "RAX=0x99 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c20 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x99, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_opt: ptr=NULL field_off=0x20 fallback=zero seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b89900000031c98b412048894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rcx_d8_05", "family_id": "pf_load_rcx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000024", "rip_sym": "kdrv_opt+0x0074", "fault_hex": "8b 41 24", "fault_len": 3, "disasm": "mov eax, dword ptr [rcx + 0x24]", "regs_summary": "RAX=0xaa RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c28 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xaa, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_opt: ptr=NULL field_off=0x24 fallback=zero seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8aa00000031c98b412448894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rcx_d8_06", "family_id": "pf_load_rcx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000028", "rip_sym": "kdrv_opt+0x0084", "fault_hex": "8b 41 28", "fault_len": 3, "disasm": "mov eax, dword ptr [rcx + 0x28]", "regs_summary": "RAX=0xbb RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c30 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xbb, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_opt: ptr=NULL field_off=0x28 fallback=zero seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8bb00000031c98b412848894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rcx_d8_07", "family_id": "pf_load_rcx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x000000000000002c", "rip_sym": "kdrv_opt+0x0094", "fault_hex": "8b 41 2c", "fault_len": 3, "disasm": "mov eax, dword ptr [rcx + 0x2c]", "regs_summary": "RAX=0xcc RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c38 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xcc, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_opt: ptr=NULL field_off=0x2c fallback=zero seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8cc00000031c98b412c48894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rdx_d8_00", "family_id": "pf_load_rdx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000014", "rip_sym": "kdrv_env+0x0024", "fault_hex": "8b 42 14", "fault_len": 3, "disasm": "mov eax, dword ptr [rdx + 0x14]", "regs_summary": "RAX=0x55 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c00 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x55, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_env: ptr=NULL field_off=0x14 fallback=zero seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b85500000031d28b421448894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rdx_d8_01", "family_id": "pf_load_rdx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000018", "rip_sym": "kdrv_env+0x0034", "fault_hex": "8b 42 18", "fault_len": 3, "disasm": "mov eax, dword ptr [rdx + 0x18]", "regs_summary": "RAX=0x66 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c08 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x66, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_env: ptr=NULL field_off=0x18 fallback=zero seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b86600000031d28b421848894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rdx_d8_02", "family_id": "pf_load_rdx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x000000000000001c", "rip_sym": "kdrv_env+0x0044", "fault_hex": "8b 42 1c", "fault_len": 3, "disasm": "mov eax, dword ptr [rdx + 0x1c]", "regs_summary": "RAX=0x77 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c10 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x77, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_env: ptr=NULL field_off=0x1c fallback=zero seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b87700000031d28b421c48894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rdx_d8_03", "family_id": "pf_load_rdx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000020", "rip_sym": "kdrv_env+0x0054", "fault_hex": "8b 42 20", "fault_len": 3, "disasm": "mov eax, dword ptr [rdx + 0x20]", "regs_summary": "RAX=0x88 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c18 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x88, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_env: ptr=NULL field_off=0x20 fallback=zero seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b88800000031d28b422048894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rdx_d8_04", "family_id": "pf_load_rdx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000024", "rip_sym": "kdrv_env+0x0064", "fault_hex": "8b 42 24", "fault_len": 3, "disasm": "mov eax, dword ptr [rdx + 0x24]", "regs_summary": "RAX=0x99 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c20 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x99, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_env: ptr=NULL field_off=0x24 fallback=zero seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b89900000031d28b422448894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rdx_d8_05", "family_id": "pf_load_rdx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000028", "rip_sym": "kdrv_env+0x0074", "fault_hex": "8b 42 28", "fault_len": 3, "disasm": "mov eax, dword ptr [rdx + 0x28]", "regs_summary": "RAX=0xaa RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c28 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xaa, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_env: ptr=NULL field_off=0x28 fallback=zero seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8aa00000031d28b422848894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rdx_d8_06", "family_id": "pf_load_rdx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x000000000000002c", "rip_sym": "kdrv_env+0x0084", "fault_hex": "8b 42 2c", "fault_len": 3, "disasm": "mov eax, dword ptr [rdx + 0x2c]", "regs_summary": "RAX=0xbb RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c30 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xbb, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_env: ptr=NULL field_off=0x2c fallback=zero seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8bb00000031d28b422c48894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rdx_d8_07", "family_id": "pf_load_rdx_d8", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000030", "rip_sym": "kdrv_env+0x0094", "fault_hex": "8b 42 30", "fault_len": 3, "disasm": "mov eax, dword ptr [rdx + 0x30]", "regs_summary": "RAX=0xcc RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c38 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xcc, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_env: ptr=NULL field_off=0x30 fallback=zero seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8cc00000031d28b423048894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rcx_0_00", "family_id": "pf_load_rcx_0", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_val+0x0024", "fault_hex": "8b 01", "fault_len": 2, "disasm": "mov eax, dword ptr [rcx]", "regs_summary": "RAX=0x55 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c00 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x55, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_val: ptr=NULL field_off=0x0 fallback=zero seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b85500000031c98b0148894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rcx_0_01", "family_id": "pf_load_rcx_0", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_val+0x0034", "fault_hex": "8b 01", "fault_len": 2, "disasm": "mov eax, dword ptr [rcx]", "regs_summary": "RAX=0x66 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c08 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x66, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_val: ptr=NULL field_off=0x0 fallback=zero seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b86600000031c98b0148894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rcx_0_02", "family_id": "pf_load_rcx_0", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_val+0x0044", "fault_hex": "8b 01", "fault_len": 2, "disasm": "mov eax, dword ptr [rcx]", "regs_summary": "RAX=0x77 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c10 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x77, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_val: ptr=NULL field_off=0x0 fallback=zero seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b87700000031c98b0148894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rcx_0_03", "family_id": "pf_load_rcx_0", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_val+0x0054", "fault_hex": "8b 01", "fault_len": 2, "disasm": "mov eax, dword ptr [rcx]", "regs_summary": "RAX=0x88 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c18 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x88, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_val: ptr=NULL field_off=0x0 fallback=zero seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b88800000031c98b0148894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rcx_0_04", "family_id": "pf_load_rcx_0", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_val+0x0064", "fault_hex": "8b 01", "fault_len": 2, "disasm": "mov eax, dword ptr [rcx]", "regs_summary": "RAX=0x99 RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c20 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x99, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_val: ptr=NULL field_off=0x0 fallback=zero seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b89900000031c98b0148894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rcx_0_05", "family_id": "pf_load_rcx_0", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_val+0x0074", "fault_hex": "8b 01", "fault_len": 2, "disasm": "mov eax, dword ptr [rcx]", "regs_summary": "RAX=0xaa RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c28 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xaa, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_val: ptr=NULL field_off=0x0 fallback=zero seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8aa00000031c98b0148894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rcx_0_06", "family_id": "pf_load_rcx_0", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_val+0x0084", "fault_hex": "8b 01", "fault_len": 2, "disasm": "mov eax, dword ptr [rcx]", "regs_summary": "RAX=0xbb RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c30 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xbb, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_val: ptr=NULL field_off=0x0 fallback=zero seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8bb00000031c98b0148894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rcx_0_07", "family_id": "pf_load_rcx_0", "category": "pf_patchable", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_val+0x0094", "fault_hex": "8b 01", "fault_len": 2, "disasm": "mov eax, dword ptr [rcx]", "regs_summary": "RAX=0xcc RCX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c38 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xcc, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_val: ptr=NULL field_off=0x0 fallback=zero seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8cc00000031c98b0148894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load64_rbx_d8_00", "family_id": "pf_load64_rbx_d8", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000008", "rip_sym": "kdrv_tbl+0x0024", "fault_hex": "48 8b 43 08", "fault_len": 4, "disasm": "mov rax, qword ptr [rbx + 8]", "regs_summary": "RAX=0x55 RBX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c00 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x55, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tbl: ptr=NULL field_off=0x8 fallback=zero seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0 90", "kvm_mode": "exec", "stub_hex": "53b85500000031db488b43085b48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load64_rbx_d8_01", "family_id": "pf_load64_rbx_d8", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x000000000000000c", "rip_sym": "kdrv_tbl+0x0034", "fault_hex": "48 8b 43 0c", "fault_len": 4, "disasm": "mov rax, qword ptr [rbx + 0xc]", "regs_summary": "RAX=0x66 RBX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c08 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x66, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tbl: ptr=NULL field_off=0xc fallback=zero seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0 90", "kvm_mode": "exec", "stub_hex": "53b86600000031db488b430c5b48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load64_rbx_d8_02", "family_id": "pf_load64_rbx_d8", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000010", "rip_sym": "kdrv_tbl+0x0044", "fault_hex": "48 8b 43 10", "fault_len": 4, "disasm": "mov rax, qword ptr [rbx + 0x10]", "regs_summary": "RAX=0x77 RBX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c10 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x77, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tbl: ptr=NULL field_off=0x10 fallback=zero seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0 90", "kvm_mode": "exec", "stub_hex": "53b87700000031db488b43105b48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load64_rbx_d8_03", "family_id": "pf_load64_rbx_d8", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000014", "rip_sym": "kdrv_tbl+0x0054", "fault_hex": "48 8b 43 14", "fault_len": 4, "disasm": "mov rax, qword ptr [rbx + 0x14]", "regs_summary": "RAX=0x88 RBX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c18 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x88, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tbl: ptr=NULL field_off=0x14 fallback=zero seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0 90", "kvm_mode": "exec", "stub_hex": "53b88800000031db488b43145b48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load64_rbx_d8_04", "family_id": "pf_load64_rbx_d8", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000018", "rip_sym": "kdrv_tbl+0x0064", "fault_hex": "48 8b 43 18", "fault_len": 4, "disasm": "mov rax, qword ptr [rbx + 0x18]", "regs_summary": "RAX=0x99 RBX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c20 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x99, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tbl: ptr=NULL field_off=0x18 fallback=zero seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0 90", "kvm_mode": "exec", "stub_hex": "53b89900000031db488b43185b48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load64_rbx_d8_05", "family_id": "pf_load64_rbx_d8", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x000000000000001c", "rip_sym": "kdrv_tbl+0x0074", "fault_hex": "48 8b 43 1c", "fault_len": 4, "disasm": "mov rax, qword ptr [rbx + 0x1c]", "regs_summary": "RAX=0xaa RBX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c28 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xaa, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tbl: ptr=NULL field_off=0x1c fallback=zero seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0 90", "kvm_mode": "exec", "stub_hex": "53b8aa00000031db488b431c5b48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load64_rbx_d8_06", "family_id": "pf_load64_rbx_d8", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000020", "rip_sym": "kdrv_tbl+0x0084", "fault_hex": "48 8b 43 20", "fault_len": 4, "disasm": "mov rax, qword ptr [rbx + 0x20]", "regs_summary": "RAX=0xbb RBX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c30 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xbb, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tbl: ptr=NULL field_off=0x20 fallback=zero seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0 90", "kvm_mode": "exec", "stub_hex": "53b8bb00000031db488b43205b48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load64_rbx_d8_07", "family_id": "pf_load64_rbx_d8", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000024", "rip_sym": "kdrv_tbl+0x0094", "fault_hex": "48 8b 43 24", "fault_len": 4, "disasm": "mov rax, qword ptr [rbx + 0x24]", "regs_summary": "RAX=0xcc RBX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c38 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xcc, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tbl: ptr=NULL field_off=0x24 fallback=zero seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0 90", "kvm_mode": "exec", "stub_hex": "53b8cc00000031db488b43245b48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rdx_0_00", "family_id": "pf_load_rdx_0", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ref+0x0024", "fault_hex": "8b 02", "fault_len": 2, "disasm": "mov eax, dword ptr [rdx]", "regs_summary": "RAX=0x55 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c00 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x55, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ref: ptr=NULL field_off=0x0 fallback=zero seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b85500000031d28b0248894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rdx_0_01", "family_id": "pf_load_rdx_0", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ref+0x0034", "fault_hex": "8b 02", "fault_len": 2, "disasm": "mov eax, dword ptr [rdx]", "regs_summary": "RAX=0x66 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c08 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x66, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ref: ptr=NULL field_off=0x0 fallback=zero seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b86600000031d28b0248894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rdx_0_02", "family_id": "pf_load_rdx_0", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ref+0x0044", "fault_hex": "8b 02", "fault_len": 2, "disasm": "mov eax, dword ptr [rdx]", "regs_summary": "RAX=0x77 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c10 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x77, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ref: ptr=NULL field_off=0x0 fallback=zero seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b87700000031d28b0248894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rdx_0_03", "family_id": "pf_load_rdx_0", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ref+0x0054", "fault_hex": "8b 02", "fault_len": 2, "disasm": "mov eax, dword ptr [rdx]", "regs_summary": "RAX=0x88 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c18 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x88, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ref: ptr=NULL field_off=0x0 fallback=zero seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b88800000031d28b0248894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rdx_0_04", "family_id": "pf_load_rdx_0", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ref+0x0064", "fault_hex": "8b 02", "fault_len": 2, "disasm": "mov eax, dword ptr [rdx]", "regs_summary": "RAX=0x99 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c20 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x99, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ref: ptr=NULL field_off=0x0 fallback=zero seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b89900000031d28b0248894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rdx_0_05", "family_id": "pf_load_rdx_0", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ref+0x0074", "fault_hex": "8b 02", "fault_len": 2, "disasm": "mov eax, dword ptr [rdx]", "regs_summary": "RAX=0xaa RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c28 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xaa, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ref: ptr=NULL field_off=0x0 fallback=zero seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8aa00000031d28b0248894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rdx_0_06", "family_id": "pf_load_rdx_0", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ref+0x0084", "fault_hex": "8b 02", "fault_len": 2, "disasm": "mov eax, dword ptr [rdx]", "regs_summary": "RAX=0xbb RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c30 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xbb, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ref: ptr=NULL field_off=0x0 fallback=zero seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8bb00000031d28b0248894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rdx_0_07", "family_id": "pf_load_rdx_0", "category": "pf_patchable", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ref+0x0094", "fault_hex": "8b 02", "fault_len": 2, "disasm": "mov eax, dword ptr [rdx]", "regs_summary": "RAX=0xcc RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c38 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xcc, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ref: ptr=NULL field_off=0x0 fallback=zero seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8cc00000031d28b0248894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rsi_d8_00", "family_id": "pf_load_rsi_d8", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000008", "rip_sym": "kdrv_hdr+0x0024", "fault_hex": "8b 46 08", "fault_len": 3, "disasm": "mov eax, dword ptr [rsi + 8]", "regs_summary": "RAX=0x55 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c00 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x55, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hdr: ptr=NULL field_off=0x8 fallback=zero seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b85500000031f68b460848894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rsi_d8_01", "family_id": "pf_load_rsi_d8", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x000000000000000c", "rip_sym": "kdrv_hdr+0x0034", "fault_hex": "8b 46 0c", "fault_len": 3, "disasm": "mov eax, dword ptr [rsi + 0xc]", "regs_summary": "RAX=0x66 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c08 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x66, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hdr: ptr=NULL field_off=0xc fallback=zero seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b86600000031f68b460c48894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rsi_d8_02", "family_id": "pf_load_rsi_d8", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000010", "rip_sym": "kdrv_hdr+0x0044", "fault_hex": "8b 46 10", "fault_len": 3, "disasm": "mov eax, dword ptr [rsi + 0x10]", "regs_summary": "RAX=0x77 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c10 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x77, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hdr: ptr=NULL field_off=0x10 fallback=zero seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b87700000031f68b461048894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rsi_d8_03", "family_id": "pf_load_rsi_d8", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000014", "rip_sym": "kdrv_hdr+0x0054", "fault_hex": "8b 46 14", "fault_len": 3, "disasm": "mov eax, dword ptr [rsi + 0x14]", "regs_summary": "RAX=0x88 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c18 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x88, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hdr: ptr=NULL field_off=0x14 fallback=zero seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b88800000031f68b461448894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rsi_d8_04", "family_id": "pf_load_rsi_d8", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000018", "rip_sym": "kdrv_hdr+0x0064", "fault_hex": "8b 46 18", "fault_len": 3, "disasm": "mov eax, dword ptr [rsi + 0x18]", "regs_summary": "RAX=0x99 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c20 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x99, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hdr: ptr=NULL field_off=0x18 fallback=zero seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b89900000031f68b461848894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rsi_d8_05", "family_id": "pf_load_rsi_d8", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x000000000000001c", "rip_sym": "kdrv_hdr+0x0074", "fault_hex": "8b 46 1c", "fault_len": 3, "disasm": "mov eax, dword ptr [rsi + 0x1c]", "regs_summary": "RAX=0xaa RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c28 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xaa, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hdr: ptr=NULL field_off=0x1c fallback=zero seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8aa00000031f68b461c48894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rsi_d8_06", "family_id": "pf_load_rsi_d8", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000020", "rip_sym": "kdrv_hdr+0x0084", "fault_hex": "8b 46 20", "fault_len": 3, "disasm": "mov eax, dword ptr [rsi + 0x20]", "regs_summary": "RAX=0xbb RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c30 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xbb, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hdr: ptr=NULL field_off=0x20 fallback=zero seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8bb00000031f68b462048894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load_rsi_d8_07", "family_id": "pf_load_rsi_d8", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000024", "rip_sym": "kdrv_hdr+0x0094", "fault_hex": "8b 46 24", "fault_len": 3, "disasm": "mov eax, dword ptr [rsi + 0x24]", "regs_summary": "RAX=0xcc RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c38 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xcc, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hdr: ptr=NULL field_off=0x24 fallback=zero seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8cc00000031f68b462448894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load64_rsi_d8_00", "family_id": "pf_load64_rsi_d8", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000010", "rip_sym": "kdrv_ctx+0x0024", "fault_hex": "48 8b 46 10", "fault_len": 4, "disasm": "mov rax, qword ptr [rsi + 0x10]", "regs_summary": "RAX=0x55 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c00 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x55, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ctx: ptr=NULL field_off=0x10 fallback=zero seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0 90", "kvm_mode": "exec", "stub_hex": "b85500000031f6488b461048894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load64_rsi_d8_01", "family_id": "pf_load64_rsi_d8", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000014", "rip_sym": "kdrv_ctx+0x0034", "fault_hex": "48 8b 46 14", "fault_len": 4, "disasm": "mov rax, qword ptr [rsi + 0x14]", "regs_summary": "RAX=0x66 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c08 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x66, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ctx: ptr=NULL field_off=0x14 fallback=zero seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0 90", "kvm_mode": "exec", "stub_hex": "b86600000031f6488b461448894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load64_rsi_d8_02", "family_id": "pf_load64_rsi_d8", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000018", "rip_sym": "kdrv_ctx+0x0044", "fault_hex": "48 8b 46 18", "fault_len": 4, "disasm": "mov rax, qword ptr [rsi + 0x18]", "regs_summary": "RAX=0x77 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c10 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x77, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ctx: ptr=NULL field_off=0x18 fallback=zero seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0 90", "kvm_mode": "exec", "stub_hex": "b87700000031f6488b461848894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load64_rsi_d8_03", "family_id": "pf_load64_rsi_d8", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x000000000000001c", "rip_sym": "kdrv_ctx+0x0054", "fault_hex": "48 8b 46 1c", "fault_len": 4, "disasm": "mov rax, qword ptr [rsi + 0x1c]", "regs_summary": "RAX=0x88 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c18 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x88, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ctx: ptr=NULL field_off=0x1c fallback=zero seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0 90", "kvm_mode": "exec", "stub_hex": "b88800000031f6488b461c48894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load64_rsi_d8_04", "family_id": "pf_load64_rsi_d8", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000020", "rip_sym": "kdrv_ctx+0x0064", "fault_hex": "48 8b 46 20", "fault_len": 4, "disasm": "mov rax, qword ptr [rsi + 0x20]", "regs_summary": "RAX=0x99 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c20 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x99, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ctx: ptr=NULL field_off=0x20 fallback=zero seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0 90", "kvm_mode": "exec", "stub_hex": "b89900000031f6488b462048894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load64_rsi_d8_05", "family_id": "pf_load64_rsi_d8", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000024", "rip_sym": "kdrv_ctx+0x0074", "fault_hex": "48 8b 46 24", "fault_len": 4, "disasm": "mov rax, qword ptr [rsi + 0x24]", "regs_summary": "RAX=0xaa RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c28 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xaa, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ctx: ptr=NULL field_off=0x24 fallback=zero seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0 90", "kvm_mode": "exec", "stub_hex": "b8aa00000031f6488b462448894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load64_rsi_d8_06", "family_id": "pf_load64_rsi_d8", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000028", "rip_sym": "kdrv_ctx+0x0084", "fault_hex": "48 8b 46 28", "fault_len": 4, "disasm": "mov rax, qword ptr [rsi + 0x28]", "regs_summary": "RAX=0xbb RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c30 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xbb, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ctx: ptr=NULL field_off=0x28 fallback=zero seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0 90", "kvm_mode": "exec", "stub_hex": "b8bb00000031f6488b462848894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "pf_load64_rsi_d8_07", "family_id": "pf_load64_rsi_d8", "category": "pf_patchable", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x000000000000002c", "rip_sym": "kdrv_ctx+0x0094", "fault_hex": "48 8b 46 2c", "fault_len": 4, "disasm": "mov rax, qword ptr [rsi + 0x2c]", "regs_summary": "RAX=0xcc RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c38 RFLAGS=0x246", "contract_hint": "Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0xcc, safe fallback requires RAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ctx: ptr=NULL field_off=0x2c fallback=zero seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0 90", "kvm_mode": "exec", "stub_hex": "b8cc00000031f6488b462c48894708c3", "patch_off": 7, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ecx_00", "family_id": "de_div_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_rate+0x0018", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x2a RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b00 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x2a, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_rate: denom=0 fallback_quotient=0 sample=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b82a00000031d231c9f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ecx_01", "family_id": "de_div_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_rate+0x0028", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x43 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b08 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x43, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_rate: denom=0 fallback_quotient=0 sample=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b84300000031d231c9f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ecx_02", "family_id": "de_div_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_rate+0x0038", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x5c RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b10 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x5c, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_rate: denom=0 fallback_quotient=0 sample=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b85c00000031d231c9f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ecx_03", "family_id": "de_div_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_rate+0x0048", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x75 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b18 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x75, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_rate: denom=0 fallback_quotient=0 sample=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b87500000031d231c9f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ecx_04", "family_id": "de_div_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_rate+0x0058", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x8e RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b20 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x8e, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_rate: denom=0 fallback_quotient=0 sample=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b88e00000031d231c9f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ecx_05", "family_id": "de_div_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_rate+0x0068", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0xa7 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b28 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xa7, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_rate: denom=0 fallback_quotient=0 sample=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8a700000031d231c9f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ecx_06", "family_id": "de_div_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_rate+0x0078", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0xc0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b30 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xc0, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_rate: denom=0 fallback_quotient=0 sample=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8c000000031d231c9f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ecx_07", "family_id": "de_div_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_rate+0x0088", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0xd9 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b38 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xd9, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_rate: denom=0 fallback_quotient=0 sample=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8d900000031d231c9f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ecx_08", "family_id": "de_div_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_rate+0x0098", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0xf2 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b40 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xf2, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_rate: denom=0 fallback_quotient=0 sample=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8f200000031d231c9f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ecx_09", "family_id": "de_div_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_rate+0x00a8", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x10b RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b48 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x10b, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_rate: denom=0 fallback_quotient=0 sample=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b80b01000031d231c9f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ecx_00", "family_id": "de_idiv_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_srate+0x0018", "fault_hex": "f7 f9", "fault_len": 2, "disasm": "idiv ecx", "regs_summary": "RAX=0x2a RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b00 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x2a, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_srate: denom=0 fallback_quotient=0 sample=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b82a0000009931c9f7f948894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ecx_01", "family_id": "de_idiv_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_srate+0x0028", "fault_hex": "f7 f9", "fault_len": 2, "disasm": "idiv ecx", "regs_summary": "RAX=0x43 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b08 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x43, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_srate: denom=0 fallback_quotient=0 sample=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8430000009931c9f7f948894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ecx_02", "family_id": "de_idiv_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_srate+0x0038", "fault_hex": "f7 f9", "fault_len": 2, "disasm": "idiv ecx", "regs_summary": "RAX=0x5c RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b10 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x5c, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_srate: denom=0 fallback_quotient=0 sample=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b85c0000009931c9f7f948894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ecx_03", "family_id": "de_idiv_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_srate+0x0048", "fault_hex": "f7 f9", "fault_len": 2, "disasm": "idiv ecx", "regs_summary": "RAX=0x75 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b18 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x75, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_srate: denom=0 fallback_quotient=0 sample=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8750000009931c9f7f948894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ecx_04", "family_id": "de_idiv_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_srate+0x0058", "fault_hex": "f7 f9", "fault_len": 2, "disasm": "idiv ecx", "regs_summary": "RAX=0x8e RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b20 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x8e, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_srate: denom=0 fallback_quotient=0 sample=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b88e0000009931c9f7f948894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ecx_05", "family_id": "de_idiv_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_srate+0x0068", "fault_hex": "f7 f9", "fault_len": 2, "disasm": "idiv ecx", "regs_summary": "RAX=0xa7 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b28 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xa7, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_srate: denom=0 fallback_quotient=0 sample=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8a70000009931c9f7f948894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ecx_06", "family_id": "de_idiv_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_srate+0x0078", "fault_hex": "f7 f9", "fault_len": 2, "disasm": "idiv ecx", "regs_summary": "RAX=0xc0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b30 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xc0, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_srate: denom=0 fallback_quotient=0 sample=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8c00000009931c9f7f948894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ecx_07", "family_id": "de_idiv_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_srate+0x0088", "fault_hex": "f7 f9", "fault_len": 2, "disasm": "idiv ecx", "regs_summary": "RAX=0xd9 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b38 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xd9, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_srate: denom=0 fallback_quotient=0 sample=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8d90000009931c9f7f948894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ecx_08", "family_id": "de_idiv_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_srate+0x0098", "fault_hex": "f7 f9", "fault_len": 2, "disasm": "idiv ecx", "regs_summary": "RAX=0xf2 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b40 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xf2, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_srate: denom=0 fallback_quotient=0 sample=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8f20000009931c9f7f948894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ecx_09", "family_id": "de_idiv_ecx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_srate+0x00a8", "fault_hex": "f7 f9", "fault_len": 2, "disasm": "idiv ecx", "regs_summary": "RAX=0x10b RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b48 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x10b, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_srate: denom=0 fallback_quotient=0 sample=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b80b0100009931c9f7f948894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_esi_00", "family_id": "de_div_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_avg+0x0018", "fault_hex": "f7 f6", "fault_len": 2, "disasm": "div esi", "regs_summary": "RAX=0x2a RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b00 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x2a, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_avg: denom=0 fallback_quotient=0 sample=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b82a00000031d231f6f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_esi_01", "family_id": "de_div_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_avg+0x0028", "fault_hex": "f7 f6", "fault_len": 2, "disasm": "div esi", "regs_summary": "RAX=0x43 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b08 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x43, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_avg: denom=0 fallback_quotient=0 sample=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b84300000031d231f6f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_esi_02", "family_id": "de_div_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_avg+0x0038", "fault_hex": "f7 f6", "fault_len": 2, "disasm": "div esi", "regs_summary": "RAX=0x5c RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b10 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x5c, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_avg: denom=0 fallback_quotient=0 sample=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b85c00000031d231f6f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_esi_03", "family_id": "de_div_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_avg+0x0048", "fault_hex": "f7 f6", "fault_len": 2, "disasm": "div esi", "regs_summary": "RAX=0x75 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b18 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x75, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_avg: denom=0 fallback_quotient=0 sample=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b87500000031d231f6f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_esi_04", "family_id": "de_div_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_avg+0x0058", "fault_hex": "f7 f6", "fault_len": 2, "disasm": "div esi", "regs_summary": "RAX=0x8e RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b20 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x8e, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_avg: denom=0 fallback_quotient=0 sample=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b88e00000031d231f6f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_esi_05", "family_id": "de_div_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_avg+0x0068", "fault_hex": "f7 f6", "fault_len": 2, "disasm": "div esi", "regs_summary": "RAX=0xa7 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b28 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xa7, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_avg: denom=0 fallback_quotient=0 sample=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8a700000031d231f6f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_esi_06", "family_id": "de_div_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_avg+0x0078", "fault_hex": "f7 f6", "fault_len": 2, "disasm": "div esi", "regs_summary": "RAX=0xc0 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b30 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xc0, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_avg: denom=0 fallback_quotient=0 sample=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8c000000031d231f6f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_esi_07", "family_id": "de_div_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_avg+0x0088", "fault_hex": "f7 f6", "fault_len": 2, "disasm": "div esi", "regs_summary": "RAX=0xd9 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b38 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xd9, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_avg: denom=0 fallback_quotient=0 sample=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8d900000031d231f6f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_esi_08", "family_id": "de_div_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_avg+0x0098", "fault_hex": "f7 f6", "fault_len": 2, "disasm": "div esi", "regs_summary": "RAX=0xf2 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b40 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xf2, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_avg: denom=0 fallback_quotient=0 sample=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8f200000031d231f6f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_esi_09", "family_id": "de_div_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_avg+0x00a8", "fault_hex": "f7 f6", "fault_len": 2, "disasm": "div esi", "regs_summary": "RAX=0x10b RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b48 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x10b, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_avg: denom=0 fallback_quotient=0 sample=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b80b01000031d231f6f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_esi_00", "family_id": "de_idiv_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_savg+0x0018", "fault_hex": "f7 fe", "fault_len": 2, "disasm": "idiv esi", "regs_summary": "RAX=0x2a RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b00 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x2a, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_savg: denom=0 fallback_quotient=0 sample=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b82a0000009931f6f7fe48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_esi_01", "family_id": "de_idiv_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_savg+0x0028", "fault_hex": "f7 fe", "fault_len": 2, "disasm": "idiv esi", "regs_summary": "RAX=0x43 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b08 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x43, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_savg: denom=0 fallback_quotient=0 sample=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8430000009931f6f7fe48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_esi_02", "family_id": "de_idiv_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_savg+0x0038", "fault_hex": "f7 fe", "fault_len": 2, "disasm": "idiv esi", "regs_summary": "RAX=0x5c RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b10 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x5c, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_savg: denom=0 fallback_quotient=0 sample=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b85c0000009931f6f7fe48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_esi_03", "family_id": "de_idiv_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_savg+0x0048", "fault_hex": "f7 fe", "fault_len": 2, "disasm": "idiv esi", "regs_summary": "RAX=0x75 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b18 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x75, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_savg: denom=0 fallback_quotient=0 sample=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8750000009931f6f7fe48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_esi_04", "family_id": "de_idiv_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_savg+0x0058", "fault_hex": "f7 fe", "fault_len": 2, "disasm": "idiv esi", "regs_summary": "RAX=0x8e RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b20 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x8e, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_savg: denom=0 fallback_quotient=0 sample=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b88e0000009931f6f7fe48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_esi_05", "family_id": "de_idiv_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_savg+0x0068", "fault_hex": "f7 fe", "fault_len": 2, "disasm": "idiv esi", "regs_summary": "RAX=0xa7 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b28 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xa7, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_savg: denom=0 fallback_quotient=0 sample=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8a70000009931f6f7fe48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_esi_06", "family_id": "de_idiv_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_savg+0x0078", "fault_hex": "f7 fe", "fault_len": 2, "disasm": "idiv esi", "regs_summary": "RAX=0xc0 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b30 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xc0, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_savg: denom=0 fallback_quotient=0 sample=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8c00000009931f6f7fe48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_esi_07", "family_id": "de_idiv_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_savg+0x0088", "fault_hex": "f7 fe", "fault_len": 2, "disasm": "idiv esi", "regs_summary": "RAX=0xd9 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b38 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xd9, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_savg: denom=0 fallback_quotient=0 sample=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8d90000009931f6f7fe48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_esi_08", "family_id": "de_idiv_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_savg+0x0098", "fault_hex": "f7 fe", "fault_len": 2, "disasm": "idiv esi", "regs_summary": "RAX=0xf2 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b40 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xf2, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_savg: denom=0 fallback_quotient=0 sample=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8f20000009931f6f7fe48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_esi_09", "family_id": "de_idiv_esi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_savg+0x00a8", "fault_hex": "f7 fe", "fault_len": 2, "disasm": "idiv esi", "regs_summary": "RAX=0x10b RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b48 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x10b, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_savg: denom=0 fallback_quotient=0 sample=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b80b0100009931f6f7fe48894708c3", "patch_off": 8, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ebx_00", "family_id": "de_div_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_scale+0x0018", "fault_hex": "f7 f3", "fault_len": 2, "disasm": "div ebx", "regs_summary": "RAX=0x2a RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b00 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x2a, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_scale: denom=0 fallback_quotient=0 sample=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b82a00000031d231dbf7f35b48894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ebx_01", "family_id": "de_div_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_scale+0x0028", "fault_hex": "f7 f3", "fault_len": 2, "disasm": "div ebx", "regs_summary": "RAX=0x43 RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b08 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x43, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_scale: denom=0 fallback_quotient=0 sample=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b84300000031d231dbf7f35b48894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ebx_02", "family_id": "de_div_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_scale+0x0038", "fault_hex": "f7 f3", "fault_len": 2, "disasm": "div ebx", "regs_summary": "RAX=0x5c RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b10 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x5c, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_scale: denom=0 fallback_quotient=0 sample=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b85c00000031d231dbf7f35b48894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ebx_03", "family_id": "de_div_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_scale+0x0048", "fault_hex": "f7 f3", "fault_len": 2, "disasm": "div ebx", "regs_summary": "RAX=0x75 RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b18 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x75, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_scale: denom=0 fallback_quotient=0 sample=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b87500000031d231dbf7f35b48894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ebx_04", "family_id": "de_div_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_scale+0x0058", "fault_hex": "f7 f3", "fault_len": 2, "disasm": "div ebx", "regs_summary": "RAX=0x8e RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b20 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x8e, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_scale: denom=0 fallback_quotient=0 sample=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b88e00000031d231dbf7f35b48894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ebx_05", "family_id": "de_div_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_scale+0x0068", "fault_hex": "f7 f3", "fault_len": 2, "disasm": "div ebx", "regs_summary": "RAX=0xa7 RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b28 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xa7, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_scale: denom=0 fallback_quotient=0 sample=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b8a700000031d231dbf7f35b48894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ebx_06", "family_id": "de_div_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_scale+0x0078", "fault_hex": "f7 f3", "fault_len": 2, "disasm": "div ebx", "regs_summary": "RAX=0xc0 RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b30 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xc0, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_scale: denom=0 fallback_quotient=0 sample=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b8c000000031d231dbf7f35b48894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ebx_07", "family_id": "de_div_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_scale+0x0088", "fault_hex": "f7 f3", "fault_len": 2, "disasm": "div ebx", "regs_summary": "RAX=0xd9 RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b38 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xd9, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_scale: denom=0 fallback_quotient=0 sample=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b8d900000031d231dbf7f35b48894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ebx_08", "family_id": "de_div_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_scale+0x0098", "fault_hex": "f7 f3", "fault_len": 2, "disasm": "div ebx", "regs_summary": "RAX=0xf2 RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b40 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xf2, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_scale: denom=0 fallback_quotient=0 sample=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b8f200000031d231dbf7f35b48894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_ebx_09", "family_id": "de_div_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_scale+0x00a8", "fault_hex": "f7 f3", "fault_len": 2, "disasm": "div ebx", "regs_summary": "RAX=0x10b RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b48 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x10b, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_scale: denom=0 fallback_quotient=0 sample=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b80b01000031d231dbf7f35b48894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ebx_00", "family_id": "de_idiv_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sscale+0x0018", "fault_hex": "f7 fb", "fault_len": 2, "disasm": "idiv ebx", "regs_summary": "RAX=0x2a RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b00 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x2a, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sscale: denom=0 fallback_quotient=0 sample=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b82a0000009931dbf7fb5b48894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ebx_01", "family_id": "de_idiv_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sscale+0x0028", "fault_hex": "f7 fb", "fault_len": 2, "disasm": "idiv ebx", "regs_summary": "RAX=0x43 RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b08 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x43, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sscale: denom=0 fallback_quotient=0 sample=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b8430000009931dbf7fb5b48894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ebx_02", "family_id": "de_idiv_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sscale+0x0038", "fault_hex": "f7 fb", "fault_len": 2, "disasm": "idiv ebx", "regs_summary": "RAX=0x5c RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b10 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x5c, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sscale: denom=0 fallback_quotient=0 sample=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b85c0000009931dbf7fb5b48894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ebx_03", "family_id": "de_idiv_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sscale+0x0048", "fault_hex": "f7 fb", "fault_len": 2, "disasm": "idiv ebx", "regs_summary": "RAX=0x75 RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b18 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x75, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sscale: denom=0 fallback_quotient=0 sample=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b8750000009931dbf7fb5b48894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ebx_04", "family_id": "de_idiv_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sscale+0x0058", "fault_hex": "f7 fb", "fault_len": 2, "disasm": "idiv ebx", "regs_summary": "RAX=0x8e RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b20 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x8e, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sscale: denom=0 fallback_quotient=0 sample=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b88e0000009931dbf7fb5b48894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ebx_05", "family_id": "de_idiv_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sscale+0x0068", "fault_hex": "f7 fb", "fault_len": 2, "disasm": "idiv ebx", "regs_summary": "RAX=0xa7 RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b28 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xa7, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sscale: denom=0 fallback_quotient=0 sample=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b8a70000009931dbf7fb5b48894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ebx_06", "family_id": "de_idiv_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sscale+0x0078", "fault_hex": "f7 fb", "fault_len": 2, "disasm": "idiv ebx", "regs_summary": "RAX=0xc0 RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b30 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xc0, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sscale: denom=0 fallback_quotient=0 sample=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b8c00000009931dbf7fb5b48894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ebx_07", "family_id": "de_idiv_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sscale+0x0088", "fault_hex": "f7 fb", "fault_len": 2, "disasm": "idiv ebx", "regs_summary": "RAX=0xd9 RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b38 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xd9, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sscale: denom=0 fallback_quotient=0 sample=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b8d90000009931dbf7fb5b48894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ebx_08", "family_id": "de_idiv_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sscale+0x0098", "fault_hex": "f7 fb", "fault_len": 2, "disasm": "idiv ebx", "regs_summary": "RAX=0xf2 RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b40 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xf2, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sscale: denom=0 fallback_quotient=0 sample=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b8f20000009931dbf7fb5b48894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_ebx_09", "family_id": "de_idiv_ebx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sscale+0x00a8", "fault_hex": "f7 fb", "fault_len": 2, "disasm": "idiv ebx", "regs_summary": "RAX=0x10b RBX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b48 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x10b, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sscale: denom=0 fallback_quotient=0 sample=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "53b80b0100009931dbf7fb5b48894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rcx_00", "family_id": "de_div64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_bw+0x0018", "fault_hex": "48 f7 f1", "fault_len": 3, "disasm": "div rcx", "regs_summary": "RAX=0x2a RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b00 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x2a, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_bw: denom=0 fallback_quotient=0 sample=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b82a00000031d231c948f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rcx_01", "family_id": "de_div64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_bw+0x0028", "fault_hex": "48 f7 f1", "fault_len": 3, "disasm": "div rcx", "regs_summary": "RAX=0x43 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b08 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x43, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_bw: denom=0 fallback_quotient=0 sample=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b84300000031d231c948f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rcx_02", "family_id": "de_div64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_bw+0x0038", "fault_hex": "48 f7 f1", "fault_len": 3, "disasm": "div rcx", "regs_summary": "RAX=0x5c RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b10 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x5c, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_bw: denom=0 fallback_quotient=0 sample=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b85c00000031d231c948f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rcx_03", "family_id": "de_div64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_bw+0x0048", "fault_hex": "48 f7 f1", "fault_len": 3, "disasm": "div rcx", "regs_summary": "RAX=0x75 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b18 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x75, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_bw: denom=0 fallback_quotient=0 sample=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b87500000031d231c948f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rcx_04", "family_id": "de_div64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_bw+0x0058", "fault_hex": "48 f7 f1", "fault_len": 3, "disasm": "div rcx", "regs_summary": "RAX=0x8e RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b20 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x8e, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_bw: denom=0 fallback_quotient=0 sample=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b88e00000031d231c948f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rcx_05", "family_id": "de_div64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_bw+0x0068", "fault_hex": "48 f7 f1", "fault_len": 3, "disasm": "div rcx", "regs_summary": "RAX=0xa7 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b28 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xa7, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_bw: denom=0 fallback_quotient=0 sample=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b8a700000031d231c948f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rcx_06", "family_id": "de_div64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_bw+0x0078", "fault_hex": "48 f7 f1", "fault_len": 3, "disasm": "div rcx", "regs_summary": "RAX=0xc0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b30 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xc0, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_bw: denom=0 fallback_quotient=0 sample=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b8c000000031d231c948f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rcx_07", "family_id": "de_div64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_bw+0x0088", "fault_hex": "48 f7 f1", "fault_len": 3, "disasm": "div rcx", "regs_summary": "RAX=0xd9 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b38 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xd9, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_bw: denom=0 fallback_quotient=0 sample=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b8d900000031d231c948f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rcx_08", "family_id": "de_div64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_bw+0x0098", "fault_hex": "48 f7 f1", "fault_len": 3, "disasm": "div rcx", "regs_summary": "RAX=0xf2 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b40 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xf2, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_bw: denom=0 fallback_quotient=0 sample=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b8f200000031d231c948f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rcx_09", "family_id": "de_div64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_bw+0x00a8", "fault_hex": "48 f7 f1", "fault_len": 3, "disasm": "div rcx", "regs_summary": "RAX=0x10b RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b48 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x10b, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_bw: denom=0 fallback_quotient=0 sample=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b80b01000031d231c948f7f148894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv64_rcx_00", "family_id": "de_idiv64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sbw+0x0018", "fault_hex": "48 f7 f9", "fault_len": 3, "disasm": "idiv rcx", "regs_summary": "RAX=0x2a RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b00 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x2a, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sbw: denom=0 fallback_quotient=0 sample=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b82a000000489931c948f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv64_rcx_01", "family_id": "de_idiv64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sbw+0x0028", "fault_hex": "48 f7 f9", "fault_len": 3, "disasm": "idiv rcx", "regs_summary": "RAX=0x43 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b08 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x43, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sbw: denom=0 fallback_quotient=0 sample=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b843000000489931c948f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv64_rcx_02", "family_id": "de_idiv64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sbw+0x0038", "fault_hex": "48 f7 f9", "fault_len": 3, "disasm": "idiv rcx", "regs_summary": "RAX=0x5c RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b10 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x5c, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sbw: denom=0 fallback_quotient=0 sample=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b85c000000489931c948f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv64_rcx_03", "family_id": "de_idiv64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sbw+0x0048", "fault_hex": "48 f7 f9", "fault_len": 3, "disasm": "idiv rcx", "regs_summary": "RAX=0x75 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b18 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x75, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sbw: denom=0 fallback_quotient=0 sample=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b875000000489931c948f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv64_rcx_04", "family_id": "de_idiv64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sbw+0x0058", "fault_hex": "48 f7 f9", "fault_len": 3, "disasm": "idiv rcx", "regs_summary": "RAX=0x8e RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b20 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x8e, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sbw: denom=0 fallback_quotient=0 sample=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b88e000000489931c948f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv64_rcx_05", "family_id": "de_idiv64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sbw+0x0068", "fault_hex": "48 f7 f9", "fault_len": 3, "disasm": "idiv rcx", "regs_summary": "RAX=0xa7 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b28 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xa7, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sbw: denom=0 fallback_quotient=0 sample=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b8a7000000489931c948f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv64_rcx_06", "family_id": "de_idiv64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sbw+0x0078", "fault_hex": "48 f7 f9", "fault_len": 3, "disasm": "idiv rcx", "regs_summary": "RAX=0xc0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b30 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xc0, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sbw: denom=0 fallback_quotient=0 sample=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b8c0000000489931c948f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv64_rcx_07", "family_id": "de_idiv64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sbw+0x0088", "fault_hex": "48 f7 f9", "fault_len": 3, "disasm": "idiv rcx", "regs_summary": "RAX=0xd9 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b38 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xd9, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sbw: denom=0 fallback_quotient=0 sample=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b8d9000000489931c948f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv64_rcx_08", "family_id": "de_idiv64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sbw+0x0098", "fault_hex": "48 f7 f9", "fault_len": 3, "disasm": "idiv rcx", "regs_summary": "RAX=0xf2 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b40 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xf2, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sbw: denom=0 fallback_quotient=0 sample=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b8f2000000489931c948f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv64_rcx_09", "family_id": "de_idiv64_rcx", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sbw+0x00a8", "fault_hex": "48 f7 f9", "fault_len": 3, "disasm": "idiv rcx", "regs_summary": "RAX=0x10b RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b48 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x10b, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sbw: denom=0 fallback_quotient=0 sample=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b80b010000489931c948f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rsi_00", "family_id": "de_div64_rsi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_lat+0x0018", "fault_hex": "48 f7 f6", "fault_len": 3, "disasm": "div rsi", "regs_summary": "RAX=0x2a RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b00 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x2a, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_lat: denom=0 fallback_quotient=0 sample=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b82a00000031d231f648f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rsi_01", "family_id": "de_div64_rsi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_lat+0x0028", "fault_hex": "48 f7 f6", "fault_len": 3, "disasm": "div rsi", "regs_summary": "RAX=0x43 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b08 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x43, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_lat: denom=0 fallback_quotient=0 sample=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b84300000031d231f648f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rsi_02", "family_id": "de_div64_rsi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_lat+0x0038", "fault_hex": "48 f7 f6", "fault_len": 3, "disasm": "div rsi", "regs_summary": "RAX=0x5c RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b10 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x5c, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_lat: denom=0 fallback_quotient=0 sample=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b85c00000031d231f648f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rsi_03", "family_id": "de_div64_rsi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_lat+0x0048", "fault_hex": "48 f7 f6", "fault_len": 3, "disasm": "div rsi", "regs_summary": "RAX=0x75 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b18 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x75, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_lat: denom=0 fallback_quotient=0 sample=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b87500000031d231f648f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rsi_04", "family_id": "de_div64_rsi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_lat+0x0058", "fault_hex": "48 f7 f6", "fault_len": 3, "disasm": "div rsi", "regs_summary": "RAX=0x8e RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b20 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x8e, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_lat: denom=0 fallback_quotient=0 sample=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b88e00000031d231f648f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rsi_05", "family_id": "de_div64_rsi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_lat+0x0068", "fault_hex": "48 f7 f6", "fault_len": 3, "disasm": "div rsi", "regs_summary": "RAX=0xa7 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b28 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xa7, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_lat: denom=0 fallback_quotient=0 sample=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b8a700000031d231f648f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rsi_06", "family_id": "de_div64_rsi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_lat+0x0078", "fault_hex": "48 f7 f6", "fault_len": 3, "disasm": "div rsi", "regs_summary": "RAX=0xc0 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b30 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xc0, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_lat: denom=0 fallback_quotient=0 sample=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b8c000000031d231f648f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rsi_07", "family_id": "de_div64_rsi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_lat+0x0088", "fault_hex": "48 f7 f6", "fault_len": 3, "disasm": "div rsi", "regs_summary": "RAX=0xd9 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b38 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xd9, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_lat: denom=0 fallback_quotient=0 sample=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b8d900000031d231f648f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rsi_08", "family_id": "de_div64_rsi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_lat+0x0098", "fault_hex": "48 f7 f6", "fault_len": 3, "disasm": "div rsi", "regs_summary": "RAX=0xf2 RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b40 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xf2, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_lat: denom=0 fallback_quotient=0 sample=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b8f200000031d231f648f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_rsi_09", "family_id": "de_div64_rsi", "category": "de_patchable", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_lat+0x00a8", "fault_hex": "48 f7 f6", "fault_len": 3, "disasm": "div rsi", "regs_summary": "RAX=0x10b RSI=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b48 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x10b, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_lat: denom=0 fallback_quotient=0 sample=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b80b01000031d231f648f7f648894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r8d_00", "family_id": "de_div_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_hist+0x0018", "fault_hex": "41 f7 f0", "fault_len": 3, "disasm": "div r8d", "regs_summary": "RAX=0x2a R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b00 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x2a, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hist: denom=0 fallback_quotient=0 sample=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b82a00000031d24531c041f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r8d_01", "family_id": "de_div_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_hist+0x0028", "fault_hex": "41 f7 f0", "fault_len": 3, "disasm": "div r8d", "regs_summary": "RAX=0x43 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b08 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x43, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hist: denom=0 fallback_quotient=0 sample=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b84300000031d24531c041f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r8d_02", "family_id": "de_div_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_hist+0x0038", "fault_hex": "41 f7 f0", "fault_len": 3, "disasm": "div r8d", "regs_summary": "RAX=0x5c R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b10 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x5c, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hist: denom=0 fallback_quotient=0 sample=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b85c00000031d24531c041f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r8d_03", "family_id": "de_div_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_hist+0x0048", "fault_hex": "41 f7 f0", "fault_len": 3, "disasm": "div r8d", "regs_summary": "RAX=0x75 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b18 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x75, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hist: denom=0 fallback_quotient=0 sample=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b87500000031d24531c041f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r8d_04", "family_id": "de_div_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_hist+0x0058", "fault_hex": "41 f7 f0", "fault_len": 3, "disasm": "div r8d", "regs_summary": "RAX=0x8e R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b20 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x8e, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hist: denom=0 fallback_quotient=0 sample=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b88e00000031d24531c041f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r8d_05", "family_id": "de_div_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_hist+0x0068", "fault_hex": "41 f7 f0", "fault_len": 3, "disasm": "div r8d", "regs_summary": "RAX=0xa7 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b28 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xa7, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hist: denom=0 fallback_quotient=0 sample=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8a700000031d24531c041f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r8d_06", "family_id": "de_div_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_hist+0x0078", "fault_hex": "41 f7 f0", "fault_len": 3, "disasm": "div r8d", "regs_summary": "RAX=0xc0 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b30 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xc0, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hist: denom=0 fallback_quotient=0 sample=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8c000000031d24531c041f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r8d_07", "family_id": "de_div_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_hist+0x0088", "fault_hex": "41 f7 f0", "fault_len": 3, "disasm": "div r8d", "regs_summary": "RAX=0xd9 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b38 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xd9, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hist: denom=0 fallback_quotient=0 sample=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8d900000031d24531c041f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r8d_08", "family_id": "de_div_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_hist+0x0098", "fault_hex": "41 f7 f0", "fault_len": 3, "disasm": "div r8d", "regs_summary": "RAX=0xf2 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b40 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xf2, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hist: denom=0 fallback_quotient=0 sample=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8f200000031d24531c041f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r8d_09", "family_id": "de_div_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_hist+0x00a8", "fault_hex": "41 f7 f0", "fault_len": 3, "disasm": "div r8d", "regs_summary": "RAX=0x10b R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b48 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x10b, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_hist: denom=0 fallback_quotient=0 sample=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b80b01000031d24531c041f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r8d_00", "family_id": "de_idiv_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_shist+0x0018", "fault_hex": "41 f7 f8", "fault_len": 3, "disasm": "idiv r8d", "regs_summary": "RAX=0x2a R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b00 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x2a, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_shist: denom=0 fallback_quotient=0 sample=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b82a000000994531c041f7f848894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r8d_01", "family_id": "de_idiv_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_shist+0x0028", "fault_hex": "41 f7 f8", "fault_len": 3, "disasm": "idiv r8d", "regs_summary": "RAX=0x43 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b08 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x43, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_shist: denom=0 fallback_quotient=0 sample=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b843000000994531c041f7f848894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r8d_02", "family_id": "de_idiv_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_shist+0x0038", "fault_hex": "41 f7 f8", "fault_len": 3, "disasm": "idiv r8d", "regs_summary": "RAX=0x5c R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b10 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x5c, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_shist: denom=0 fallback_quotient=0 sample=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b85c000000994531c041f7f848894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r8d_03", "family_id": "de_idiv_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_shist+0x0048", "fault_hex": "41 f7 f8", "fault_len": 3, "disasm": "idiv r8d", "regs_summary": "RAX=0x75 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b18 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x75, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_shist: denom=0 fallback_quotient=0 sample=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b875000000994531c041f7f848894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r8d_04", "family_id": "de_idiv_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_shist+0x0058", "fault_hex": "41 f7 f8", "fault_len": 3, "disasm": "idiv r8d", "regs_summary": "RAX=0x8e R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b20 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x8e, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_shist: denom=0 fallback_quotient=0 sample=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b88e000000994531c041f7f848894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r8d_05", "family_id": "de_idiv_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_shist+0x0068", "fault_hex": "41 f7 f8", "fault_len": 3, "disasm": "idiv r8d", "regs_summary": "RAX=0xa7 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b28 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xa7, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_shist: denom=0 fallback_quotient=0 sample=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8a7000000994531c041f7f848894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r8d_06", "family_id": "de_idiv_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_shist+0x0078", "fault_hex": "41 f7 f8", "fault_len": 3, "disasm": "idiv r8d", "regs_summary": "RAX=0xc0 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b30 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xc0, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_shist: denom=0 fallback_quotient=0 sample=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8c0000000994531c041f7f848894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r8d_07", "family_id": "de_idiv_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_shist+0x0088", "fault_hex": "41 f7 f8", "fault_len": 3, "disasm": "idiv r8d", "regs_summary": "RAX=0xd9 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b38 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xd9, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_shist: denom=0 fallback_quotient=0 sample=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8d9000000994531c041f7f848894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r8d_08", "family_id": "de_idiv_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_shist+0x0098", "fault_hex": "41 f7 f8", "fault_len": 3, "disasm": "idiv r8d", "regs_summary": "RAX=0xf2 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b40 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xf2, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_shist: denom=0 fallback_quotient=0 sample=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8f2000000994531c041f7f848894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r8d_09", "family_id": "de_idiv_r8d", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_shist+0x00a8", "fault_hex": "41 f7 f8", "fault_len": 3, "disasm": "idiv r8d", "regs_summary": "RAX=0x10b R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b48 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x10b, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_shist: denom=0 fallback_quotient=0 sample=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b80b010000994531c041f7f848894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_r8_00", "family_id": "de_div64_r8", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_thru+0x0018", "fault_hex": "49 f7 f0", "fault_len": 3, "disasm": "div r8", "regs_summary": "RAX=0x2a R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b00 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x2a, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_thru: denom=0 fallback_quotient=0 sample=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b82a00000031d24531c049f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_r8_01", "family_id": "de_div64_r8", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_thru+0x0028", "fault_hex": "49 f7 f0", "fault_len": 3, "disasm": "div r8", "regs_summary": "RAX=0x43 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b08 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x43, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_thru: denom=0 fallback_quotient=0 sample=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b84300000031d24531c049f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_r8_02", "family_id": "de_div64_r8", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_thru+0x0038", "fault_hex": "49 f7 f0", "fault_len": 3, "disasm": "div r8", "regs_summary": "RAX=0x5c R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b10 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x5c, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_thru: denom=0 fallback_quotient=0 sample=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b85c00000031d24531c049f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_r8_03", "family_id": "de_div64_r8", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_thru+0x0048", "fault_hex": "49 f7 f0", "fault_len": 3, "disasm": "div r8", "regs_summary": "RAX=0x75 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b18 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x75, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_thru: denom=0 fallback_quotient=0 sample=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b87500000031d24531c049f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_r8_04", "family_id": "de_div64_r8", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_thru+0x0058", "fault_hex": "49 f7 f0", "fault_len": 3, "disasm": "div r8", "regs_summary": "RAX=0x8e R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b20 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x8e, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_thru: denom=0 fallback_quotient=0 sample=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b88e00000031d24531c049f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_r8_05", "family_id": "de_div64_r8", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_thru+0x0068", "fault_hex": "49 f7 f0", "fault_len": 3, "disasm": "div r8", "regs_summary": "RAX=0xa7 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b28 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xa7, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_thru: denom=0 fallback_quotient=0 sample=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b8a700000031d24531c049f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_r8_06", "family_id": "de_div64_r8", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_thru+0x0078", "fault_hex": "49 f7 f0", "fault_len": 3, "disasm": "div r8", "regs_summary": "RAX=0xc0 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b30 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xc0, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_thru: denom=0 fallback_quotient=0 sample=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b8c000000031d24531c049f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_r8_07", "family_id": "de_div64_r8", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_thru+0x0088", "fault_hex": "49 f7 f0", "fault_len": 3, "disasm": "div r8", "regs_summary": "RAX=0xd9 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b38 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xd9, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_thru: denom=0 fallback_quotient=0 sample=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b8d900000031d24531c049f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_r8_08", "family_id": "de_div64_r8", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_thru+0x0098", "fault_hex": "49 f7 f0", "fault_len": 3, "disasm": "div r8", "regs_summary": "RAX=0xf2 R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b40 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xf2, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_thru: denom=0 fallback_quotient=0 sample=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b8f200000031d24531c049f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div64_r8_09", "family_id": "de_div64_r8", "category": "de_patchable", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_thru+0x00a8", "fault_hex": "49 f7 f0", "fault_len": 3, "disasm": "div r8", "regs_summary": "RAX=0x10b R8=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b48 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x10b, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_thru: denom=0 fallback_quotient=0 sample=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "48 31 c0", "kvm_mode": "exec", "stub_hex": "b80b01000031d24531c049f7f048894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r9d_00", "family_id": "de_div_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ema+0x0018", "fault_hex": "41 f7 f1", "fault_len": 3, "disasm": "div r9d", "regs_summary": "RAX=0x2a R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b00 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x2a, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ema: denom=0 fallback_quotient=0 sample=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b82a00000031d24531c941f7f148894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r9d_01", "family_id": "de_div_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ema+0x0028", "fault_hex": "41 f7 f1", "fault_len": 3, "disasm": "div r9d", "regs_summary": "RAX=0x43 R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b08 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x43, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ema: denom=0 fallback_quotient=0 sample=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b84300000031d24531c941f7f148894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r9d_02", "family_id": "de_div_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ema+0x0038", "fault_hex": "41 f7 f1", "fault_len": 3, "disasm": "div r9d", "regs_summary": "RAX=0x5c R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b10 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x5c, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ema: denom=0 fallback_quotient=0 sample=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b85c00000031d24531c941f7f148894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r9d_03", "family_id": "de_div_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ema+0x0048", "fault_hex": "41 f7 f1", "fault_len": 3, "disasm": "div r9d", "regs_summary": "RAX=0x75 R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b18 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x75, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ema: denom=0 fallback_quotient=0 sample=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b87500000031d24531c941f7f148894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r9d_04", "family_id": "de_div_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ema+0x0058", "fault_hex": "41 f7 f1", "fault_len": 3, "disasm": "div r9d", "regs_summary": "RAX=0x8e R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b20 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x8e, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ema: denom=0 fallback_quotient=0 sample=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b88e00000031d24531c941f7f148894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r9d_05", "family_id": "de_div_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ema+0x0068", "fault_hex": "41 f7 f1", "fault_len": 3, "disasm": "div r9d", "regs_summary": "RAX=0xa7 R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b28 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xa7, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ema: denom=0 fallback_quotient=0 sample=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8a700000031d24531c941f7f148894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r9d_06", "family_id": "de_div_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ema+0x0078", "fault_hex": "41 f7 f1", "fault_len": 3, "disasm": "div r9d", "regs_summary": "RAX=0xc0 R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b30 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xc0, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ema: denom=0 fallback_quotient=0 sample=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8c000000031d24531c941f7f148894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r9d_07", "family_id": "de_div_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ema+0x0088", "fault_hex": "41 f7 f1", "fault_len": 3, "disasm": "div r9d", "regs_summary": "RAX=0xd9 R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b38 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xd9, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ema: denom=0 fallback_quotient=0 sample=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8d900000031d24531c941f7f148894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r9d_08", "family_id": "de_div_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ema+0x0098", "fault_hex": "41 f7 f1", "fault_len": 3, "disasm": "div r9d", "regs_summary": "RAX=0xf2 R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b40 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xf2, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ema: denom=0 fallback_quotient=0 sample=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8f200000031d24531c941f7f148894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r9d_09", "family_id": "de_div_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ema+0x00a8", "fault_hex": "41 f7 f1", "fault_len": 3, "disasm": "div r9d", "regs_summary": "RAX=0x10b R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b48 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x10b, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_ema: denom=0 fallback_quotient=0 sample=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b80b01000031d24531c941f7f148894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r9d_00", "family_id": "de_idiv_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sema+0x0018", "fault_hex": "41 f7 f9", "fault_len": 3, "disasm": "idiv r9d", "regs_summary": "RAX=0x2a R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b00 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x2a, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sema: denom=0 fallback_quotient=0 sample=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b82a000000994531c941f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r9d_01", "family_id": "de_idiv_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sema+0x0028", "fault_hex": "41 f7 f9", "fault_len": 3, "disasm": "idiv r9d", "regs_summary": "RAX=0x43 R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b08 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x43, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sema: denom=0 fallback_quotient=0 sample=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b843000000994531c941f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r9d_02", "family_id": "de_idiv_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sema+0x0038", "fault_hex": "41 f7 f9", "fault_len": 3, "disasm": "idiv r9d", "regs_summary": "RAX=0x5c R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b10 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x5c, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sema: denom=0 fallback_quotient=0 sample=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b85c000000994531c941f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r9d_03", "family_id": "de_idiv_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sema+0x0048", "fault_hex": "41 f7 f9", "fault_len": 3, "disasm": "idiv r9d", "regs_summary": "RAX=0x75 R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b18 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x75, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sema: denom=0 fallback_quotient=0 sample=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b875000000994531c941f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r9d_04", "family_id": "de_idiv_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sema+0x0058", "fault_hex": "41 f7 f9", "fault_len": 3, "disasm": "idiv r9d", "regs_summary": "RAX=0x8e R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b20 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x8e, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sema: denom=0 fallback_quotient=0 sample=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b88e000000994531c941f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r9d_05", "family_id": "de_idiv_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sema+0x0068", "fault_hex": "41 f7 f9", "fault_len": 3, "disasm": "idiv r9d", "regs_summary": "RAX=0xa7 R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b28 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xa7, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sema: denom=0 fallback_quotient=0 sample=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8a7000000994531c941f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r9d_06", "family_id": "de_idiv_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sema+0x0078", "fault_hex": "41 f7 f9", "fault_len": 3, "disasm": "idiv r9d", "regs_summary": "RAX=0xc0 R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b30 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xc0, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sema: denom=0 fallback_quotient=0 sample=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8c0000000994531c941f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r9d_07", "family_id": "de_idiv_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sema+0x0088", "fault_hex": "41 f7 f9", "fault_len": 3, "disasm": "idiv r9d", "regs_summary": "RAX=0xd9 R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b38 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xd9, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sema: denom=0 fallback_quotient=0 sample=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8d9000000994531c941f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r9d_08", "family_id": "de_idiv_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sema+0x0098", "fault_hex": "41 f7 f9", "fault_len": 3, "disasm": "idiv r9d", "regs_summary": "RAX=0xf2 R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b40 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xf2, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sema: denom=0 fallback_quotient=0 sample=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8f2000000994531c941f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_idiv_r9d_09", "family_id": "de_idiv_r9d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sema+0x00a8", "fault_hex": "41 f7 f9", "fault_len": 3, "disasm": "idiv r9d", "regs_summary": "RAX=0x10b R9=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b48 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x10b, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sema: denom=0 fallback_quotient=0 sample=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b80b010000994531c941f7f948894708c3", "patch_off": 9, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r10d_00", "family_id": "de_div_r10d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_norm+0x0018", "fault_hex": "41 f7 f2", "fault_len": 3, "disasm": "div r10d", "regs_summary": "RAX=0x2a R10=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b00 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x2a, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_norm: denom=0 fallback_quotient=0 sample=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b82a00000031d24531d241f7f248894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r10d_01", "family_id": "de_div_r10d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_norm+0x0028", "fault_hex": "41 f7 f2", "fault_len": 3, "disasm": "div r10d", "regs_summary": "RAX=0x43 R10=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b08 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x43, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_norm: denom=0 fallback_quotient=0 sample=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b84300000031d24531d241f7f248894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r10d_02", "family_id": "de_div_r10d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_norm+0x0038", "fault_hex": "41 f7 f2", "fault_len": 3, "disasm": "div r10d", "regs_summary": "RAX=0x5c R10=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b10 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x5c, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_norm: denom=0 fallback_quotient=0 sample=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b85c00000031d24531d241f7f248894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r10d_03", "family_id": "de_div_r10d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_norm+0x0048", "fault_hex": "41 f7 f2", "fault_len": 3, "disasm": "div r10d", "regs_summary": "RAX=0x75 R10=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b18 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x75, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_norm: denom=0 fallback_quotient=0 sample=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b87500000031d24531d241f7f248894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r10d_04", "family_id": "de_div_r10d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_norm+0x0058", "fault_hex": "41 f7 f2", "fault_len": 3, "disasm": "div r10d", "regs_summary": "RAX=0x8e R10=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b20 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x8e, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_norm: denom=0 fallback_quotient=0 sample=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b88e00000031d24531d241f7f248894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r10d_05", "family_id": "de_div_r10d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_norm+0x0068", "fault_hex": "41 f7 f2", "fault_len": 3, "disasm": "div r10d", "regs_summary": "RAX=0xa7 R10=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b28 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xa7, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_norm: denom=0 fallback_quotient=0 sample=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8a700000031d24531d241f7f248894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r10d_06", "family_id": "de_div_r10d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_norm+0x0078", "fault_hex": "41 f7 f2", "fault_len": 3, "disasm": "div r10d", "regs_summary": "RAX=0xc0 R10=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b30 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xc0, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_norm: denom=0 fallback_quotient=0 sample=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8c000000031d24531d241f7f248894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r10d_07", "family_id": "de_div_r10d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_norm+0x0088", "fault_hex": "41 f7 f2", "fault_len": 3, "disasm": "div r10d", "regs_summary": "RAX=0xd9 R10=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b38 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xd9, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_norm: denom=0 fallback_quotient=0 sample=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8d900000031d24531d241f7f248894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r10d_08", "family_id": "de_div_r10d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_norm+0x0098", "fault_hex": "41 f7 f2", "fault_len": 3, "disasm": "div r10d", "regs_summary": "RAX=0xf2 R10=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b40 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0xf2, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_norm: denom=0 fallback_quotient=0 sample=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8f200000031d24531d241f7f248894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "de_div_r10d_09", "family_id": "de_div_r10d", "category": "de_patchable", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_norm+0x00a8", "fault_hex": "41 f7 f2", "fault_len": 3, "disasm": "div r10d", "regs_summary": "RAX=0x10b R10=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013b48 RFLAGS=0x246", "contract_hint": "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x10b, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_norm: denom=0 fallback_quotient=0 sample=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b80b01000031d24531d241f7f248894708c3", "patch_off": 10, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_keep_00", "family_id": "ud2_clean_keep", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_guard+0x001a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a00 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x40 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_guard: diag_trap state=clean pre_commit=1 seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708400000000f0bc3", "patch_off": 10, "expect_out_hex": "40", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_keep_01", "family_id": "ud2_clean_keep", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_guard+0x002a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a08 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x47 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_guard: diag_trap state=clean pre_commit=1 seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708470000000f0bc3", "patch_off": 10, "expect_out_hex": "47", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_keep_02", "family_id": "ud2_clean_keep", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_guard+0x003a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x2 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a10 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x4e already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_guard: diag_trap state=clean pre_commit=1 seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c747084e0000000f0bc3", "patch_off": 10, "expect_out_hex": "4e", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_keep_03", "family_id": "ud2_clean_keep", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_guard+0x004a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a18 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x55 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_guard: diag_trap state=clean pre_commit=1 seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708550000000f0bc3", "patch_off": 10, "expect_out_hex": "55", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_keep_04", "family_id": "ud2_clean_keep", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_guard+0x005a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x4 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a20 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x5c already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_guard: diag_trap state=clean pre_commit=1 seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c747085c0000000f0bc3", "patch_off": 10, "expect_out_hex": "5c", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_keep_05", "family_id": "ud2_clean_keep", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_guard+0x006a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x5 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a28 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x63 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_guard: diag_trap state=clean pre_commit=1 seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708630000000f0bc3", "patch_off": 10, "expect_out_hex": "63", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_keep_06", "family_id": "ud2_clean_keep", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_guard+0x007a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x6 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a30 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x6a already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_guard: diag_trap state=clean pre_commit=1 seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c747086a0000000f0bc3", "patch_off": 10, "expect_out_hex": "6a", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_keep_07", "family_id": "ud2_clean_keep", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_guard+0x008a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x7 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a38 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x71 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_guard: diag_trap state=clean pre_commit=1 seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708710000000f0bc3", "patch_off": 10, "expect_out_hex": "71", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_keep_08", "family_id": "ud2_clean_keep", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_guard+0x009a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x8 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a40 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x78 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_guard: diag_trap state=clean pre_commit=1 seq=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708780000000f0bc3", "patch_off": 10, "expect_out_hex": "78", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_keep_09", "family_id": "ud2_clean_keep", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_guard+0x00aa", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x9 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a48 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x7f already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_guard: diag_trap state=clean pre_commit=1 seq=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c747087f0000000f0bc3", "patch_off": 10, "expect_out_hex": "7f", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_zero_00", "family_id": "ud2_clean_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sync+0x001a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a00 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x40 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sync: diag_trap state=clean pre_commit=1 seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708400000000f0bc3", "patch_off": 10, "expect_out_hex": "40", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_zero_01", "family_id": "ud2_clean_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sync+0x002a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a08 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x47 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sync: diag_trap state=clean pre_commit=1 seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708470000000f0bc3", "patch_off": 10, "expect_out_hex": "47", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_zero_02", "family_id": "ud2_clean_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sync+0x003a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x2 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a10 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x4e already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sync: diag_trap state=clean pre_commit=1 seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c747084e0000000f0bc3", "patch_off": 10, "expect_out_hex": "4e", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_zero_03", "family_id": "ud2_clean_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sync+0x004a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a18 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x55 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sync: diag_trap state=clean pre_commit=1 seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708550000000f0bc3", "patch_off": 10, "expect_out_hex": "55", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_zero_04", "family_id": "ud2_clean_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sync+0x005a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x4 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a20 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x5c already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sync: diag_trap state=clean pre_commit=1 seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c747085c0000000f0bc3", "patch_off": 10, "expect_out_hex": "5c", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_zero_05", "family_id": "ud2_clean_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sync+0x006a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x5 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a28 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x63 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sync: diag_trap state=clean pre_commit=1 seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708630000000f0bc3", "patch_off": 10, "expect_out_hex": "63", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_zero_06", "family_id": "ud2_clean_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sync+0x007a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x6 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a30 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x6a already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sync: diag_trap state=clean pre_commit=1 seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c747086a0000000f0bc3", "patch_off": 10, "expect_out_hex": "6a", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_zero_07", "family_id": "ud2_clean_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sync+0x008a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x7 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a38 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x71 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sync: diag_trap state=clean pre_commit=1 seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708710000000f0bc3", "patch_off": 10, "expect_out_hex": "71", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_zero_08", "family_id": "ud2_clean_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sync+0x009a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x8 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a40 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x78 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sync: diag_trap state=clean pre_commit=1 seq=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708780000000f0bc3", "patch_off": 10, "expect_out_hex": "78", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_clean_zero_09", "family_id": "ud2_clean_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sync+0x00aa", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x9 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a48 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x7f already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sync: diag_trap state=clean pre_commit=1 seq=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c747087f0000000f0bc3", "patch_off": 10, "expect_out_hex": "7f", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_ret0_00", "family_id": "ud2_dirty_ret0", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_gate+0x001a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1300 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a00 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1300 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_gate: diag_trap fallback_ret=0 state=clean seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8001300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_ret0_01", "family_id": "ud2_dirty_ret0", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_gate+0x002a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1311 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a08 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1311 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_gate: diag_trap fallback_ret=0 state=clean seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8111300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_ret0_02", "family_id": "ud2_dirty_ret0", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_gate+0x003a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1322 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a10 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1322 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_gate: diag_trap fallback_ret=0 state=clean seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8221300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_ret0_03", "family_id": "ud2_dirty_ret0", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_gate+0x004a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1333 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a18 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1333 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_gate: diag_trap fallback_ret=0 state=clean seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8331300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_ret0_04", "family_id": "ud2_dirty_ret0", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_gate+0x005a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1344 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a20 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1344 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_gate: diag_trap fallback_ret=0 state=clean seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8441300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_ret0_05", "family_id": "ud2_dirty_ret0", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_gate+0x006a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1355 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a28 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1355 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_gate: diag_trap fallback_ret=0 state=clean seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8551300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_ret0_06", "family_id": "ud2_dirty_ret0", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_gate+0x007a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1366 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a30 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1366 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_gate: diag_trap fallback_ret=0 state=clean seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8661300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_ret0_07", "family_id": "ud2_dirty_ret0", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_gate+0x008a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1377 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a38 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1377 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_gate: diag_trap fallback_ret=0 state=clean seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8771300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_ret0_08", "family_id": "ud2_dirty_ret0", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_gate+0x009a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1388 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a40 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1388 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_gate: diag_trap fallback_ret=0 state=clean seq=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8881300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_ret0_09", "family_id": "ud2_dirty_ret0", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_gate+0x00aa", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1399 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a48 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1399 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_gate: diag_trap fallback_ret=0 state=clean seq=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8991300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_zero_00", "family_id": "ud2_dirty_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_chk+0x001a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1300 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a00 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1300 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_chk: diag_trap fallback_ret=0 state=clean seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8001300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_zero_01", "family_id": "ud2_dirty_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_chk+0x002a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1311 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a08 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1311 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_chk: diag_trap fallback_ret=0 state=clean seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8111300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_zero_02", "family_id": "ud2_dirty_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_chk+0x003a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1322 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a10 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1322 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_chk: diag_trap fallback_ret=0 state=clean seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8221300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_zero_03", "family_id": "ud2_dirty_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_chk+0x004a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1333 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a18 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1333 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_chk: diag_trap fallback_ret=0 state=clean seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8331300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_zero_04", "family_id": "ud2_dirty_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_chk+0x005a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1344 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a20 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1344 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_chk: diag_trap fallback_ret=0 state=clean seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8441300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_zero_05", "family_id": "ud2_dirty_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_chk+0x006a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1355 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a28 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1355 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_chk: diag_trap fallback_ret=0 state=clean seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8551300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_zero_06", "family_id": "ud2_dirty_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_chk+0x007a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1366 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a30 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1366 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_chk: diag_trap fallback_ret=0 state=clean seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8661300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_zero_07", "family_id": "ud2_dirty_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_chk+0x008a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1377 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a38 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1377 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_chk: diag_trap fallback_ret=0 state=clean seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8771300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_zero_08", "family_id": "ud2_dirty_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_chk+0x009a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1388 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a40 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1388 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_chk: diag_trap fallback_ret=0 state=clean seq=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8881300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_dirty_zero_09", "family_id": "ud2_dirty_zero", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_chk+0x00aa", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1399 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a48 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1399 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_chk: diag_trap fallback_ret=0 state=clean seq=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0", "kvm_mode": "exec", "stub_hex": "b8991300000f0b48894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_clean_00", "family_id": "ud1_eax_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p1+0x001a", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a00 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x40 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p1: diag_trap state=clean pre_commit=1 seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708400000000fb9c0c3", "patch_off": 10, "expect_out_hex": "40", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_clean_01", "family_id": "ud1_eax_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p1+0x002a", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a08 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x47 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p1: diag_trap state=clean pre_commit=1 seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708470000000fb9c0c3", "patch_off": 10, "expect_out_hex": "47", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_clean_02", "family_id": "ud1_eax_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p1+0x003a", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x2 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a10 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x4e already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p1: diag_trap state=clean pre_commit=1 seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747084e0000000fb9c0c3", "patch_off": 10, "expect_out_hex": "4e", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_clean_03", "family_id": "ud1_eax_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p1+0x004a", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a18 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x55 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p1: diag_trap state=clean pre_commit=1 seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708550000000fb9c0c3", "patch_off": 10, "expect_out_hex": "55", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_clean_04", "family_id": "ud1_eax_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p1+0x005a", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x4 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a20 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x5c already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p1: diag_trap state=clean pre_commit=1 seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747085c0000000fb9c0c3", "patch_off": 10, "expect_out_hex": "5c", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_clean_05", "family_id": "ud1_eax_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p1+0x006a", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x5 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a28 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x63 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p1: diag_trap state=clean pre_commit=1 seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708630000000fb9c0c3", "patch_off": 10, "expect_out_hex": "63", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_clean_06", "family_id": "ud1_eax_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p1+0x007a", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x6 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a30 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x6a already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p1: diag_trap state=clean pre_commit=1 seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747086a0000000fb9c0c3", "patch_off": 10, "expect_out_hex": "6a", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_clean_07", "family_id": "ud1_eax_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p1+0x008a", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x7 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a38 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x71 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p1: diag_trap state=clean pre_commit=1 seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708710000000fb9c0c3", "patch_off": 10, "expect_out_hex": "71", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_clean_08", "family_id": "ud1_eax_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p1+0x009a", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x8 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a40 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x78 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p1: diag_trap state=clean pre_commit=1 seq=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708780000000fb9c0c3", "patch_off": 10, "expect_out_hex": "78", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_clean_09", "family_id": "ud1_eax_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p1+0x00aa", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x9 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a48 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x7f already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p1: diag_trap state=clean pre_commit=1 seq=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747087f0000000fb9c0c3", "patch_off": 10, "expect_out_hex": "7f", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_clean_00", "family_id": "ud1_ecx_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p2+0x001a", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a00 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x40 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p2: diag_trap state=clean pre_commit=1 seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708400000000fb9c9c3", "patch_off": 10, "expect_out_hex": "40", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_clean_01", "family_id": "ud1_ecx_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p2+0x002a", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a08 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x47 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p2: diag_trap state=clean pre_commit=1 seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708470000000fb9c9c3", "patch_off": 10, "expect_out_hex": "47", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_clean_02", "family_id": "ud1_ecx_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p2+0x003a", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x0 RBX=0x2 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a10 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x4e already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p2: diag_trap state=clean pre_commit=1 seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747084e0000000fb9c9c3", "patch_off": 10, "expect_out_hex": "4e", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_clean_03", "family_id": "ud1_ecx_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p2+0x004a", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a18 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x55 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p2: diag_trap state=clean pre_commit=1 seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708550000000fb9c9c3", "patch_off": 10, "expect_out_hex": "55", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_clean_04", "family_id": "ud1_ecx_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p2+0x005a", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x0 RBX=0x4 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a20 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x5c already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p2: diag_trap state=clean pre_commit=1 seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747085c0000000fb9c9c3", "patch_off": 10, "expect_out_hex": "5c", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_clean_05", "family_id": "ud1_ecx_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p2+0x006a", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x0 RBX=0x5 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a28 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x63 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p2: diag_trap state=clean pre_commit=1 seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708630000000fb9c9c3", "patch_off": 10, "expect_out_hex": "63", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_clean_06", "family_id": "ud1_ecx_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p2+0x007a", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x0 RBX=0x6 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a30 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x6a already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p2: diag_trap state=clean pre_commit=1 seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747086a0000000fb9c9c3", "patch_off": 10, "expect_out_hex": "6a", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_clean_07", "family_id": "ud1_ecx_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p2+0x008a", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x0 RBX=0x7 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a38 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x71 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p2: diag_trap state=clean pre_commit=1 seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708710000000fb9c9c3", "patch_off": 10, "expect_out_hex": "71", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_clean_08", "family_id": "ud1_ecx_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p2+0x009a", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x0 RBX=0x8 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a40 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x78 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p2: diag_trap state=clean pre_commit=1 seq=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708780000000fb9c9c3", "patch_off": 10, "expect_out_hex": "78", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_clean_09", "family_id": "ud1_ecx_clean", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_p2+0x00aa", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x0 RBX=0x9 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a48 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x7f already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_p2: diag_trap state=clean pre_commit=1 seq=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747087f0000000fb9c9c3", "patch_off": 10, "expect_out_hex": "7f", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_dirty_00", "family_id": "ud1_eax_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g1+0x001a", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1300 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a00 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1300 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g1: diag_trap fallback_ret=0 state=clean seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8001300000fb9c048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_dirty_01", "family_id": "ud1_eax_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g1+0x002a", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1311 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a08 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1311 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g1: diag_trap fallback_ret=0 state=clean seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8111300000fb9c048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_dirty_02", "family_id": "ud1_eax_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g1+0x003a", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1322 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a10 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1322 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g1: diag_trap fallback_ret=0 state=clean seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8221300000fb9c048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_dirty_03", "family_id": "ud1_eax_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g1+0x004a", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1333 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a18 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1333 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g1: diag_trap fallback_ret=0 state=clean seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8331300000fb9c048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_dirty_04", "family_id": "ud1_eax_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g1+0x005a", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1344 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a20 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1344 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g1: diag_trap fallback_ret=0 state=clean seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8441300000fb9c048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_dirty_05", "family_id": "ud1_eax_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g1+0x006a", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1355 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a28 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1355 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g1: diag_trap fallback_ret=0 state=clean seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8551300000fb9c048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_dirty_06", "family_id": "ud1_eax_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g1+0x007a", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1366 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a30 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1366 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g1: diag_trap fallback_ret=0 state=clean seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8661300000fb9c048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_dirty_07", "family_id": "ud1_eax_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g1+0x008a", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1377 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a38 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1377 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g1: diag_trap fallback_ret=0 state=clean seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8771300000fb9c048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_dirty_08", "family_id": "ud1_eax_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g1+0x009a", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1388 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a40 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1388 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g1: diag_trap fallback_ret=0 state=clean seq=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8881300000fb9c048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_eax_dirty_09", "family_id": "ud1_eax_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g1+0x00aa", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1399 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a48 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1399 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g1: diag_trap fallback_ret=0 state=clean seq=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8991300000fb9c048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_dirty_00", "family_id": "ud1_ecx_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g2+0x001a", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x1300 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a00 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1300 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g2: diag_trap fallback_ret=0 state=clean seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8001300000fb9c948894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_dirty_01", "family_id": "ud1_ecx_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g2+0x002a", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x1311 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a08 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1311 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g2: diag_trap fallback_ret=0 state=clean seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8111300000fb9c948894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_dirty_02", "family_id": "ud1_ecx_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g2+0x003a", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x1322 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a10 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1322 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g2: diag_trap fallback_ret=0 state=clean seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8221300000fb9c948894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_dirty_03", "family_id": "ud1_ecx_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g2+0x004a", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x1333 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a18 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1333 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g2: diag_trap fallback_ret=0 state=clean seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8331300000fb9c948894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_dirty_04", "family_id": "ud1_ecx_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g2+0x005a", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x1344 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a20 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1344 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g2: diag_trap fallback_ret=0 state=clean seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8441300000fb9c948894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_dirty_05", "family_id": "ud1_ecx_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g2+0x006a", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x1355 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a28 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1355 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g2: diag_trap fallback_ret=0 state=clean seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8551300000fb9c948894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_dirty_06", "family_id": "ud1_ecx_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g2+0x007a", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x1366 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a30 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1366 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g2: diag_trap fallback_ret=0 state=clean seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8661300000fb9c948894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_dirty_07", "family_id": "ud1_ecx_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g2+0x008a", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x1377 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a38 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1377 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g2: diag_trap fallback_ret=0 state=clean seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8771300000fb9c948894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_dirty_08", "family_id": "ud1_ecx_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g2+0x009a", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x1388 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a40 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1388 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g2: diag_trap fallback_ret=0 state=clean seq=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8881300000fb9c948894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_ecx_dirty_09", "family_id": "ud1_ecx_dirty", "category": "ud_patchable", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_g2+0x00aa", "fault_hex": "0f b9 c9", "fault_len": 3, "disasm": "ud1; leave", "regs_summary": "RAX=0x1399 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a48 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1399 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_g2: diag_trap fallback_ret=0 state=clean seq=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8991300000fb9c948894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_clean_00", "family_id": "ud1_edx_clean", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v1+0x001a", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a00 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x40 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v1: diag_trap state=clean pre_commit=1 seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708400000000fb9d2c3", "patch_off": 10, "expect_out_hex": "40", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_clean_01", "family_id": "ud1_edx_clean", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v1+0x002a", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a08 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x47 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v1: diag_trap state=clean pre_commit=1 seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708470000000fb9d2c3", "patch_off": 10, "expect_out_hex": "47", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_clean_02", "family_id": "ud1_edx_clean", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v1+0x003a", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x2 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a10 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x4e already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v1: diag_trap state=clean pre_commit=1 seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747084e0000000fb9d2c3", "patch_off": 10, "expect_out_hex": "4e", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_clean_03", "family_id": "ud1_edx_clean", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v1+0x004a", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a18 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x55 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v1: diag_trap state=clean pre_commit=1 seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708550000000fb9d2c3", "patch_off": 10, "expect_out_hex": "55", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_clean_04", "family_id": "ud1_edx_clean", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v1+0x005a", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x4 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a20 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x5c already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v1: diag_trap state=clean pre_commit=1 seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747085c0000000fb9d2c3", "patch_off": 10, "expect_out_hex": "5c", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_clean_05", "family_id": "ud1_edx_clean", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v1+0x006a", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x5 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a28 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x63 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v1: diag_trap state=clean pre_commit=1 seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708630000000fb9d2c3", "patch_off": 10, "expect_out_hex": "63", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_clean_06", "family_id": "ud1_edx_clean", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v1+0x007a", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x6 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a30 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x6a already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v1: diag_trap state=clean pre_commit=1 seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747086a0000000fb9d2c3", "patch_off": 10, "expect_out_hex": "6a", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_clean_07", "family_id": "ud1_edx_clean", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v1+0x008a", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x7 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a38 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x71 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v1: diag_trap state=clean pre_commit=1 seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708710000000fb9d2c3", "patch_off": 10, "expect_out_hex": "71", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_clean_08", "family_id": "ud1_edx_clean", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v1+0x009a", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x8 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a40 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x78 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v1: diag_trap state=clean pre_commit=1 seq=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708780000000fb9d2c3", "patch_off": 10, "expect_out_hex": "78", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_clean_09", "family_id": "ud1_edx_clean", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v1+0x00aa", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x0 RBX=0x9 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a48 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x7f already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v1: diag_trap state=clean pre_commit=1 seq=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747087f0000000fb9d2c3", "patch_off": 10, "expect_out_hex": "7f", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_dirty_00", "family_id": "ud1_edx_dirty", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v2+0x001a", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1300 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a00 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1300 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v2: diag_trap fallback_ret=0 state=clean seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8001300000fb9d248894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_dirty_01", "family_id": "ud1_edx_dirty", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v2+0x002a", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1311 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a08 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1311 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v2: diag_trap fallback_ret=0 state=clean seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8111300000fb9d248894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_dirty_02", "family_id": "ud1_edx_dirty", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v2+0x003a", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1322 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a10 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1322 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v2: diag_trap fallback_ret=0 state=clean seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8221300000fb9d248894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_dirty_03", "family_id": "ud1_edx_dirty", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v2+0x004a", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1333 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a18 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1333 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v2: diag_trap fallback_ret=0 state=clean seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8331300000fb9d248894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_dirty_04", "family_id": "ud1_edx_dirty", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v2+0x005a", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1344 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a20 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1344 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v2: diag_trap fallback_ret=0 state=clean seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8441300000fb9d248894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_dirty_05", "family_id": "ud1_edx_dirty", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v2+0x006a", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1355 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a28 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1355 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v2: diag_trap fallback_ret=0 state=clean seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8551300000fb9d248894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_dirty_06", "family_id": "ud1_edx_dirty", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v2+0x007a", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1366 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a30 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1366 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v2: diag_trap fallback_ret=0 state=clean seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8661300000fb9d248894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_dirty_07", "family_id": "ud1_edx_dirty", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v2+0x008a", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1377 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a38 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1377 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v2: diag_trap fallback_ret=0 state=clean seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8771300000fb9d248894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_dirty_08", "family_id": "ud1_edx_dirty", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v2+0x009a", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1388 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a40 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1388 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v2: diag_trap fallback_ret=0 state=clean seq=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8881300000fb9d248894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud1_edx_dirty_09", "family_id": "ud1_edx_dirty", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v2+0x00aa", "fault_hex": "0f b9 d2", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x1399 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a48 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1399 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v2: diag_trap fallback_ret=0 state=clean seq=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8991300000fb9d248894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_val_keep_00", "family_id": "ud2_val_keep", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v3+0x001a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a00 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x40 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v3: diag_trap state=clean pre_commit=1 seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708400000000f0bc3", "patch_off": 10, "expect_out_hex": "40", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_val_keep_01", "family_id": "ud2_val_keep", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v3+0x002a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a08 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x47 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v3: diag_trap state=clean pre_commit=1 seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708470000000f0bc3", "patch_off": 10, "expect_out_hex": "47", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_val_keep_02", "family_id": "ud2_val_keep", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v3+0x003a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x2 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a10 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x4e already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v3: diag_trap state=clean pre_commit=1 seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c747084e0000000f0bc3", "patch_off": 10, "expect_out_hex": "4e", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_val_keep_03", "family_id": "ud2_val_keep", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v3+0x004a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a18 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x55 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v3: diag_trap state=clean pre_commit=1 seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708550000000f0bc3", "patch_off": 10, "expect_out_hex": "55", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_val_keep_04", "family_id": "ud2_val_keep", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v3+0x005a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x4 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a20 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x5c already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v3: diag_trap state=clean pre_commit=1 seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c747085c0000000f0bc3", "patch_off": 10, "expect_out_hex": "5c", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_val_keep_05", "family_id": "ud2_val_keep", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v3+0x006a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x5 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a28 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x63 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v3: diag_trap state=clean pre_commit=1 seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708630000000f0bc3", "patch_off": 10, "expect_out_hex": "63", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_val_keep_06", "family_id": "ud2_val_keep", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v3+0x007a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x6 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a30 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x6a already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v3: diag_trap state=clean pre_commit=1 seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c747086a0000000f0bc3", "patch_off": 10, "expect_out_hex": "6a", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_val_keep_07", "family_id": "ud2_val_keep", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v3+0x008a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x7 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a38 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x71 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v3: diag_trap state=clean pre_commit=1 seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708710000000f0bc3", "patch_off": 10, "expect_out_hex": "71", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_val_keep_08", "family_id": "ud2_val_keep", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v3+0x009a", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x8 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a40 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x78 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v3: diag_trap state=clean pre_commit=1 seq=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708780000000f0bc3", "patch_off": 10, "expect_out_hex": "78", "expect_ret_hex": "0"}
+{"scenario_id": "ud2_val_keep_09", "family_id": "ud2_val_keep", "category": "ud_patchable", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_v3+0x00aa", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x9 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a48 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x7f already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_v3: diag_trap state=clean pre_commit=1 seq=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90", "kvm_mode": "exec", "stub_hex": "31c048c747087f0000000f0bc3", "patch_off": 10, "expect_out_hex": "7f", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_clean_00", "family_id": "ud0_eax_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t1+0x001a", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a00 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x40 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t1: diag_trap state=clean pre_commit=1 seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708400000000fffc0c3", "patch_off": 10, "expect_out_hex": "40", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_clean_01", "family_id": "ud0_eax_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t1+0x002a", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a08 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x47 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t1: diag_trap state=clean pre_commit=1 seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708470000000fffc0c3", "patch_off": 10, "expect_out_hex": "47", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_clean_02", "family_id": "ud0_eax_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t1+0x003a", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x0 RBX=0x2 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a10 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x4e already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t1: diag_trap state=clean pre_commit=1 seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747084e0000000fffc0c3", "patch_off": 10, "expect_out_hex": "4e", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_clean_03", "family_id": "ud0_eax_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t1+0x004a", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a18 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x55 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t1: diag_trap state=clean pre_commit=1 seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708550000000fffc0c3", "patch_off": 10, "expect_out_hex": "55", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_clean_04", "family_id": "ud0_eax_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t1+0x005a", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x0 RBX=0x4 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a20 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x5c already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t1: diag_trap state=clean pre_commit=1 seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747085c0000000fffc0c3", "patch_off": 10, "expect_out_hex": "5c", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_clean_05", "family_id": "ud0_eax_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t1+0x006a", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x0 RBX=0x5 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a28 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x63 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t1: diag_trap state=clean pre_commit=1 seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708630000000fffc0c3", "patch_off": 10, "expect_out_hex": "63", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_clean_06", "family_id": "ud0_eax_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t1+0x007a", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x0 RBX=0x6 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a30 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x6a already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t1: diag_trap state=clean pre_commit=1 seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747086a0000000fffc0c3", "patch_off": 10, "expect_out_hex": "6a", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_clean_07", "family_id": "ud0_eax_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t1+0x008a", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x0 RBX=0x7 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a38 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x71 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t1: diag_trap state=clean pre_commit=1 seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708710000000fffc0c3", "patch_off": 10, "expect_out_hex": "71", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_clean_08", "family_id": "ud0_eax_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t1+0x009a", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x0 RBX=0x8 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a40 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x78 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t1: diag_trap state=clean pre_commit=1 seq=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708780000000fffc0c3", "patch_off": 10, "expect_out_hex": "78", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_clean_09", "family_id": "ud0_eax_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t1+0x00aa", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x0 RBX=0x9 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a48 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x7f already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t1: diag_trap state=clean pre_commit=1 seq=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747087f0000000fffc0c3", "patch_off": 10, "expect_out_hex": "7f", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_dirty_00", "family_id": "ud0_eax_dirty", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t2+0x001a", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x1300 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a00 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1300 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t2: diag_trap fallback_ret=0 state=clean seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8001300000fffc048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_dirty_01", "family_id": "ud0_eax_dirty", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t2+0x002a", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x1311 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a08 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1311 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t2: diag_trap fallback_ret=0 state=clean seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8111300000fffc048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_dirty_02", "family_id": "ud0_eax_dirty", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t2+0x003a", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x1322 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a10 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1322 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t2: diag_trap fallback_ret=0 state=clean seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8221300000fffc048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_dirty_03", "family_id": "ud0_eax_dirty", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t2+0x004a", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x1333 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a18 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1333 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t2: diag_trap fallback_ret=0 state=clean seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8331300000fffc048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_dirty_04", "family_id": "ud0_eax_dirty", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t2+0x005a", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x1344 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a20 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1344 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t2: diag_trap fallback_ret=0 state=clean seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8441300000fffc048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_dirty_05", "family_id": "ud0_eax_dirty", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t2+0x006a", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x1355 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a28 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1355 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t2: diag_trap fallback_ret=0 state=clean seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8551300000fffc048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_dirty_06", "family_id": "ud0_eax_dirty", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t2+0x007a", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x1366 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a30 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1366 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t2: diag_trap fallback_ret=0 state=clean seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8661300000fffc048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_dirty_07", "family_id": "ud0_eax_dirty", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t2+0x008a", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x1377 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a38 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1377 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t2: diag_trap fallback_ret=0 state=clean seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8771300000fffc048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_dirty_08", "family_id": "ud0_eax_dirty", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t2+0x009a", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x1388 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a40 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1388 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t2: diag_trap fallback_ret=0 state=clean seq=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8881300000fffc048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_eax_dirty_09", "family_id": "ud0_eax_dirty", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t2+0x00aa", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x1399 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a48 RFLAGS=0x246", "contract_hint": "Stale EAX=0x1399 precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t2: diag_trap fallback_ret=0 state=clean seq=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "31 c0 90", "kvm_mode": "exec", "stub_hex": "b8991300000fffc048894708c3", "patch_off": 5, "expect_out_hex": "0", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_ecx_clean_00", "family_id": "ud0_ecx_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t3+0x001a", "fault_hex": "0f ff c9", "fault_len": 3, "disasm": "ud0; leave", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a00 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x40 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t3: diag_trap state=clean pre_commit=1 seq=0", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708400000000fffc9c3", "patch_off": 10, "expect_out_hex": "40", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_ecx_clean_01", "family_id": "ud0_ecx_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t3+0x002a", "fault_hex": "0f ff c9", "fault_len": 3, "disasm": "ud0; leave", "regs_summary": "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a08 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x47 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t3: diag_trap state=clean pre_commit=1 seq=1", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708470000000fffc9c3", "patch_off": 10, "expect_out_hex": "47", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_ecx_clean_02", "family_id": "ud0_ecx_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t3+0x003a", "fault_hex": "0f ff c9", "fault_len": 3, "disasm": "ud0; leave", "regs_summary": "RAX=0x0 RBX=0x2 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a10 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x4e already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t3: diag_trap state=clean pre_commit=1 seq=2", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747084e0000000fffc9c3", "patch_off": 10, "expect_out_hex": "4e", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_ecx_clean_03", "family_id": "ud0_ecx_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t3+0x004a", "fault_hex": "0f ff c9", "fault_len": 3, "disasm": "ud0; leave", "regs_summary": "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a18 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x55 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t3: diag_trap state=clean pre_commit=1 seq=3", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708550000000fffc9c3", "patch_off": 10, "expect_out_hex": "55", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_ecx_clean_04", "family_id": "ud0_ecx_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t3+0x005a", "fault_hex": "0f ff c9", "fault_len": 3, "disasm": "ud0; leave", "regs_summary": "RAX=0x0 RBX=0x4 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a20 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x5c already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t3: diag_trap state=clean pre_commit=1 seq=4", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747085c0000000fffc9c3", "patch_off": 10, "expect_out_hex": "5c", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_ecx_clean_05", "family_id": "ud0_ecx_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t3+0x006a", "fault_hex": "0f ff c9", "fault_len": 3, "disasm": "ud0; leave", "regs_summary": "RAX=0x0 RBX=0x5 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a28 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x63 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t3: diag_trap state=clean pre_commit=1 seq=5", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708630000000fffc9c3", "patch_off": 10, "expect_out_hex": "63", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_ecx_clean_06", "family_id": "ud0_ecx_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t3+0x007a", "fault_hex": "0f ff c9", "fault_len": 3, "disasm": "ud0; leave", "regs_summary": "RAX=0x0 RBX=0x6 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a30 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x6a already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t3: diag_trap state=clean pre_commit=1 seq=6", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747086a0000000fffc9c3", "patch_off": 10, "expect_out_hex": "6a", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_ecx_clean_07", "family_id": "ud0_ecx_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t3+0x008a", "fault_hex": "0f ff c9", "fault_len": 3, "disasm": "ud0; leave", "regs_summary": "RAX=0x0 RBX=0x7 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a38 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x71 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t3: diag_trap state=clean pre_commit=1 seq=7", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708710000000fffc9c3", "patch_off": 10, "expect_out_hex": "71", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_ecx_clean_08", "family_id": "ud0_ecx_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t3+0x009a", "fault_hex": "0f ff c9", "fault_len": 3, "disasm": "ud0; leave", "regs_summary": "RAX=0x0 RBX=0x8 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a40 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x78 already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t3: diag_trap state=clean pre_commit=1 seq=8", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c74708780000000fffc9c3", "patch_off": 10, "expect_out_hex": "78", "expect_ret_hex": "0"}
+{"scenario_id": "ud0_ecx_clean_09", "family_id": "ud0_ecx_clean", "category": "ud_patchable", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_t3+0x00aa", "fault_hex": "0f ff c9", "fault_len": 3, "disasm": "ud0; leave", "regs_summary": "RAX=0x0 RBX=0x9 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013a48 RFLAGS=0x246", "contract_hint": "Non-fatal diagnostic trap with EAX=0 and out_val=0x7f already prepared; skipping trap completes cleanly with ret=0.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_t3: diag_trap state=clean pre_commit=1 seq=9", "expected_action": "PATCH_BYTES", "ref_patch_hex": "90 90 90", "kvm_mode": "exec", "stub_hex": "31c048c747087f0000000fffc9c3", "patch_off": 10, "expect_out_hex": "7f", "expect_ret_hex": "0"}
+{"scenario_id": "ctrl_ext_get_user8_00", "family_id": "ctrl_ext_get_user8", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000010", "rip_sym": "__get_user_8+0x0010", "fault_hex": "48 8b 11", "fault_len": 3, "disasm": "mov rdx, qword ptr [rcx]", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x10 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "User-pointer read covered by Linux _ASM_EXTABLE fixup (-EFAULT).", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=0", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_get_user8_01", "family_id": "ctrl_ext_get_user8", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000010", "rip_sym": "__get_user_8+0x0020", "fault_hex": "48 8b 11", "fault_len": 3, "disasm": "mov rdx, qword ptr [rcx]", "regs_summary": "RAX=0x1 RBX=0x0 RCX=0x18 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "User-pointer read covered by Linux _ASM_EXTABLE fixup (-EFAULT).", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=1", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_get_user8_02", "family_id": "ctrl_ext_get_user8", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000010", "rip_sym": "__get_user_8+0x0030", "fault_hex": "48 8b 11", "fault_len": 3, "disasm": "mov rdx, qword ptr [rcx]", "regs_summary": "RAX=0x2 RBX=0x0 RCX=0x20 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "User-pointer read covered by Linux _ASM_EXTABLE fixup (-EFAULT).", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=2", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_get_user8_03", "family_id": "ctrl_ext_get_user8", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000010", "rip_sym": "__get_user_8+0x0040", "fault_hex": "48 8b 11", "fault_len": 3, "disasm": "mov rdx, qword ptr [rcx]", "regs_summary": "RAX=0x3 RBX=0x0 RCX=0x28 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "User-pointer read covered by Linux _ASM_EXTABLE fixup (-EFAULT).", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=3", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_get_user8_04", "family_id": "ctrl_ext_get_user8", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000010", "rip_sym": "__get_user_8+0x0050", "fault_hex": "48 8b 11", "fault_len": 3, "disasm": "mov rdx, qword ptr [rcx]", "regs_summary": "RAX=0x4 RBX=0x0 RCX=0x30 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "User-pointer read covered by Linux _ASM_EXTABLE fixup (-EFAULT).", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=4", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_get_user4_00", "family_id": "ctrl_ext_get_user4", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000020", "rip_sym": "__get_user_4+0x0010", "fault_hex": "8b 11", "fault_len": 2, "disasm": "mov edx, dword ptr [rcx]", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x10 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "32-bit get_user read covered by _ASM_EXTABLE fixup (-EFAULT).", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=0", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_get_user4_01", "family_id": "ctrl_ext_get_user4", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000020", "rip_sym": "__get_user_4+0x0020", "fault_hex": "8b 11", "fault_len": 2, "disasm": "mov edx, dword ptr [rcx]", "regs_summary": "RAX=0x1 RBX=0x0 RCX=0x18 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "32-bit get_user read covered by _ASM_EXTABLE fixup (-EFAULT).", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=1", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_get_user4_02", "family_id": "ctrl_ext_get_user4", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000020", "rip_sym": "__get_user_4+0x0030", "fault_hex": "8b 11", "fault_len": 2, "disasm": "mov edx, dword ptr [rcx]", "regs_summary": "RAX=0x2 RBX=0x0 RCX=0x20 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "32-bit get_user read covered by _ASM_EXTABLE fixup (-EFAULT).", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=2", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_get_user4_03", "family_id": "ctrl_ext_get_user4", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000020", "rip_sym": "__get_user_4+0x0040", "fault_hex": "8b 11", "fault_len": 2, "disasm": "mov edx, dword ptr [rcx]", "regs_summary": "RAX=0x3 RBX=0x0 RCX=0x28 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "32-bit get_user read covered by _ASM_EXTABLE fixup (-EFAULT).", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=3", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_get_user4_04", "family_id": "ctrl_ext_get_user4", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000020", "rip_sym": "__get_user_4+0x0050", "fault_hex": "8b 11", "fault_len": 2, "disasm": "mov edx, dword ptr [rcx]", "regs_summary": "RAX=0x4 RBX=0x0 RCX=0x30 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "32-bit get_user read covered by _ASM_EXTABLE fixup (-EFAULT).", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=4", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_put_user8_00", "family_id": "ctrl_ext_put_user8", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000008", "rip_sym": "__put_user_8+0x0010", "fault_hex": "48 89 01", "fault_len": 3, "disasm": "mov qword ptr [rcx], rax", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x10 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "User-pointer write covered by Linux _ASM_EXTABLE fixup (-EFAULT).", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=0", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_put_user8_01", "family_id": "ctrl_ext_put_user8", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000008", "rip_sym": "__put_user_8+0x0020", "fault_hex": "48 89 01", "fault_len": 3, "disasm": "mov qword ptr [rcx], rax", "regs_summary": "RAX=0x1 RBX=0x0 RCX=0x18 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "User-pointer write covered by Linux _ASM_EXTABLE fixup (-EFAULT).", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=1", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_put_user8_02", "family_id": "ctrl_ext_put_user8", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000008", "rip_sym": "__put_user_8+0x0030", "fault_hex": "48 89 01", "fault_len": 3, "disasm": "mov qword ptr [rcx], rax", "regs_summary": "RAX=0x2 RBX=0x0 RCX=0x20 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "User-pointer write covered by Linux _ASM_EXTABLE fixup (-EFAULT).", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=2", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_put_user8_03", "family_id": "ctrl_ext_put_user8", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000008", "rip_sym": "__put_user_8+0x0040", "fault_hex": "48 89 01", "fault_len": 3, "disasm": "mov qword ptr [rcx], rax", "regs_summary": "RAX=0x3 RBX=0x0 RCX=0x28 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "User-pointer write covered by Linux _ASM_EXTABLE fixup (-EFAULT).", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=3", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_put_user8_04", "family_id": "ctrl_ext_put_user8", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000008", "rip_sym": "__put_user_8+0x0050", "fault_hex": "48 89 01", "fault_len": 3, "disasm": "mov qword ptr [rcx], rax", "regs_summary": "RAX=0x4 RBX=0x0 RCX=0x30 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "User-pointer write covered by Linux _ASM_EXTABLE fixup (-EFAULT).", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=4", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_futex_00", "family_id": "ctrl_ext_futex", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "futex_detect_cmpxchg+0x0010", "fault_hex": "3e 0f b1 0e", "fault_len": 4, "disasm": "cmpxchg dword ptr ds:[rsi], ecx", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x10 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Linux futex_detect_cmpxchg probe covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=0", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_futex_01", "family_id": "ctrl_ext_futex", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "futex_detect_cmpxchg+0x0020", "fault_hex": "3e 0f b1 0e", "fault_len": 4, "disasm": "cmpxchg dword ptr ds:[rsi], ecx", "regs_summary": "RAX=0x1 RBX=0x0 RCX=0x18 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Linux futex_detect_cmpxchg probe covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=1", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_futex_02", "family_id": "ctrl_ext_futex", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "futex_detect_cmpxchg+0x0030", "fault_hex": "3e 0f b1 0e", "fault_len": 4, "disasm": "cmpxchg dword ptr ds:[rsi], ecx", "regs_summary": "RAX=0x2 RBX=0x0 RCX=0x20 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Linux futex_detect_cmpxchg probe covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=2", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_futex_03", "family_id": "ctrl_ext_futex", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "futex_detect_cmpxchg+0x0040", "fault_hex": "3e 0f b1 0e", "fault_len": 4, "disasm": "cmpxchg dword ptr ds:[rsi], ecx", "regs_summary": "RAX=0x3 RBX=0x0 RCX=0x28 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Linux futex_detect_cmpxchg probe covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=3", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_futex_04", "family_id": "ctrl_ext_futex", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "futex_detect_cmpxchg+0x0050", "fault_hex": "3e 0f b1 0e", "fault_len": 4, "disasm": "cmpxchg dword ptr ds:[rsi], ecx", "regs_summary": "RAX=0x4 RBX=0x0 RCX=0x30 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Linux futex_detect_cmpxchg probe covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=4", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_strncpy_00", "family_id": "ctrl_ext_strncpy", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x00007f0000001000", "rip_sym": "strncpy_from_user+0x0010", "fault_hex": "48 8b 06", "fault_len": 3, "disasm": "mov rax, qword ptr [rsi]", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x10 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "String copy from user memory covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=0", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_strncpy_01", "family_id": "ctrl_ext_strncpy", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x00007f0000001000", "rip_sym": "strncpy_from_user+0x0020", "fault_hex": "48 8b 06", "fault_len": 3, "disasm": "mov rax, qword ptr [rsi]", "regs_summary": "RAX=0x1 RBX=0x0 RCX=0x18 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "String copy from user memory covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=1", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_strncpy_02", "family_id": "ctrl_ext_strncpy", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x00007f0000001000", "rip_sym": "strncpy_from_user+0x0030", "fault_hex": "48 8b 06", "fault_len": 3, "disasm": "mov rax, qword ptr [rsi]", "regs_summary": "RAX=0x2 RBX=0x0 RCX=0x20 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "String copy from user memory covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=2", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_strncpy_03", "family_id": "ctrl_ext_strncpy", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x00007f0000001000", "rip_sym": "strncpy_from_user+0x0040", "fault_hex": "48 8b 06", "fault_len": 3, "disasm": "mov rax, qword ptr [rsi]", "regs_summary": "RAX=0x3 RBX=0x0 RCX=0x28 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "String copy from user memory covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=3", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_strncpy_04", "family_id": "ctrl_ext_strncpy", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x00007f0000001000", "rip_sym": "strncpy_from_user+0x0050", "fault_hex": "48 8b 06", "fault_len": 3, "disasm": "mov rax, qword ptr [rsi]", "regs_summary": "RAX=0x4 RBX=0x0 RCX=0x30 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "String copy from user memory covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=4", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_warn_driver_00", "family_id": "ctrl_warn_driver", "category": "pass_to_linux", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_warn_check+0x0010", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x10 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Linux WARN_ON_ONCE entry (bug_warn=1); kernel logs warning and continues.", "extable": 0, "bug_warn": 1, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard warn path seq=0", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "warn_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_warn_driver_01", "family_id": "ctrl_warn_driver", "category": "pass_to_linux", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_warn_check+0x0020", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1 RBX=0x0 RCX=0x18 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Linux WARN_ON_ONCE entry (bug_warn=1); kernel logs warning and continues.", "extable": 0, "bug_warn": 1, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard warn path seq=1", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "warn_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_warn_driver_02", "family_id": "ctrl_warn_driver", "category": "pass_to_linux", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_warn_check+0x0030", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x2 RBX=0x0 RCX=0x20 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Linux WARN_ON_ONCE entry (bug_warn=1); kernel logs warning and continues.", "extable": 0, "bug_warn": 1, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard warn path seq=2", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "warn_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_warn_driver_03", "family_id": "ctrl_warn_driver", "category": "pass_to_linux", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_warn_check+0x0040", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x3 RBX=0x0 RCX=0x28 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Linux WARN_ON_ONCE entry (bug_warn=1); kernel logs warning and continues.", "extable": 0, "bug_warn": 1, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard warn path seq=3", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "warn_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_warn_driver_04", "family_id": "ctrl_warn_driver", "category": "pass_to_linux", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_warn_check+0x0050", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x4 RBX=0x0 RCX=0x30 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Linux WARN_ON_ONCE entry (bug_warn=1); kernel logs warning and continues.", "extable": 0, "bug_warn": 1, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard warn path seq=4", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "warn_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_pf_read_00", "family_id": "ctrl_cpl3_pf_read", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 4, "cpl": 3, "cr2": "0x00007ffe91a00000", "rip_sym": "user_app+0x0010", "fault_hex": "8b 00", "fault_len": 2, "disasm": "mov eax, dword ptr [rax]", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x10 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace page fault (demand paging / COW handled by Linux mm).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=0", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_pf_read_01", "family_id": "ctrl_cpl3_pf_read", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 4, "cpl": 3, "cr2": "0x00007ffe91a00000", "rip_sym": "user_app+0x0020", "fault_hex": "8b 00", "fault_len": 2, "disasm": "mov eax, dword ptr [rax]", "regs_summary": "RAX=0x1 RBX=0x0 RCX=0x18 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace page fault (demand paging / COW handled by Linux mm).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=1", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_pf_read_02", "family_id": "ctrl_cpl3_pf_read", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 4, "cpl": 3, "cr2": "0x00007ffe91a00000", "rip_sym": "user_app+0x0030", "fault_hex": "8b 00", "fault_len": 2, "disasm": "mov eax, dword ptr [rax]", "regs_summary": "RAX=0x2 RBX=0x0 RCX=0x20 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace page fault (demand paging / COW handled by Linux mm).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=2", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_pf_read_03", "family_id": "ctrl_cpl3_pf_read", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 4, "cpl": 3, "cr2": "0x00007ffe91a00000", "rip_sym": "user_app+0x0040", "fault_hex": "8b 00", "fault_len": 2, "disasm": "mov eax, dword ptr [rax]", "regs_summary": "RAX=0x3 RBX=0x0 RCX=0x28 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace page fault (demand paging / COW handled by Linux mm).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=3", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_pf_read_04", "family_id": "ctrl_cpl3_pf_read", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 4, "cpl": 3, "cr2": "0x00007ffe91a00000", "rip_sym": "user_app+0x0050", "fault_hex": "8b 00", "fault_len": 2, "disasm": "mov eax, dword ptr [rax]", "regs_summary": "RAX=0x4 RBX=0x0 RCX=0x30 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace page fault (demand paging / COW handled by Linux mm).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=4", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_pf_write_00", "family_id": "ctrl_cpl3_pf_write", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 6, "cpl": 3, "cr2": "0x00007ffe91b00000", "rip_sym": "user_heap+0x0010", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x10 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace COW write fault handled by Linux mm.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=0", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_pf_write_01", "family_id": "ctrl_cpl3_pf_write", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 6, "cpl": 3, "cr2": "0x00007ffe91b00000", "rip_sym": "user_heap+0x0020", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x1 RBX=0x0 RCX=0x18 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace COW write fault handled by Linux mm.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=1", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_pf_write_02", "family_id": "ctrl_cpl3_pf_write", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 6, "cpl": 3, "cr2": "0x00007ffe91b00000", "rip_sym": "user_heap+0x0030", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x2 RBX=0x0 RCX=0x20 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace COW write fault handled by Linux mm.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=2", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_pf_write_03", "family_id": "ctrl_cpl3_pf_write", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 6, "cpl": 3, "cr2": "0x00007ffe91b00000", "rip_sym": "user_heap+0x0040", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x3 RBX=0x0 RCX=0x28 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace COW write fault handled by Linux mm.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=3", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_pf_write_04", "family_id": "ctrl_cpl3_pf_write", "category": "pass_to_linux", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 6, "cpl": 3, "cr2": "0x00007ffe91b00000", "rip_sym": "user_heap+0x0050", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x4 RBX=0x0 RCX=0x30 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace COW write fault handled by Linux mm.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=4", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_de_00", "family_id": "ctrl_cpl3_de", "category": "pass_to_linux", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 3, "cr2": "0x0000000000000000", "rip_sym": "user_calc+0x0010", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x10 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace divide-by-zero (Linux delivers SIGFPE).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=0", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_de_01", "family_id": "ctrl_cpl3_de", "category": "pass_to_linux", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 3, "cr2": "0x0000000000000000", "rip_sym": "user_calc+0x0020", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x1 RBX=0x0 RCX=0x18 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace divide-by-zero (Linux delivers SIGFPE).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=1", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_de_02", "family_id": "ctrl_cpl3_de", "category": "pass_to_linux", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 3, "cr2": "0x0000000000000000", "rip_sym": "user_calc+0x0030", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x2 RBX=0x0 RCX=0x20 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace divide-by-zero (Linux delivers SIGFPE).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=2", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_de_03", "family_id": "ctrl_cpl3_de", "category": "pass_to_linux", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 3, "cr2": "0x0000000000000000", "rip_sym": "user_calc+0x0040", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x3 RBX=0x0 RCX=0x28 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace divide-by-zero (Linux delivers SIGFPE).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=3", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_de_04", "family_id": "ctrl_cpl3_de", "category": "pass_to_linux", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 3, "cr2": "0x0000000000000000", "rip_sym": "user_calc+0x0050", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x4 RBX=0x0 RCX=0x30 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace divide-by-zero (Linux delivers SIGFPE).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=4", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_copy_from_00", "family_id": "ctrl_ext_copy_from", "category": "pass_to_linux", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x00007f1012340000", "rip_sym": "copy_user_fast+0x0010", "fault_hex": "f3 a4", "fault_len": 2, "disasm": "rep movsb byte ptr [rdi], byte ptr [rsi]", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x10 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Demand-paged copy_from_user fault covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=0", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_copy_from_01", "family_id": "ctrl_ext_copy_from", "category": "pass_to_linux", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x00007f1012340000", "rip_sym": "copy_user_fast+0x0020", "fault_hex": "f3 a4", "fault_len": 2, "disasm": "rep movsb byte ptr [rdi], byte ptr [rsi]", "regs_summary": "RAX=0x1 RBX=0x0 RCX=0x18 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Demand-paged copy_from_user fault covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=1", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_copy_from_02", "family_id": "ctrl_ext_copy_from", "category": "pass_to_linux", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x00007f1012340000", "rip_sym": "copy_user_fast+0x0030", "fault_hex": "f3 a4", "fault_len": 2, "disasm": "rep movsb byte ptr [rdi], byte ptr [rsi]", "regs_summary": "RAX=0x2 RBX=0x0 RCX=0x20 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Demand-paged copy_from_user fault covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=2", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_copy_from_03", "family_id": "ctrl_ext_copy_from", "category": "pass_to_linux", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x00007f1012340000", "rip_sym": "copy_user_fast+0x0040", "fault_hex": "f3 a4", "fault_len": 2, "disasm": "rep movsb byte ptr [rdi], byte ptr [rsi]", "regs_summary": "RAX=0x3 RBX=0x0 RCX=0x28 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Demand-paged copy_from_user fault covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=3", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_copy_from_04", "family_id": "ctrl_ext_copy_from", "category": "pass_to_linux", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x00007f1012340000", "rip_sym": "copy_user_fast+0x0050", "fault_hex": "f3 a4", "fault_len": 2, "disasm": "rep movsb byte ptr [rdi], byte ptr [rsi]", "regs_summary": "RAX=0x4 RBX=0x0 RCX=0x30 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Demand-paged copy_from_user fault covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=4", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_warn_net_00", "family_id": "ctrl_warn_net", "category": "pass_to_linux", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "net_warn_once+0x0010", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x10 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Network subsystem WARN_ON_ONCE (bug_warn=1); handled by Linux.", "extable": 0, "bug_warn": 1, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard warn path seq=0", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "warn_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_warn_net_01", "family_id": "ctrl_warn_net", "category": "pass_to_linux", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "net_warn_once+0x0020", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1 RBX=0x0 RCX=0x18 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Network subsystem WARN_ON_ONCE (bug_warn=1); handled by Linux.", "extable": 0, "bug_warn": 1, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard warn path seq=1", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "warn_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_warn_net_02", "family_id": "ctrl_warn_net", "category": "pass_to_linux", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "net_warn_once+0x0030", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x2 RBX=0x0 RCX=0x20 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Network subsystem WARN_ON_ONCE (bug_warn=1); handled by Linux.", "extable": 0, "bug_warn": 1, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard warn path seq=2", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "warn_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_warn_net_03", "family_id": "ctrl_warn_net", "category": "pass_to_linux", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "net_warn_once+0x0040", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x3 RBX=0x0 RCX=0x28 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Network subsystem WARN_ON_ONCE (bug_warn=1); handled by Linux.", "extable": 0, "bug_warn": 1, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard warn path seq=3", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "warn_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_warn_net_04", "family_id": "ctrl_warn_net", "category": "pass_to_linux", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "net_warn_once+0x0050", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x4 RBX=0x0 RCX=0x30 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Network subsystem WARN_ON_ONCE (bug_warn=1); handled by Linux.", "extable": 0, "bug_warn": 1, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard warn path seq=4", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "warn_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_pf_null_00", "family_id": "ctrl_cpl3_pf_null", "category": "pass_to_linux", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 6, "cpl": 3, "cr2": "0x0000000000000000", "rip_sym": "user_segv+0x0010", "fault_hex": "c7 00 01 00 00 00", "fault_len": 6, "disasm": "mov dword ptr [rax], 1", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x10 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace NULL write (Linux delivers SIGSEGV cleanly).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=0", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_pf_null_01", "family_id": "ctrl_cpl3_pf_null", "category": "pass_to_linux", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 6, "cpl": 3, "cr2": "0x0000000000000000", "rip_sym": "user_segv+0x0020", "fault_hex": "c7 00 01 00 00 00", "fault_len": 6, "disasm": "mov dword ptr [rax], 1", "regs_summary": "RAX=0x1 RBX=0x0 RCX=0x18 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace NULL write (Linux delivers SIGSEGV cleanly).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=1", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_pf_null_02", "family_id": "ctrl_cpl3_pf_null", "category": "pass_to_linux", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 6, "cpl": 3, "cr2": "0x0000000000000000", "rip_sym": "user_segv+0x0030", "fault_hex": "c7 00 01 00 00 00", "fault_len": 6, "disasm": "mov dword ptr [rax], 1", "regs_summary": "RAX=0x2 RBX=0x0 RCX=0x20 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace NULL write (Linux delivers SIGSEGV cleanly).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=2", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_pf_null_03", "family_id": "ctrl_cpl3_pf_null", "category": "pass_to_linux", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 6, "cpl": 3, "cr2": "0x0000000000000000", "rip_sym": "user_segv+0x0040", "fault_hex": "c7 00 01 00 00 00", "fault_len": 6, "disasm": "mov dword ptr [rax], 1", "regs_summary": "RAX=0x3 RBX=0x0 RCX=0x28 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace NULL write (Linux delivers SIGSEGV cleanly).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=3", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_pf_null_04", "family_id": "ctrl_cpl3_pf_null", "category": "pass_to_linux", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 6, "cpl": 3, "cr2": "0x0000000000000000", "rip_sym": "user_segv+0x0050", "fault_hex": "c7 00 01 00 00 00", "fault_len": 6, "disasm": "mov dword ptr [rax], 1", "regs_summary": "RAX=0x4 RBX=0x0 RCX=0x30 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace NULL write (Linux delivers SIGSEGV cleanly).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=4", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_probe_rd_00", "family_id": "ctrl_ext_probe_rd", "category": "pass_to_linux", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000040", "rip_sym": "copy_from_kernel_nofault+0x0010", "fault_hex": "8b 06", "fault_len": 2, "disasm": "mov eax, dword ptr [rsi]", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x10 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Kernel nofault memory probe covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=0", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_probe_rd_01", "family_id": "ctrl_ext_probe_rd", "category": "pass_to_linux", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000040", "rip_sym": "copy_from_kernel_nofault+0x0020", "fault_hex": "8b 06", "fault_len": 2, "disasm": "mov eax, dword ptr [rsi]", "regs_summary": "RAX=0x1 RBX=0x0 RCX=0x18 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Kernel nofault memory probe covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=1", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_probe_rd_02", "family_id": "ctrl_ext_probe_rd", "category": "pass_to_linux", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000040", "rip_sym": "copy_from_kernel_nofault+0x0030", "fault_hex": "8b 06", "fault_len": 2, "disasm": "mov eax, dword ptr [rsi]", "regs_summary": "RAX=0x2 RBX=0x0 RCX=0x20 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Kernel nofault memory probe covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=2", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_probe_rd_03", "family_id": "ctrl_ext_probe_rd", "category": "pass_to_linux", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000040", "rip_sym": "copy_from_kernel_nofault+0x0040", "fault_hex": "8b 06", "fault_len": 2, "disasm": "mov eax, dword ptr [rsi]", "regs_summary": "RAX=0x3 RBX=0x0 RCX=0x28 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Kernel nofault memory probe covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=3", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_ext_probe_rd_04", "family_id": "ctrl_ext_probe_rd", "category": "pass_to_linux", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000040", "rip_sym": "copy_from_kernel_nofault+0x0050", "fault_hex": "8b 06", "fault_len": 2, "disasm": "mov eax, dword ptr [rsi]", "regs_summary": "RAX=0x4 RBX=0x0 RCX=0x30 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Kernel nofault memory probe covered by _ASM_EXTABLE.", "extable": 1, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard extable path seq=4", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "extable_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_warn_blk_00", "family_id": "ctrl_warn_blk", "category": "pass_to_linux", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "blk_warn_ratelimit+0x0010", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x10 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Block layer WARN_ON (bug_warn=1); handled cleanly by Linux.", "extable": 0, "bug_warn": 1, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard warn path seq=0", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "warn_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_warn_blk_01", "family_id": "ctrl_warn_blk", "category": "pass_to_linux", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "blk_warn_ratelimit+0x0020", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1 RBX=0x0 RCX=0x18 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Block layer WARN_ON (bug_warn=1); handled cleanly by Linux.", "extable": 0, "bug_warn": 1, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard warn path seq=1", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "warn_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_warn_blk_02", "family_id": "ctrl_warn_blk", "category": "pass_to_linux", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "blk_warn_ratelimit+0x0030", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x2 RBX=0x0 RCX=0x20 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Block layer WARN_ON (bug_warn=1); handled cleanly by Linux.", "extable": 0, "bug_warn": 1, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard warn path seq=2", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "warn_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_warn_blk_03", "family_id": "ctrl_warn_blk", "category": "pass_to_linux", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "blk_warn_ratelimit+0x0040", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x3 RBX=0x0 RCX=0x28 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Block layer WARN_ON (bug_warn=1); handled cleanly by Linux.", "extable": 0, "bug_warn": 1, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard warn path seq=3", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "warn_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_warn_blk_04", "family_id": "ctrl_warn_blk", "category": "pass_to_linux", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "blk_warn_ratelimit+0x0050", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x4 RBX=0x0 RCX=0x30 RSP=0xffffc90000013b80 RFLAGS=0x246", "contract_hint": "Block layer WARN_ON (bug_warn=1); handled cleanly by Linux.", "extable": 0, "bug_warn": 1, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard warn path seq=4", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "warn_test", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_ud_00", "family_id": "ctrl_cpl3_ud", "category": "pass_to_linux", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 3, "cr2": "0x0000000000000000", "rip_sym": "user_sigill+0x0010", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x0 RBX=0x0 RCX=0x10 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace invalid opcode (Linux delivers SIGILL).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=0", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_ud_01", "family_id": "ctrl_cpl3_ud", "category": "pass_to_linux", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 3, "cr2": "0x0000000000000000", "rip_sym": "user_sigill+0x0020", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x1 RBX=0x0 RCX=0x18 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace invalid opcode (Linux delivers SIGILL).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=1", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_ud_02", "family_id": "ctrl_cpl3_ud", "category": "pass_to_linux", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 3, "cr2": "0x0000000000000000", "rip_sym": "user_sigill+0x0030", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x2 RBX=0x0 RCX=0x20 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace invalid opcode (Linux delivers SIGILL).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=2", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_ud_03", "family_id": "ctrl_cpl3_ud", "category": "pass_to_linux", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 3, "cr2": "0x0000000000000000", "rip_sym": "user_sigill+0x0040", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x3 RBX=0x0 RCX=0x28 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace invalid opcode (Linux delivers SIGILL).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=3", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "ctrl_cpl3_ud_04", "family_id": "ctrl_cpl3_ud", "category": "pass_to_linux", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 3, "cr2": "0x0000000000000000", "rip_sym": "user_sigill+0x0050", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x4 RBX=0x0 RCX=0x30 RSP=0x7ffe919ff000 RFLAGS=0x246", "contract_hint": "Ring 3 userspace invalid opcode (Linux delivers SIGILL).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "linux: standard ring3 path seq=4", "expected_action": "PASS_TO_LINUX", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_spinlock_00", "family_id": "halt_pf_spinlock", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tx+0x001c", "fault_hex": "c7 04 25 00 00 00 00 ef be ad de", "fault_len": 11, "disasm": "mov dword ptr [0], 0xdeadbeef", "regs_summary": "RAX=0x20 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL write while holding spinlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tx: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=0", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "c7042500000000efbeadde", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_spinlock_01", "family_id": "halt_pf_spinlock", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tx+0x002c", "fault_hex": "c7 04 25 00 00 00 00 ef be ad de", "fault_len": 11, "disasm": "mov dword ptr [0], 0xdeadbeef", "regs_summary": "RAX=0x21 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL write while holding spinlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tx: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=1", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "c7042500000000efbeadde", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_spinlock_02", "family_id": "halt_pf_spinlock", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tx+0x003c", "fault_hex": "c7 04 25 00 00 00 00 ef be ad de", "fault_len": 11, "disasm": "mov dword ptr [0], 0xdeadbeef", "regs_summary": "RAX=0x22 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL write while holding spinlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tx: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=2", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "c7042500000000efbeadde", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_spinlock_03", "family_id": "halt_pf_spinlock", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tx+0x004c", "fault_hex": "c7 04 25 00 00 00 00 ef be ad de", "fault_len": 11, "disasm": "mov dword ptr [0], 0xdeadbeef", "regs_summary": "RAX=0x23 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL write while holding spinlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tx: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=3", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "c7042500000000efbeadde", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_spinlock_04", "family_id": "halt_pf_spinlock", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_tx+0x005c", "fault_hex": "c7 04 25 00 00 00 00 ef be ad de", "fault_len": 11, "disasm": "mov dword ptr [0], 0xdeadbeef", "regs_summary": "RAX=0x24 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL write while holding spinlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_tx: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=4", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "c7042500000000efbeadde", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_dma_dirty_00", "family_id": "halt_pf_dma_dirty", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_blk+0x001c", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x20 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL store after DMA descriptor already submitted (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_blk: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=0", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8910", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_dma_dirty_01", "family_id": "halt_pf_dma_dirty", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_blk+0x002c", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x21 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL store after DMA descriptor already submitted (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_blk: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=1", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8910", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_dma_dirty_02", "family_id": "halt_pf_dma_dirty", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_blk+0x003c", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x22 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL store after DMA descriptor already submitted (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_blk: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=2", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8910", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_dma_dirty_03", "family_id": "halt_pf_dma_dirty", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_blk+0x004c", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x23 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL store after DMA descriptor already submitted (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_blk: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=3", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8910", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_dma_dirty_04", "family_id": "halt_pf_dma_dirty", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_blk+0x005c", "fault_hex": "89 10", "fault_len": 2, "disasm": "mov dword ptr [rax], edx", "regs_summary": "RAX=0x24 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL store after DMA descriptor already submitted (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_blk: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=4", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8910", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_hardirq_00", "family_id": "halt_pf_hardirq", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_isr+0x001c", "fault_hex": "c6 00 01", "fault_len": 3, "disasm": "mov byte ptr [rax], 1", "regs_summary": "RAX=0x20 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL byte store inside hard IRQ handler (irq_ctx=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 1, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_isr: hazard lock=0 irq=1 dirty=0 stack_ok=1 obs_ok=1 seq=0", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "c60001", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_hardirq_01", "family_id": "halt_pf_hardirq", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_isr+0x002c", "fault_hex": "c6 00 01", "fault_len": 3, "disasm": "mov byte ptr [rax], 1", "regs_summary": "RAX=0x21 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL byte store inside hard IRQ handler (irq_ctx=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 1, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_isr: hazard lock=0 irq=1 dirty=0 stack_ok=1 obs_ok=1 seq=1", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "c60001", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_hardirq_02", "family_id": "halt_pf_hardirq", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_isr+0x003c", "fault_hex": "c6 00 01", "fault_len": 3, "disasm": "mov byte ptr [rax], 1", "regs_summary": "RAX=0x22 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL byte store inside hard IRQ handler (irq_ctx=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 1, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_isr: hazard lock=0 irq=1 dirty=0 stack_ok=1 obs_ok=1 seq=2", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "c60001", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_hardirq_03", "family_id": "halt_pf_hardirq", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_isr+0x004c", "fault_hex": "c6 00 01", "fault_len": 3, "disasm": "mov byte ptr [rax], 1", "regs_summary": "RAX=0x23 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL byte store inside hard IRQ handler (irq_ctx=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 1, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_isr: hazard lock=0 irq=1 dirty=0 stack_ok=1 obs_ok=1 seq=3", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "c60001", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_hardirq_04", "family_id": "halt_pf_hardirq", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_isr+0x005c", "fault_hex": "c6 00 01", "fault_len": 3, "disasm": "mov byte ptr [rax], 1", "regs_summary": "RAX=0x24 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL byte store inside hard IRQ handler (irq_ctx=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 1, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_isr: hazard lock=0 irq=1 dirty=0 stack_ok=1 obs_ok=1 seq=4", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "c60001", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_load_lock_00", "family_id": "halt_pf_load_lock", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000010", "rip_sym": "kdrv_cfg_lk+0x001c", "fault_hex": "8b 43 10", "fault_len": 3, "disasm": "mov eax, dword ptr [rbx + 0x10]", "regs_summary": "RAX=0x20 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL struct load while holding mutex/spinlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_cfg_lk: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=0", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8b4310", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_load_lock_01", "family_id": "halt_pf_load_lock", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000010", "rip_sym": "kdrv_cfg_lk+0x002c", "fault_hex": "8b 43 10", "fault_len": 3, "disasm": "mov eax, dword ptr [rbx + 0x10]", "regs_summary": "RAX=0x21 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL struct load while holding mutex/spinlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_cfg_lk: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=1", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8b4310", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_load_lock_02", "family_id": "halt_pf_load_lock", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000010", "rip_sym": "kdrv_cfg_lk+0x003c", "fault_hex": "8b 43 10", "fault_len": 3, "disasm": "mov eax, dword ptr [rbx + 0x10]", "regs_summary": "RAX=0x22 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL struct load while holding mutex/spinlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_cfg_lk: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=2", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8b4310", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_load_lock_03", "family_id": "halt_pf_load_lock", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000010", "rip_sym": "kdrv_cfg_lk+0x004c", "fault_hex": "8b 43 10", "fault_len": 3, "disasm": "mov eax, dword ptr [rbx + 0x10]", "regs_summary": "RAX=0x23 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL struct load while holding mutex/spinlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_cfg_lk: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=3", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8b4310", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_pf_load_lock_04", "family_id": "halt_pf_load_lock", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000010", "rip_sym": "kdrv_cfg_lk+0x005c", "fault_hex": "8b 43 10", "fault_len": 3, "disasm": "mov eax, dword ptr [rbx + 0x10]", "regs_summary": "RAX=0x24 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL struct load while holding mutex/spinlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_cfg_lk: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=4", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8b4310", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_de_journal_00", "family_id": "halt_de_journal", "category": "halt_for_dump", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_jnl+0x001c", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x20 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 divide-by-zero after journal header already flushed (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_jnl: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=0", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "f7f1", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_de_journal_01", "family_id": "halt_de_journal", "category": "halt_for_dump", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_jnl+0x002c", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x21 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 divide-by-zero after journal header already flushed (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_jnl: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=1", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "f7f1", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_de_journal_02", "family_id": "halt_de_journal", "category": "halt_for_dump", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_jnl+0x003c", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x22 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 divide-by-zero after journal header already flushed (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_jnl: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=2", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "f7f1", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_de_journal_03", "family_id": "halt_de_journal", "category": "halt_for_dump", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_jnl+0x004c", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x23 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 divide-by-zero after journal header already flushed (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_jnl: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=3", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "f7f1", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_de_journal_04", "family_id": "halt_de_journal", "category": "halt_for_dump", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_jnl+0x005c", "fault_hex": "f7 f1", "fault_len": 2, "disasm": "div ecx", "regs_summary": "RAX=0x24 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 divide-by-zero after journal header already flushed (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_jnl: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=4", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "f7f1", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_de_rwlock_00", "family_id": "halt_de_rwlock", "category": "halt_for_dump", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sched+0x001c", "fault_hex": "f7 fe", "fault_len": 2, "disasm": "idiv esi", "regs_summary": "RAX=0x20 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 signed divide-by-zero while holding rwlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sched: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=0", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "f7fe", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_de_rwlock_01", "family_id": "halt_de_rwlock", "category": "halt_for_dump", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sched+0x002c", "fault_hex": "f7 fe", "fault_len": 2, "disasm": "idiv esi", "regs_summary": "RAX=0x21 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 signed divide-by-zero while holding rwlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sched: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=1", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "f7fe", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_de_rwlock_02", "family_id": "halt_de_rwlock", "category": "halt_for_dump", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sched+0x003c", "fault_hex": "f7 fe", "fault_len": 2, "disasm": "idiv esi", "regs_summary": "RAX=0x22 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 signed divide-by-zero while holding rwlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sched: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=2", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "f7fe", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_de_rwlock_03", "family_id": "halt_de_rwlock", "category": "halt_for_dump", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sched+0x004c", "fault_hex": "f7 fe", "fault_len": 2, "disasm": "idiv esi", "regs_summary": "RAX=0x23 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 signed divide-by-zero while holding rwlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sched: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=3", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "f7fe", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_de_rwlock_04", "family_id": "halt_de_rwlock", "category": "halt_for_dump", "split": "train", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_sched+0x005c", "fault_hex": "f7 fe", "fault_len": 2, "disasm": "idiv esi", "regs_summary": "RAX=0x24 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 signed divide-by-zero while holding rwlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_sched: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=4", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "f7fe", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_ud_bug_dirty_00", "family_id": "halt_ud_bug_dirty", "category": "halt_for_dump", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_fs_bug+0x001c", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x20 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Hard BUG_ON invariant failure after metadata write (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_fs_bug: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=0", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0f0b", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_ud_bug_dirty_01", "family_id": "halt_ud_bug_dirty", "category": "halt_for_dump", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_fs_bug+0x002c", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x21 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Hard BUG_ON invariant failure after metadata write (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_fs_bug: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=1", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0f0b", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_ud_bug_dirty_02", "family_id": "halt_ud_bug_dirty", "category": "halt_for_dump", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_fs_bug+0x003c", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x22 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Hard BUG_ON invariant failure after metadata write (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_fs_bug: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=2", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0f0b", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_ud_bug_dirty_03", "family_id": "halt_ud_bug_dirty", "category": "halt_for_dump", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_fs_bug+0x004c", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x23 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Hard BUG_ON invariant failure after metadata write (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_fs_bug: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=3", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0f0b", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_ud_bug_dirty_04", "family_id": "halt_ud_bug_dirty", "category": "halt_for_dump", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_fs_bug+0x005c", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x24 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Hard BUG_ON invariant failure after metadata write (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_fs_bug: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=4", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0f0b", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_ud_lock_00", "family_id": "halt_ud_lock", "category": "halt_for_dump", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_mm_bug+0x001c", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x20 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 UD1 trap while holding page-table spinlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_mm_bug: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=0", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0fb9c0", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_ud_lock_01", "family_id": "halt_ud_lock", "category": "halt_for_dump", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_mm_bug+0x002c", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x21 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 UD1 trap while holding page-table spinlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_mm_bug: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=1", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0fb9c0", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_ud_lock_02", "family_id": "halt_ud_lock", "category": "halt_for_dump", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_mm_bug+0x003c", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x22 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 UD1 trap while holding page-table spinlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_mm_bug: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=2", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0fb9c0", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_ud_lock_03", "family_id": "halt_ud_lock", "category": "halt_for_dump", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_mm_bug+0x004c", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x23 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 UD1 trap while holding page-table spinlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_mm_bug: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=3", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0fb9c0", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_ud_lock_04", "family_id": "halt_ud_lock", "category": "halt_for_dump", "split": "train", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_mm_bug+0x005c", "fault_hex": "0f b9 c0", "fault_len": 3, "disasm": "ud1", "regs_summary": "RAX=0x24 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 UD1 trap while holding page-table spinlock (lock_held=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_mm_bug: hazard lock=1 irq=0 dirty=0 stack_ok=1 obs_ok=1 seq=4", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0fb9c0", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_stack_pf_00", "family_id": "halt_stack_pf", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ovf+0x001c", "fault_hex": "89 08", "fault_len": 2, "disasm": "mov dword ptr [rax], ecx", "regs_summary": "RAX=0x20 RBX=0x0 RCX=0x0 RSP=0x0000000000000008 RFLAGS=0x246", "contract_hint": "Ring 0 fault with corrupted kernel stack pointer (stack_ok=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 0, "obs_complete": 1, "log_tail": "kdrv_ovf: hazard lock=0 irq=0 dirty=0 stack_ok=0 obs_ok=1 seq=0", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8908", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_stack_pf_01", "family_id": "halt_stack_pf", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ovf+0x002c", "fault_hex": "89 08", "fault_len": 2, "disasm": "mov dword ptr [rax], ecx", "regs_summary": "RAX=0x21 RBX=0x0 RCX=0x0 RSP=0x0000000000000008 RFLAGS=0x246", "contract_hint": "Ring 0 fault with corrupted kernel stack pointer (stack_ok=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 0, "obs_complete": 1, "log_tail": "kdrv_ovf: hazard lock=0 irq=0 dirty=0 stack_ok=0 obs_ok=1 seq=1", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8908", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_stack_pf_02", "family_id": "halt_stack_pf", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ovf+0x003c", "fault_hex": "89 08", "fault_len": 2, "disasm": "mov dword ptr [rax], ecx", "regs_summary": "RAX=0x22 RBX=0x0 RCX=0x0 RSP=0x0000000000000008 RFLAGS=0x246", "contract_hint": "Ring 0 fault with corrupted kernel stack pointer (stack_ok=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 0, "obs_complete": 1, "log_tail": "kdrv_ovf: hazard lock=0 irq=0 dirty=0 stack_ok=0 obs_ok=1 seq=2", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8908", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_stack_pf_03", "family_id": "halt_stack_pf", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ovf+0x004c", "fault_hex": "89 08", "fault_len": 2, "disasm": "mov dword ptr [rax], ecx", "regs_summary": "RAX=0x23 RBX=0x0 RCX=0x0 RSP=0x0000000000000008 RFLAGS=0x246", "contract_hint": "Ring 0 fault with corrupted kernel stack pointer (stack_ok=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 0, "obs_complete": 1, "log_tail": "kdrv_ovf: hazard lock=0 irq=0 dirty=0 stack_ok=0 obs_ok=1 seq=3", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8908", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_stack_pf_04", "family_id": "halt_stack_pf", "category": "halt_for_dump", "split": "train", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_ovf+0x005c", "fault_hex": "89 08", "fault_len": 2, "disasm": "mov dword ptr [rax], ecx", "regs_summary": "RAX=0x24 RBX=0x0 RCX=0x0 RSP=0x0000000000000008 RFLAGS=0x246", "contract_hint": "Ring 0 fault with corrupted kernel stack pointer (stack_ok=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 0, "obs_complete": 1, "log_tail": "kdrv_ovf: hazard lock=0 irq=0 dirty=0 stack_ok=0 obs_ok=1 seq=4", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8908", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_val_de_irq_00", "family_id": "halt_val_de_irq", "category": "halt_for_dump", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_timer+0x001c", "fault_hex": "41 f7 f0", "fault_len": 3, "disasm": "div r8d", "regs_summary": "RAX=0x20 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 divide-by-zero inside timer IRQ context (irq_ctx=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 1, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_timer: hazard lock=0 irq=1 dirty=0 stack_ok=1 obs_ok=1 seq=0", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "41f7f0", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_val_de_irq_01", "family_id": "halt_val_de_irq", "category": "halt_for_dump", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_timer+0x002c", "fault_hex": "41 f7 f0", "fault_len": 3, "disasm": "div r8d", "regs_summary": "RAX=0x21 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 divide-by-zero inside timer IRQ context (irq_ctx=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 1, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_timer: hazard lock=0 irq=1 dirty=0 stack_ok=1 obs_ok=1 seq=1", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "41f7f0", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_val_de_irq_02", "family_id": "halt_val_de_irq", "category": "halt_for_dump", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_timer+0x003c", "fault_hex": "41 f7 f0", "fault_len": 3, "disasm": "div r8d", "regs_summary": "RAX=0x22 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 divide-by-zero inside timer IRQ context (irq_ctx=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 1, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_timer: hazard lock=0 irq=1 dirty=0 stack_ok=1 obs_ok=1 seq=2", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "41f7f0", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_val_de_irq_03", "family_id": "halt_val_de_irq", "category": "halt_for_dump", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_timer+0x004c", "fault_hex": "41 f7 f0", "fault_len": 3, "disasm": "div r8d", "regs_summary": "RAX=0x23 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 divide-by-zero inside timer IRQ context (irq_ctx=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 1, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_timer: hazard lock=0 irq=1 dirty=0 stack_ok=1 obs_ok=1 seq=3", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "41f7f0", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_val_de_irq_04", "family_id": "halt_val_de_irq", "category": "halt_for_dump", "split": "val", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_timer+0x005c", "fault_hex": "41 f7 f0", "fault_len": 3, "disasm": "div r8d", "regs_summary": "RAX=0x24 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 divide-by-zero inside timer IRQ context (irq_ctx=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 1, "side_effect": 0, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_timer: hazard lock=0 irq=1 dirty=0 stack_ok=1 obs_ok=1 seq=4", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "41f7f0", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_val_obs_pf_00", "family_id": "halt_val_obs_pf", "category": "halt_for_dump", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_unk_pf+0x001c", "fault_hex": "48 89 10", "fault_len": 3, "disasm": "mov qword ptr [rax], rdx", "regs_summary": "RAX=0x20 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Incomplete Ring -1 telemetry snapshot (obs_complete=0); unsafe to patch.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 0, "log_tail": "kdrv_unk_pf: hazard lock=0 irq=0 dirty=0 stack_ok=1 obs_ok=0 seq=0", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "488910", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_val_obs_pf_01", "family_id": "halt_val_obs_pf", "category": "halt_for_dump", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_unk_pf+0x002c", "fault_hex": "48 89 10", "fault_len": 3, "disasm": "mov qword ptr [rax], rdx", "regs_summary": "RAX=0x21 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Incomplete Ring -1 telemetry snapshot (obs_complete=0); unsafe to patch.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 0, "log_tail": "kdrv_unk_pf: hazard lock=0 irq=0 dirty=0 stack_ok=1 obs_ok=0 seq=1", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "488910", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_val_obs_pf_02", "family_id": "halt_val_obs_pf", "category": "halt_for_dump", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_unk_pf+0x003c", "fault_hex": "48 89 10", "fault_len": 3, "disasm": "mov qword ptr [rax], rdx", "regs_summary": "RAX=0x22 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Incomplete Ring -1 telemetry snapshot (obs_complete=0); unsafe to patch.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 0, "log_tail": "kdrv_unk_pf: hazard lock=0 irq=0 dirty=0 stack_ok=1 obs_ok=0 seq=2", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "488910", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_val_obs_pf_03", "family_id": "halt_val_obs_pf", "category": "halt_for_dump", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_unk_pf+0x004c", "fault_hex": "48 89 10", "fault_len": 3, "disasm": "mov qword ptr [rax], rdx", "regs_summary": "RAX=0x23 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Incomplete Ring -1 telemetry snapshot (obs_complete=0); unsafe to patch.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 0, "log_tail": "kdrv_unk_pf: hazard lock=0 irq=0 dirty=0 stack_ok=1 obs_ok=0 seq=3", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "488910", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_val_obs_pf_04", "family_id": "halt_val_obs_pf", "category": "halt_for_dump", "split": "val", "exc_name": "#PF", "exc_vec": 14, "err_code": 2, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_unk_pf+0x005c", "fault_hex": "48 89 10", "fault_len": 3, "disasm": "mov qword ptr [rax], rdx", "regs_summary": "RAX=0x24 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Incomplete Ring -1 telemetry snapshot (obs_complete=0); unsafe to patch.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 0, "log_tail": "kdrv_unk_pf: hazard lock=0 irq=0 dirty=0 stack_ok=1 obs_ok=0 seq=4", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "488910", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_val_multi_00", "family_id": "halt_val_multi", "category": "halt_for_dump", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_net_tx+0x001c", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x20 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 BUG_ON with spinlock held and TX ring mutated (lock_held=1, side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_net_tx: hazard lock=1 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=0", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0f0b", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_val_multi_01", "family_id": "halt_val_multi", "category": "halt_for_dump", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_net_tx+0x002c", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x21 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 BUG_ON with spinlock held and TX ring mutated (lock_held=1, side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_net_tx: hazard lock=1 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=1", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0f0b", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_val_multi_02", "family_id": "halt_val_multi", "category": "halt_for_dump", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_net_tx+0x003c", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x22 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 BUG_ON with spinlock held and TX ring mutated (lock_held=1, side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_net_tx: hazard lock=1 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=2", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0f0b", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_val_multi_03", "family_id": "halt_val_multi", "category": "halt_for_dump", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_net_tx+0x004c", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x23 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 BUG_ON with spinlock held and TX ring mutated (lock_held=1, side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_net_tx: hazard lock=1 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=3", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0f0b", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_val_multi_04", "family_id": "halt_val_multi", "category": "halt_for_dump", "split": "val", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_net_tx+0x005c", "fault_hex": "0f 0b", "fault_len": 2, "disasm": "ud2", "regs_summary": "RAX=0x24 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 BUG_ON with spinlock held and TX ring mutated (lock_held=1, side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 1, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_net_tx: hazard lock=1 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=4", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0f0b", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_test_stack_de_00", "family_id": "halt_test_stack_de", "category": "halt_for_dump", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_stk_de+0x001c", "fault_hex": "41 f7 f9", "fault_len": 3, "disasm": "idiv r9d", "regs_summary": "RAX=0x20 RBX=0x0 RCX=0x0 RSP=0x0000000000000008 RFLAGS=0x246", "contract_hint": "Ring 0 divide-by-zero with invalid kernel RSP (stack_ok=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 0, "obs_complete": 1, "log_tail": "kdrv_stk_de: hazard lock=0 irq=0 dirty=0 stack_ok=0 obs_ok=1 seq=0", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "41f7f9", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_test_stack_de_01", "family_id": "halt_test_stack_de", "category": "halt_for_dump", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_stk_de+0x002c", "fault_hex": "41 f7 f9", "fault_len": 3, "disasm": "idiv r9d", "regs_summary": "RAX=0x21 RBX=0x0 RCX=0x0 RSP=0x0000000000000008 RFLAGS=0x246", "contract_hint": "Ring 0 divide-by-zero with invalid kernel RSP (stack_ok=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 0, "obs_complete": 1, "log_tail": "kdrv_stk_de: hazard lock=0 irq=0 dirty=0 stack_ok=0 obs_ok=1 seq=1", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "41f7f9", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_test_stack_de_02", "family_id": "halt_test_stack_de", "category": "halt_for_dump", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_stk_de+0x003c", "fault_hex": "41 f7 f9", "fault_len": 3, "disasm": "idiv r9d", "regs_summary": "RAX=0x22 RBX=0x0 RCX=0x0 RSP=0x0000000000000008 RFLAGS=0x246", "contract_hint": "Ring 0 divide-by-zero with invalid kernel RSP (stack_ok=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 0, "obs_complete": 1, "log_tail": "kdrv_stk_de: hazard lock=0 irq=0 dirty=0 stack_ok=0 obs_ok=1 seq=2", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "41f7f9", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_test_stack_de_03", "family_id": "halt_test_stack_de", "category": "halt_for_dump", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_stk_de+0x004c", "fault_hex": "41 f7 f9", "fault_len": 3, "disasm": "idiv r9d", "regs_summary": "RAX=0x23 RBX=0x0 RCX=0x0 RSP=0x0000000000000008 RFLAGS=0x246", "contract_hint": "Ring 0 divide-by-zero with invalid kernel RSP (stack_ok=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 0, "obs_complete": 1, "log_tail": "kdrv_stk_de: hazard lock=0 irq=0 dirty=0 stack_ok=0 obs_ok=1 seq=3", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "41f7f9", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_test_stack_de_04", "family_id": "halt_test_stack_de", "category": "halt_for_dump", "split": "test", "exc_name": "#DE", "exc_vec": 0, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_stk_de+0x005c", "fault_hex": "41 f7 f9", "fault_len": 3, "disasm": "idiv r9d", "regs_summary": "RAX=0x24 RBX=0x0 RCX=0x0 RSP=0x0000000000000008 RFLAGS=0x246", "contract_hint": "Ring 0 divide-by-zero with invalid kernel RSP (stack_ok=0).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 0, "obs_complete": 1, "log_tail": "kdrv_stk_de: hazard lock=0 irq=0 dirty=0 stack_ok=0 obs_ok=1 seq=4", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "41f7f9", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_test_obs_ud_00", "family_id": "halt_test_obs_ud", "category": "halt_for_dump", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_unk_ud+0x001c", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x20 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Truncated telemetry on Ring 0 #UD (obs_complete=0); halt for dump.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 0, "log_tail": "kdrv_unk_ud: hazard lock=0 irq=0 dirty=0 stack_ok=1 obs_ok=0 seq=0", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0fffc0", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_test_obs_ud_01", "family_id": "halt_test_obs_ud", "category": "halt_for_dump", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_unk_ud+0x002c", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x21 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Truncated telemetry on Ring 0 #UD (obs_complete=0); halt for dump.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 0, "log_tail": "kdrv_unk_ud: hazard lock=0 irq=0 dirty=0 stack_ok=1 obs_ok=0 seq=1", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0fffc0", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_test_obs_ud_02", "family_id": "halt_test_obs_ud", "category": "halt_for_dump", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_unk_ud+0x003c", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x22 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Truncated telemetry on Ring 0 #UD (obs_complete=0); halt for dump.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 0, "log_tail": "kdrv_unk_ud: hazard lock=0 irq=0 dirty=0 stack_ok=1 obs_ok=0 seq=2", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0fffc0", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_test_obs_ud_03", "family_id": "halt_test_obs_ud", "category": "halt_for_dump", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_unk_ud+0x004c", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x23 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Truncated telemetry on Ring 0 #UD (obs_complete=0); halt for dump.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 0, "log_tail": "kdrv_unk_ud: hazard lock=0 irq=0 dirty=0 stack_ok=1 obs_ok=0 seq=3", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0fffc0", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_test_obs_ud_04", "family_id": "halt_test_obs_ud", "category": "halt_for_dump", "split": "test", "exc_name": "#UD", "exc_vec": 6, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000000", "rip_sym": "kdrv_unk_ud+0x005c", "fault_hex": "0f ff c0", "fault_len": 3, "disasm": "ud0", "regs_summary": "RAX=0x24 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Truncated telemetry on Ring 0 #UD (obs_complete=0); halt for dump.", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 0, "stack_ok": 1, "obs_complete": 0, "log_tail": "kdrv_unk_ud: hazard lock=0 irq=0 dirty=0 stack_ok=1 obs_ok=0 seq=4", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "0fffc0", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_test_side_pf_00", "family_id": "halt_test_side_pf", "category": "halt_for_dump", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000008", "rip_sym": "kdrv_nvme+0x001c", "fault_hex": "8b 46 08", "fault_len": 3, "disasm": "mov eax, dword ptr [rsi + 8]", "regs_summary": "RAX=0x20 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL struct read after NVMe doorbell already rung (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_nvme: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=0", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8b4608", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_test_side_pf_01", "family_id": "halt_test_side_pf", "category": "halt_for_dump", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000008", "rip_sym": "kdrv_nvme+0x002c", "fault_hex": "8b 46 08", "fault_len": 3, "disasm": "mov eax, dword ptr [rsi + 8]", "regs_summary": "RAX=0x21 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL struct read after NVMe doorbell already rung (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_nvme: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=1", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8b4608", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_test_side_pf_02", "family_id": "halt_test_side_pf", "category": "halt_for_dump", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000008", "rip_sym": "kdrv_nvme+0x003c", "fault_hex": "8b 46 08", "fault_len": 3, "disasm": "mov eax, dword ptr [rsi + 8]", "regs_summary": "RAX=0x22 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL struct read after NVMe doorbell already rung (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_nvme: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=2", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8b4608", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_test_side_pf_03", "family_id": "halt_test_side_pf", "category": "halt_for_dump", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000008", "rip_sym": "kdrv_nvme+0x004c", "fault_hex": "8b 46 08", "fault_len": 3, "disasm": "mov eax, dword ptr [rsi + 8]", "regs_summary": "RAX=0x23 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL struct read after NVMe doorbell already rung (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_nvme: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=3", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8b4608", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
+{"scenario_id": "halt_test_side_pf_04", "family_id": "halt_test_side_pf", "category": "halt_for_dump", "split": "test", "exc_name": "#PF", "exc_vec": 14, "err_code": 0, "cpl": 0, "cr2": "0x0000000000000008", "rip_sym": "kdrv_nvme+0x005c", "fault_hex": "8b 46 08", "fault_len": 3, "disasm": "mov eax, dword ptr [rsi + 8]", "regs_summary": "RAX=0x24 RBX=0x0 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246", "contract_hint": "Ring 0 NULL struct read after NVMe doorbell already rung (side_effect=1).", "extable": 0, "bug_warn": 0, "lock_held": 0, "irq_ctx": 0, "side_effect": 1, "stack_ok": 1, "obs_complete": 1, "log_tail": "kdrv_nvme: hazard lock=0 irq=0 dirty=1 stack_ok=1 obs_ok=1 seq=4", "expected_action": "HALT_FOR_DUMP", "ref_patch_hex": "NONE", "kvm_mode": "policy_only", "stub_hex": "8b4608", "patch_off": 0, "expect_out_hex": "ffffffffffffffff", "expect_ret_hex": "ffffffffffffffff"}
diff --git a/04-ring1-kernel-surgeon/dataset/scenarios_600.py b/04-ring1-kernel-surgeon/dataset/scenarios_600.py
new file mode 100644
index 0000000..5d8aaa5
--- /dev/null
+++ b/04-ring1-kernel-surgeon/dataset/scenarios_600.py
@@ -0,0 +1,292 @@
+#!/usr/bin/env python3
+"""
+Ring -1 Kernel Surgeon — Full 600-Scenario Benchmark & Training Suite (Stage 2.2)
+Balanced 4-family corpus (160 #PF + 150 #DE + 140 #UD + 75 PASS_TO_LINUX + 75 HALT_FOR_DUMP = 600)
+Family-level split (356 train / 122 val / 122 test) — ZERO family overlap!
+Every executable stub is real x86-64 System V ABI verified in single-level QEMU/KVM Ring 0.
+"""
+from __future__ import annotations
+import json
+import sys
+from collections import Counter
+from dataclasses import asdict
+from typing import List
+
+import os
+ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+sys.path.insert(0, ROOT_DIR)
+from dataset.scenarios import Scenario, disasm_hex, fmt_spaced_hex
+
+def build_600_scenarios() -> List[Scenario]:
+ S: List[Scenario] = []
+
+ def add_exec(
+ sid, fam, cat, split, exc_name, vec, err, cr2, rip_sym,
+ prefix_hex, fault_hex, suffix_hex, regs, contract,
+ expect_out, expect_ret, ref_patch, log_tail,
+ lock_held=0, irq_ctx=0, side_effect=0, stack_ok=1, obs_complete=1,
+ expected_action="PATCH_BYTES"
+ ):
+ p = prefix_hex.replace(" ", "").lower()
+ f = fault_hex.replace(" ", "").lower()
+ sf = suffix_hex.replace(" ", "").lower()
+ full = p + f + sf
+ poff = len(p) // 2
+ flen = len(f) // 2
+ S.append(Scenario(
+ scenario_id=sid, family_id=fam, category=cat, split=split,
+ exc_name=exc_name, exc_vec=vec, err_code=err, cpl=0, cr2=cr2,
+ rip_sym=rip_sym, fault_hex=fmt_spaced_hex(f), fault_len=flen,
+ disasm=disasm_hex(f), regs_summary=regs, contract_hint=contract,
+ extable=0, bug_warn=0, lock_held=lock_held, irq_ctx=irq_ctx,
+ side_effect=side_effect, stack_ok=stack_ok, obs_complete=obs_complete,
+ log_tail=log_tail, expected_action=expected_action,
+ ref_patch_hex=fmt_spaced_hex(ref_patch) if ref_patch != "NONE" else "NONE",
+ kvm_mode="exec" if expected_action == "PATCH_BYTES" else "policy_only",
+ stub_hex=full, patch_off=poff,
+ expect_out_hex=expect_out, expect_ret_hex=expect_ret,
+ ))
+
+ def le32(v: int) -> str:
+ return v.to_bytes(4, "little").hex()
+
+ # =========================================================================
+ # 1. PATCHABLE RING 0 #PF (160 scenarios: 20 families x 8 variants)
+ # Split by family: 12 train (96), 4 val (32), 4 test (32)
+ # =========================================================================
+ pf_store_fams = [
+ # (fam_name, split, fault_builder, prefix_hex, regs_fmt, mod_prefix, len_bytes)
+ ("pf_abs_u32_imm", "train", lambda i: "c7042500000000" + le32(0xdead0001 + i*17), "31c0", "RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0", "kdrv_tel", 11),
+ ("pf_abs_u8_imm", "train", lambda i: "c6042500000000" + f"{(i+1)&0xff:02x}", "31c0", "RAX=0x0 RBX=0x1 RCX=0x0 RDX=0x0", "kdrv_mark", 8),
+ ("pf_reg_rax_edx", "train", lambda i: "8910", lambda i: "31c0ba" + le32(0x10+i), "RAX=0x0 RDX=0x{v:x} RCX=0x0", "kdrv_ring", 2),
+ ("pf_reg_rax_ecx", "train", lambda i: "8908", lambda i: "31c0b9" + le32(0x20+i), "RAX=0x0 RCX=0x{v:x} RDX=0x0", "kdrv_stat", 2),
+ ("pf_reg_rsi_edx", "train", lambda i: "8916", lambda i: "31c031f6ba" + le32(0x30+i), "RAX=0x0 RSI=0x0 RDX=0x{v:x}", "kdrv_slot", 2),
+ ("pf_byte_rax", "train", lambda i: "c600" + f"{(i+1)&0xff:02x}", "31c0", "RAX=0x0 RBX=0x0 RDX=0x1", "kdrv_flag", 3),
+ ("pf_byte_rsi", "train", lambda i: "c606" + f"{(i+5)&0xff:02x}", "31c031f6", "RAX=0x0 RSI=0x0 RDX=0x1", "kdrv_tag", 3),
+ ("pf_imm32_rax", "train", lambda i: "c700" + le32(0x100+i*13), "31c0", "RAX=0x0 RBX=0x0 RCX=0x0", "kdrv_dbg", 6),
+ ("pf_qword_rax_rdx","val", lambda i: "488910", lambda i: "31c0ba" + le32(0x40+i), "RAX=0x0 RDX=0x{v:x} RCX=0x0", "kdrv_aud", 3),
+ ("pf_qword_rax_rcx","val", lambda i: "488908", lambda i: "31c0b9" + le32(0x50+i), "RAX=0x0 RCX=0x{v:x} RDX=0x0", "kdrv_log", 3),
+ ("pf_byte_rcx", "test", lambda i: "c601" + f"{(i+9)&0xff:02x}", "31c031c9", "RAX=0x0 RCX=0x0 RDX=0x0", "kdrv_evt", 3),
+ ("pf_qword_rsi_rdx","test", lambda i: "488916", lambda i: "31c031f6ba" + le32(0x60+i), "RAX=0x0 RSI=0x0 RDX=0x{v:x}", "kdrv_trc", 3),
+ ]
+ for fam, spl, ffn, pref, rfmt, mpref, flen in pf_store_fams:
+ for i in range(8):
+ out_v = 0x100 + i * 0x10
+ suf = "48c74708" + le32(out_v) + "c3"
+ fhex = ffn(i)
+ regs = rfmt.format(v=0x10+i) + f" RDI=0xffff888004100000 RSP=0xffffc90000013{0xd00+i*8:03x} RFLAGS=0x246"
+ add_exec(
+ f"{fam}_{i:02d}", fam, "pf_patchable", spl,
+ "#PF", 14, 0x0002, "0x0000000000000000", f"{mpref}+0x0{i+1:02x}0",
+ pref(i) if callable(pref) else pref, fhex, suf, regs,
+ f"Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x{out_v:x} and returns 0.",
+ f"{out_v:x}", "0", "90" * flen,
+ f"{mpref}: stage=pre_commit opt_ptr=NULL seq={i}"
+ )
+
+ # 8 families of NULL struct-offset loads needing zero fallback in EAX/RAX (64 scenarios: 4 train, 2 val, 2 test)
+ pf_load_fams = [
+ # (fam, split, pref_base, fault_hex_fn, off_base, reg_base_name, ref_patch, mod_pref)
+ ("pf_load_rbx_d8", "train", "53b8{imm}31db", lambda off: f"8b43{off:02x}", 0x08, "RBX=0x0", "31c090", "kdrv_cfg", "5b48894708c3"),
+ ("pf_load_rcx_d8", "train", "b8{imm}31c9", lambda off: f"8b41{off:02x}", 0x10, "RCX=0x0", "31c090", "kdrv_opt", "48894708c3"),
+ ("pf_load_rdx_d8", "train", "b8{imm}31d2", lambda off: f"8b42{off:02x}", 0x14, "RDX=0x0", "31c090", "kdrv_env", "48894708c3"),
+ ("pf_load_rcx_0", "train", "b8{imm}31c9", lambda off: "8b01", 0x00, "RCX=0x0", "31c0", "kdrv_val", "48894708c3"),
+ ("pf_load64_rbx_d8","val", "53b8{imm}31db", lambda off: f"488b43{off:02x}", 0x08, "RBX=0x0", "4831c090", "kdrv_tbl", "5b48894708c3"),
+ ("pf_load_rdx_0", "val", "b8{imm}31d2", lambda off: "8b02", 0x00, "RDX=0x0", "31c0", "kdrv_ref", "48894708c3"),
+ ("pf_load_rsi_d8", "test", "b8{imm}31f6", lambda off: f"8b46{off:02x}", 0x08, "RSI=0x0", "31c090", "kdrv_hdr", "48894708c3"),
+ ("pf_load64_rsi_d8","test", "b8{imm}31f6", lambda off: f"488b46{off:02x}", 0x10, "RSI=0x0", "4831c090", "kdrv_ctx", "48894708c3"),
+ ]
+ for fam, spl, ptmpl, ffn, obase, rbase, rpatch, mpref, suf in pf_load_fams:
+ for i in range(8):
+ stale = 0x55 + i * 0x11
+ off = (obase + i * 4) if obase > 0 else 0
+ pref = ptmpl.format(imm=le32(stale))
+ fhex = ffn(off)
+ cr2 = f"0x{off:016x}"
+ regs = f"RAX=0x{stale:x} {rbase} RDI=0xffff888004100000 RSP=0xffffc90000013{0xc00+i*8:03x} RFLAGS=0x246"
+ add_exec(
+ f"{fam}_{i:02d}", fam, "pf_patchable", spl,
+ "#PF", 14, 0x0000, cr2, f"{mpref}+0x0{i+2:02x}4",
+ pref(i) if callable(pref) else pref, fhex, suf, regs,
+ f"Struct field load into EAX/RAX then written to out_val and returned; stale RAX=0x{stale:x}, safe fallback requires RAX=0 (out=0, ret=0).",
+ "0", "0", rpatch,
+ f"{mpref}: ptr=NULL field_off=0x{off:x} fallback=zero seq={i}"
+ )
+
+ # =========================================================================
+ # 2. PATCHABLE RING 0 #DE DIVIDE-BY-ZERO (150 scenarios: 15 families x 10)
+ # Split by family: 9 train (90), 3 val (30), 3 test (30)
+ # =========================================================================
+ de_fams = [
+ ("de_div_ecx", "train", "b8{imm}31d231c9", "f7f1", "48894708c3", "RCX=0x0", "31c0", "kdrv_rate"),
+ ("de_idiv_ecx", "train", "b8{imm}9931c9", "f7f9", "48894708c3", "RCX=0x0", "31c0", "kdrv_srate"),
+ ("de_div_esi", "train", "b8{imm}31d231f6", "f7f6", "48894708c3", "RSI=0x0", "31c0", "kdrv_avg"),
+ ("de_idiv_esi", "train", "b8{imm}9931f6", "f7fe", "48894708c3", "RSI=0x0", "31c0", "kdrv_savg"),
+ ("de_div_ebx", "train", "53b8{imm}31d231db", "f7f3", "5b48894708c3", "RBX=0x0", "31c0", "kdrv_scale"),
+ ("de_idiv_ebx", "train", "53b8{imm}9931db", "f7fb", "5b48894708c3", "RBX=0x0", "31c0", "kdrv_sscale"),
+ ("de_div64_rcx", "train", "b8{imm}31d231c9", "48f7f1", "48894708c3", "RCX=0x0", "4831c0", "kdrv_bw"),
+ ("de_idiv64_rcx", "train", "b8{imm}489931c9", "48f7f9", "48894708c3", "RCX=0x0", "4831c0", "kdrv_sbw"),
+ ("de_div64_rsi", "train", "b8{imm}31d231f6", "48f7f6", "48894708c3", "RSI=0x0", "4831c0", "kdrv_lat"),
+ ("de_div_r8d", "val", "b8{imm}31d24531c0", "41f7f0", "48894708c3", "R8=0x0", "31c090", "kdrv_hist"),
+ ("de_idiv_r8d", "val", "b8{imm}994531c0", "41f7f8", "48894708c3", "R8=0x0", "31c090", "kdrv_shist"),
+ ("de_div64_r8", "val", "b8{imm}31d24531c0", "49f7f0", "48894708c3", "R8=0x0", "4831c0", "kdrv_thru"),
+ ("de_div_r9d", "test", "b8{imm}31d24531c9", "41f7f1", "48894708c3", "R9=0x0", "31c090", "kdrv_ema"),
+ ("de_idiv_r9d", "test", "b8{imm}994531c9", "41f7f9", "48894708c3", "R9=0x0", "31c090", "kdrv_sema"),
+ ("de_div_r10d", "test", "b8{imm}31d24531d2", "41f7f2", "48894708c3", "R10=0x0", "31c090", "kdrv_norm"),
+ ]
+ for fam, spl, ptmpl, fhex, suf, dreg, rpatch, mpref in de_fams:
+ for i in range(10):
+ num = 0x2a + i * 0x19
+ pref = ptmpl.format(imm=le32(num))
+ regs = f"RAX=0x{num:x} {dreg} RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013{0xb00+i*8:03x} RFLAGS=0x246"
+ add_exec(
+ f"{fam}_{i:02d}", fam, "de_patchable", spl,
+ "#DE", 0, 0x0000, "0x0000000000000000", f"{mpref}+0x0{i+1:02x}8",
+ pref(i) if callable(pref) else pref, fhex, suf, regs,
+ f"Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x{num:x}, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).",
+ "0", "0", rpatch,
+ f"{mpref}: denom=0 fallback_quotient=0 sample={i}"
+ )
+
+ # =========================================================================
+ # 3. PATCHABLE RING 0 #UD TRAPS (140 scenarios: 14 families x 10)
+ # Split by family: 8 train (80), 3 val (30), 3 test (30)
+ # =========================================================================
+ ud_fams = [
+ # (fam, split, fhex, dirty_eax, rpatch, mpref)
+ ("ud2_clean_keep", "train", "0f0b", False, "9090", "kdrv_guard"),
+ ("ud2_clean_zero", "train", "0f0b", False, "9090", "kdrv_sync"),
+ ("ud2_dirty_ret0", "train", "0f0b", True, "31c0", "kdrv_gate"),
+ ("ud2_dirty_zero", "train", "0f0b", True, "31c0", "kdrv_chk"),
+ ("ud1_eax_clean", "train", "0fb9c0", False, "909090", "kdrv_p1"),
+ ("ud1_ecx_clean", "train", "0fb9c9", False, "909090", "kdrv_p2"),
+ ("ud1_eax_dirty", "train", "0fb9c0", True, "31c090", "kdrv_g1"),
+ ("ud1_ecx_dirty", "train", "0fb9c9", True, "31c090", "kdrv_g2"),
+ ("ud1_edx_clean", "val", "0fb9d2", False, "909090", "kdrv_v1"),
+ ("ud1_edx_dirty", "val", "0fb9d2", True, "31c090", "kdrv_v2"),
+ ("ud2_val_keep", "val", "0f0b", False, "9090", "kdrv_v3"),
+ ("ud0_eax_clean", "test", "0fffc0", False, "909090", "kdrv_t1"),
+ ("ud0_eax_dirty", "test", "0fffc0", True, "31c090", "kdrv_t2"),
+ ("ud0_ecx_clean", "test", "0fffc9", False, "909090", "kdrv_t3"),
+ ]
+ for fam, spl, fhex, dirty, rpatch, mpref in ud_fams:
+ for i in range(10):
+ if dirty:
+ stale = 0x1300 + i * 0x11
+ pref = "b8" + le32(stale)
+ suf = "48894708c3"
+ exp_out = "0"
+ regs = f"RAX=0x{stale:x} RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013{0xa00+i*8:03x} RFLAGS=0x246"
+ chint = f"Stale EAX=0x{stale:x} precedes diagnostic trap before storing RAX to out_val and returning; safe fallback requires EAX=0 (out=0, ret=0)."
+ ltail = f"{mpref}: diag_trap fallback_ret=0 state=clean seq={i}"
+ else:
+ ov = 0x40 + i * 7
+ pref = "31c048c74708" + le32(ov)
+ suf = "c3"
+ exp_out = f"{ov:x}"
+ regs = f"RAX=0x0 RBX=0x{i} RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013{0xa00+i*8:03x} RFLAGS=0x246"
+ chint = f"Non-fatal diagnostic trap with EAX=0 and out_val=0x{ov:x} already prepared; skipping trap completes cleanly with ret=0."
+ ltail = f"{mpref}: diag_trap state=clean pre_commit=1 seq={i}"
+ add_exec(
+ f"{fam}_{i:02d}", fam, "ud_patchable", spl,
+ "#UD", 6, 0x0000, "0x0000000000000000", f"{mpref}+0x0{i+1:02x}a",
+ pref(i) if callable(pref) else pref, fhex, suf, regs, chint, exp_out, "0", rpatch, ltail
+ )
+
+ # =========================================================================
+ # 4A. CONTROL PASS_TO_LINUX (75 scenarios: 15 families x 5)
+ # Split by family: 9 train (45), 3 val (15), 3 test (15)
+ # =========================================================================
+ pass_fams = [
+ ("ctrl_ext_get_user8", "train", "#PF", 14, 0x0000, 0, "0x0000000000000010", "__get_user_8", "488b11", 1, 0, "extable_test", "User-pointer read covered by Linux _ASM_EXTABLE fixup (-EFAULT)."),
+ ("ctrl_ext_get_user4", "train", "#PF", 14, 0x0000, 0, "0x0000000000000020", "__get_user_4", "8b11", 1, 0, "extable_test", "32-bit get_user read covered by _ASM_EXTABLE fixup (-EFAULT)."),
+ ("ctrl_ext_put_user8", "train", "#PF", 14, 0x0002, 0, "0x0000000000000008", "__put_user_8", "488901", 1, 0, "extable_test", "User-pointer write covered by Linux _ASM_EXTABLE fixup (-EFAULT)."),
+ ("ctrl_ext_futex", "train", "#PF", 14, 0x0002, 0, "0x0000000000000000", "futex_detect_cmpxchg","3e0fb10e",1, 0, "extable_test", "Linux futex_detect_cmpxchg probe covered by _ASM_EXTABLE."),
+ ("ctrl_ext_strncpy", "train", "#PF", 14, 0x0000, 0, "0x00007f0000001000", "strncpy_from_user", "488b06", 1, 0, "extable_test", "String copy from user memory covered by _ASM_EXTABLE."),
+ ("ctrl_warn_driver", "train", "#UD", 6, 0x0000, 0, "0x0000000000000000", "kdrv_warn_check", "0f0b", 0, 1, "warn_test", "Linux WARN_ON_ONCE entry (bug_warn=1); kernel logs warning and continues."),
+ ("ctrl_cpl3_pf_read", "train", "#PF", 14, 0x0004, 3, "0x00007ffe91a00000", "user_app", "8b00", 0, 0, "policy_only", "Ring 3 userspace page fault (demand paging / COW handled by Linux mm)."),
+ ("ctrl_cpl3_pf_write", "train", "#PF", 14, 0x0006, 3, "0x00007ffe91b00000", "user_heap", "8910", 0, 0, "policy_only", "Ring 3 userspace COW write fault handled by Linux mm."),
+ ("ctrl_cpl3_de", "train", "#DE", 0, 0x0000, 3, "0x0000000000000000", "user_calc", "f7f1", 0, 0, "policy_only", "Ring 3 userspace divide-by-zero (Linux delivers SIGFPE)."),
+ ("ctrl_ext_copy_from", "val", "#PF", 14, 0x0000, 0, "0x00007f1012340000", "copy_user_fast", "f3a4", 1, 0, "extable_test", "Demand-paged copy_from_user fault covered by _ASM_EXTABLE."),
+ ("ctrl_warn_net", "val", "#UD", 6, 0x0000, 0, "0x0000000000000000", "net_warn_once", "0f0b", 0, 1, "warn_test", "Network subsystem WARN_ON_ONCE (bug_warn=1); handled by Linux."),
+ ("ctrl_cpl3_pf_null", "val", "#PF", 14, 0x0006, 3, "0x0000000000000000", "user_segv", "c70001000000",0,0,"policy_only", "Ring 3 userspace NULL write (Linux delivers SIGSEGV cleanly)."),
+ ("ctrl_ext_probe_rd", "test", "#PF", 14, 0x0000, 0, "0x0000000000000040", "copy_from_kernel_nofault","8b06",1, 0, "extable_test", "Kernel nofault memory probe covered by _ASM_EXTABLE."),
+ ("ctrl_warn_blk", "test", "#UD", 6, 0x0000, 0, "0x0000000000000000", "blk_warn_ratelimit", "0f0b", 0, 1, "warn_test", "Block layer WARN_ON (bug_warn=1); handled cleanly by Linux."),
+ ("ctrl_cpl3_ud", "test", "#UD", 6, 0x0000, 3, "0x0000000000000000", "user_sigill", "0f0b", 0, 0, "policy_only", "Ring 3 userspace invalid opcode (Linux delivers SIGILL)."),
+ ]
+ for fam, spl, en, vec, err, cpl, cr2, sym, fhex, ext, bw, kmode, chint in pass_fams:
+ for i in range(5):
+ flen = len(fhex) // 2
+ rsp_hex = "7ffe919ff000" if cpl == 3 else "ffffc90000013b80"
+ path_kind = "ring3" if cpl == 3 else ("extable" if ext else "warn")
+ S.append(Scenario(
+ scenario_id=f"{fam}_{i:02d}", family_id=fam, category="pass_to_linux", split=spl,
+ exc_name=en, exc_vec=vec, err_code=err, cpl=cpl, cr2=cr2,
+ rip_sym=f"{sym}+0x0{i+1:02x}0", fault_hex=fmt_spaced_hex(fhex), fault_len=flen,
+ disasm=disasm_hex(fhex),
+ regs_summary=f"RAX=0x{i} RBX=0x0 RCX=0x{16+i*8:x} RSP=0x{rsp_hex} RFLAGS=0x246",
+ contract_hint=chint, extable=ext, bug_warn=bw,
+ lock_held=0, irq_ctx=0, side_effect=0, stack_ok=1, obs_complete=1,
+ log_tail=f"linux: standard {path_kind} path seq={i}",
+ expected_action="PASS_TO_LINUX", ref_patch_hex="NONE",
+ kvm_mode=kmode, stub_hex="", patch_off=0,
+ expect_out_hex="ffffffffffffffff", expect_ret_hex="ffffffffffffffff",
+ ))
+
+ # =========================================================================
+ # 4B. CONTROL HALT_FOR_DUMP (75 counter-examples: 15 families x 5)
+ # IDENTICAL opcodes to Families 1-3, differing ONLY in safety context!
+ # Split by family: 9 train (45), 3 val (15), 3 test (15)
+ # =========================================================================
+ halt_fams = [
+ ("halt_pf_spinlock", "train", "#PF", 14, 0x0002, "0x0000000000000000", "kdrv_tx", "c7042500000000efbeadde", 1, 0, 0, 1, 1, "Ring 0 NULL write while holding spinlock (lock_held=1)."),
+ ("halt_pf_dma_dirty", "train", "#PF", 14, 0x0002, "0x0000000000000000", "kdrv_blk", "8910", 0, 0, 1, 1, 1, "Ring 0 NULL store after DMA descriptor already submitted (side_effect=1)."),
+ ("halt_pf_hardirq", "train", "#PF", 14, 0x0002, "0x0000000000000000", "kdrv_isr", "c60001", 0, 1, 0, 1, 1, "Ring 0 NULL byte store inside hard IRQ handler (irq_ctx=1)."),
+ ("halt_pf_load_lock", "train", "#PF", 14, 0x0000, "0x0000000000000010", "kdrv_cfg_lk", "8b4310", 1, 0, 0, 1, 1, "Ring 0 NULL struct load while holding mutex/spinlock (lock_held=1)."),
+ ("halt_de_journal", "train", "#DE", 0, 0x0000, "0x0000000000000000", "kdrv_jnl", "f7f1", 0, 0, 1, 1, 1, "Ring 0 divide-by-zero after journal header already flushed (side_effect=1)."),
+ ("halt_de_rwlock", "train", "#DE", 0, 0x0000, "0x0000000000000000", "kdrv_sched", "f7fe", 1, 0, 0, 1, 1, "Ring 0 signed divide-by-zero while holding rwlock (lock_held=1)."),
+ ("halt_ud_bug_dirty", "train", "#UD", 6, 0x0000, "0x0000000000000000", "kdrv_fs_bug", "0f0b", 0, 0, 1, 1, 1, "Hard BUG_ON invariant failure after metadata write (side_effect=1)."),
+ ("halt_ud_lock", "train", "#UD", 6, 0x0000, "0x0000000000000000", "kdrv_mm_bug", "0fb9c0", 1, 0, 0, 1, 1, "Ring 0 UD1 trap while holding page-table spinlock (lock_held=1)."),
+ ("halt_stack_pf", "train", "#PF", 14, 0x0002, "0x0000000000000000", "kdrv_ovf", "8908", 0, 0, 0, 0, 1, "Ring 0 fault with corrupted kernel stack pointer (stack_ok=0)."),
+ ("halt_val_de_irq", "val", "#DE", 0, 0x0000, "0x0000000000000000", "kdrv_timer", "41f7f0", 0, 1, 0, 1, 1, "Ring 0 divide-by-zero inside timer IRQ context (irq_ctx=1)."),
+ ("halt_val_obs_pf", "val", "#PF", 14, 0x0002, "0x0000000000000000", "kdrv_unk_pf", "488910", 0, 0, 0, 1, 0, "Incomplete Ring -1 telemetry snapshot (obs_complete=0); unsafe to patch."),
+ ("halt_val_multi", "val", "#UD", 6, 0x0000, "0x0000000000000000", "kdrv_net_tx", "0f0b", 1, 0, 1, 1, 1, "Ring 0 BUG_ON with spinlock held and TX ring mutated (lock_held=1, side_effect=1)."),
+ ("halt_test_stack_de", "test", "#DE", 0, 0x0000, "0x0000000000000000", "kdrv_stk_de", "41f7f9", 0, 0, 0, 0, 1, "Ring 0 divide-by-zero with invalid kernel RSP (stack_ok=0)."),
+ ("halt_test_obs_ud", "test", "#UD", 6, 0x0000, "0x0000000000000000", "kdrv_unk_ud", "0fffc0", 0, 0, 0, 1, 0, "Truncated telemetry on Ring 0 #UD (obs_complete=0); halt for dump."),
+ ("halt_test_side_pf", "test", "#PF", 14, 0x0000, "0x0000000000000008", "kdrv_nvme", "8b4608", 0, 0, 1, 1, 1, "Ring 0 NULL struct read after NVMe doorbell already rung (side_effect=1)."),
+ ]
+ for fam, spl, en, vec, err, cr2, sym, fhex, lh, ic, se, sok, oc, chint in halt_fams:
+ for i in range(5):
+ rsp_h = "0000000000000008" if not sok else "ffffc90000013900"
+ add_exec(
+ f"{fam}_{i:02d}", fam, "halt_for_dump", spl,
+ en, vec, err, cr2, f"{sym}+0x0{i+1:02x}c",
+ "", fhex, "",
+ f"RAX=0x{0x20+i:x} RBX=0x0 RCX=0x0 RSP=0x{rsp_h} RFLAGS=0x246",
+ chint, "ffffffffffffffff", "ffffffffffffffff", "NONE",
+ f"{sym}: hazard lock={lh} irq={ic} dirty={se} stack_ok={sok} obs_ok={oc} seq={i}",
+ lock_held=lh, irq_ctx=ic, side_effect=se, stack_ok=sok, obs_complete=oc,
+ expected_action="HALT_FOR_DUMP"
+ )
+
+ return S
+
+if __name__ == "__main__":
+ items = build_600_scenarios()
+ print(f"Total scenarios: {len(items)}")
+ print("By split:", dict(Counter(x.split for x in items)))
+ print("By category:", dict(Counter(x.category for x in items)))
+ print("By expected_action:", dict(Counter(x.expected_action for x in items)))
+ sf = {}
+ for x in items:
+ sf.setdefault(x.split, set()).add(x.family_id)
+ assert not (sf["train"] & sf["val"]), "train/val family leak!"
+ assert not (sf["train"] & sf["test"]), "train/test family leak!"
+ assert not (sf["val"] & sf["test"]), "val/test family leak!"
+ assert len(items) == 600, f"Expected 600, got {len(items)}"
+ print("Family-level split isolation: OK", {k: len(v) for k, v in sf.items()})
+ out_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "scenarios_600.jsonl")
+ with open(out_path, "w") as f:
+ for x in items:
+ f.write(json.dumps(asdict(x)) + "\n")
+ print(f"Saved 600 scenarios -> {out_path}")
diff --git a/04-ring1-kernel-surgeon/guest/bench_mod/Makefile b/04-ring1-kernel-surgeon/guest/bench_mod/Makefile
new file mode 100644
index 0000000..18c16e1
--- /dev/null
+++ b/04-ring1-kernel-surgeon/guest/bench_mod/Makefile
@@ -0,0 +1,8 @@
+obj-m += surgeon_bench.o
+KDIR ?= /lib/modules/5.15.0-185-generic/build
+
+all:
+ $(MAKE) -C $(KDIR) M=$(CURDIR) modules
+
+clean:
+ $(MAKE) -C $(KDIR) M=$(CURDIR) clean
diff --git a/04-ring1-kernel-surgeon/guest/bench_mod/surgeon_bench.c b/04-ring1-kernel-surgeon/guest/bench_mod/surgeon_bench.c
new file mode 100644
index 0000000..2442219
--- /dev/null
+++ b/04-ring1-kernel-surgeon/guest/bench_mod/surgeon_bench.c
@@ -0,0 +1,204 @@
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/proc_fs.h>
+#include <linux/uaccess.h>
+#include <linux/string.h>
+#include <asm/extable.h>
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Ring -1 Kernel Surgeon");
+MODULE_DESCRIPTION("Single-level KVM Ring 0 postcondition & live-patch verifier module");
+
+static struct proc_dir_entry *proc_ent;
+static char last_result[512];
+static char g_kbuf[512];
+static char g_code_hex[256];
+static char g_patch_hex[128];
+static u8 g_code_buf[128];
+static u8 g_patch_buf[32];
+
+/* Dedicated executable slot in module .text (writable in verifier VM with rodata=off) */
+static u8 __attribute__((section(".text"), aligned(4096))) bench_exec_slot[4096] = { 0xC3 };
+
+struct bench_ctx {
+ u64 canary_before;
+ u64 out_val;
+ u64 canary_after;
+ int lock_depth;
+ int side_effect_dirty;
+};
+
+typedef u64 (*stub_fn_t)(struct bench_ctx *ctx);
+
+static int parse_hex_bytes(const char *hex, u8 *out, int max_len)
+{
+ int n = 0;
+ char bstr[3];
+ unsigned long v;
+
+ while (*hex && n < max_len) {
+ while (*hex == ' ' || *hex == ',' || *hex == ':')
+ hex++;
+ if (!*hex || *hex == '\n' || *hex == '\r')
+ break;
+ if (hex[0] == '0' && (hex[1] == 'x' || hex[1] == 'X'))
+ hex += 2;
+ if (!hex[0] || !hex[1])
+ return -EINVAL;
+ bstr[0] = hex[0];
+ bstr[1] = hex[1];
+ bstr[2] = '\0';
+ v = 0;
+ if (kstrtoul(bstr, 16, &v) != 0)
+ return -EINVAL;
+ out[n++] = (u8)v;
+ hex += 2;
+ }
+ return n;
+}
+
+static noinline int run_extable_probe(void)
+{
+ unsigned long val = 0;
+ unsigned long __user *bad_uptr = (unsigned long __user *)0x10UL;
+ int ret = get_user(val, bad_uptr);
+ return (ret == -EFAULT) ? 0 : -EIO;
+}
+
+static noinline int run_warn_control(void)
+{
+ WARN_ON_ONCE(1);
+ return 0;
+}
+
+static ssize_t bench_write(struct file *file, const char __user *ubuf,
+ size_t count, loff_t *ppos)
+{
+ size_t len = min(count, sizeof(g_kbuf) - 1);
+ unsigned int patch_off = 0, patch_len = 0;
+ unsigned long long expect_out = 0, expect_ret = 0;
+ int parsed, code_len, plen;
+ struct bench_ctx ctx1, ctx2;
+ stub_fn_t fn;
+ u64 r1, r2;
+ int canary_ok, lock_ok, out_ok, ret_ok, repeat_ok, pass;
+
+ if (copy_from_user(g_kbuf, ubuf, len))
+ return -EFAULT;
+ g_kbuf[len] = '\0';
+
+ if (strncmp(g_kbuf, "extable_test", 12) == 0) {
+ int r = run_extable_probe();
+ snprintf(last_result, sizeof(last_result),
+ "BENCH_RESULT status=%s mode=extable rc=%d canary_ok=1 lock_ok=1 repeat_ok=1",
+ (r == 0) ? "PASS" : "FAIL", r);
+ return count;
+ }
+
+ if (strncmp(g_kbuf, "warn_test", 9) == 0) {
+ int r = run_warn_control();
+ snprintf(last_result, sizeof(last_result),
+ "BENCH_RESULT status=%s mode=warn rc=%d canary_ok=1 lock_ok=1 repeat_ok=1",
+ (r == 0) ? "PASS" : "FAIL", r);
+ return count;
+ }
+
+ if (strncmp(g_kbuf, "exec ", 5) == 0) {
+ g_code_hex[0] = '\0';
+ g_patch_hex[0] = '\0';
+ parsed = sscanf(g_kbuf + 5, "%255s %u %u %127s %llx %llx",
+ g_code_hex, &patch_off, &patch_len, g_patch_hex,
+ &expect_out, &expect_ret);
+ if (parsed != 6) {
+ snprintf(last_result, sizeof(last_result),
+ "BENCH_RESULT status=FAIL reason=bad_args parsed=%d", parsed);
+ return count;
+ }
+
+ code_len = parse_hex_bytes(g_code_hex, g_code_buf, sizeof(g_code_buf));
+ plen = (strcmp(g_patch_hex, "NONE") == 0)
+ ? 0
+ : parse_hex_bytes(g_patch_hex, g_patch_buf, sizeof(g_patch_buf));
+
+ if (code_len <= 0 || plen < 0 || patch_off + patch_len > (unsigned int)code_len) {
+ snprintf(last_result, sizeof(last_result),
+ "BENCH_RESULT status=FAIL reason=bad_hex code_len=%d plen=%d",
+ code_len, plen);
+ return count;
+ }
+
+ if (plen > 0) {
+ if ((unsigned int)plen != patch_len) {
+ snprintf(last_result, sizeof(last_result),
+ "BENCH_RESULT status=FAIL reason=patch_len_mismatch got=%d expect=%u",
+ plen, patch_len);
+ return count;
+ }
+ memcpy(g_code_buf + patch_off, g_patch_buf, plen);
+ }
+
+ memset(bench_exec_slot, 0xC3, 256);
+ memcpy(bench_exec_slot, g_code_buf, code_len);
+ mb();
+
+ ctx1.canary_before = 0xCAFEBABE11223344ULL;
+ ctx1.out_val = 0x12345678ULL;
+ ctx1.canary_after = 0x55667788DEADC0DEULL;
+ ctx1.lock_depth = 0;
+ ctx1.side_effect_dirty = 0;
+ ctx2 = ctx1;
+
+ fn = (stub_fn_t)(void *)bench_exec_slot;
+ r1 = fn(&ctx1);
+ r2 = fn(&ctx2);
+
+ canary_ok = (ctx1.canary_before == 0xCAFEBABE11223344ULL &&
+ ctx1.canary_after == 0x55667788DEADC0DEULL &&
+ ctx2.canary_before == 0xCAFEBABE11223344ULL &&
+ ctx2.canary_after == 0x55667788DEADC0DEULL);
+ lock_ok = (ctx1.lock_depth == 0 && ctx2.lock_depth == 0);
+ out_ok = (expect_out == 0xFFFFFFFFFFFFFFFFULL) || (ctx1.out_val == expect_out);
+ ret_ok = (expect_ret == 0xFFFFFFFFFFFFFFFFULL) || (r1 == expect_ret);
+ repeat_ok = (r1 == r2 && ctx1.out_val == ctx2.out_val);
+ pass = (canary_ok && lock_ok && out_ok && ret_ok && repeat_ok);
+
+ snprintf(last_result, sizeof(last_result),
+ "BENCH_RESULT status=%s ret=0x%llx out=0x%llx canary_ok=%d lock_ok=%d out_ok=%d ret_ok=%d repeat_ok=%d",
+ pass ? "PASS" : "FAIL",
+ (unsigned long long)r1, (unsigned long long)ctx1.out_val,
+ canary_ok, lock_ok, out_ok, ret_ok, repeat_ok);
+ return count;
+ }
+
+ return count;
+}
+
+static ssize_t bench_read(struct file *file, char __user *ubuf, size_t count, loff_t *ppos)
+{
+ return simple_read_from_buffer(ubuf, count, ppos, last_result, strlen(last_result));
+}
+
+static const struct proc_ops bench_proc_ops = {
+ .proc_write = bench_write,
+ .proc_read = bench_read,
+};
+
+static int __init surgeon_bench_init(void)
+{
+ snprintf(last_result, sizeof(last_result), "BENCH_READY");
+ proc_ent = proc_create("surgeon_bench", 0666, NULL, &bench_proc_ops);
+ if (!proc_ent)
+ return -ENOMEM;
+ pr_info("surgeon_bench: loaded -> /proc/surgeon_bench ready\n");
+ return 0;
+}
+
+static void __exit surgeon_bench_exit(void)
+{
+ if (proc_ent)
+ proc_remove(proc_ent);
+}
+
+module_init(surgeon_bench_init);
+module_exit(surgeon_bench_exit);
diff --git a/04-ring1-kernel-surgeon/guest/crash_mod/Makefile b/04-ring1-kernel-surgeon/guest/crash_mod/Makefile
new file mode 100644
index 0000000..88c3223
--- /dev/null
+++ b/04-ring1-kernel-surgeon/guest/crash_mod/Makefile
@@ -0,0 +1,8 @@
+obj-m += surgeon_crash.o
+KDIR ?= /lib/modules/5.15.0-185-generic/build
+
+all:
+ $(MAKE) -C $(KDIR) M=$(CURDIR) modules
+
+clean:
+ $(MAKE) -C $(KDIR) M=$(CURDIR) clean
diff --git a/04-ring1-kernel-surgeon/guest/crash_mod/surgeon_crash.c b/04-ring1-kernel-surgeon/guest/crash_mod/surgeon_crash.c
new file mode 100644
index 0000000..4f9ebd9
--- /dev/null
+++ b/04-ring1-kernel-surgeon/guest/crash_mod/surgeon_crash.c
@@ -0,0 +1,218 @@
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/proc_fs.h>
+#include <linux/uaccess.h>
+#include <linux/spinlock.h>
+#include <linux/string.h>
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Ring -1 Kernel Surgeon");
+MODULE_DESCRIPTION("Stage 3 Ring 0 #PF / #DE / #UD / extable / danger live demo harness");
+
+static struct proc_dir_entry *proc_ent;
+static DEFINE_SPINLOCK(demo_spinlock);
+
+struct r1_ctx_hint {
+ u32 magic;
+ u32 lock_held;
+ u32 irq_ctx;
+ u32 side_effect;
+ u32 extable;
+ u32 bug_warn;
+ u32 stack_ok;
+ u32 obs_complete;
+ char sym[48];
+ char contract[192];
+ char log_tail[96];
+} __packed;
+
+static struct r1_ctx_hint g_hint;
+
+static bool ring1_present(void)
+{
+ unsigned int a = 0x40000000U, b = 0, c = 0, d = 0;
+ asm volatile("cpuid" : "+a"(a), "=b"(b), "=c"(c), "=d"(d));
+ return (b == 0x676E6952U && c == 0x72755331U && d == 0x6E6F6567U);
+}
+
+static noinline void redraw_ring1_hud(void);
+static void send_hint(const struct r1_ctx_hint *h)
+{
+ unsigned long rax = 0x53555249UL;
+ unsigned long rbx = (unsigned long)h;
+ if (!ring1_present())
+ return;
+ asm volatile("vmmcall" : "+a"(rax) : "b"(rbx) : "memory");
+}
+
+static noinline void trigger_ring0_null_deref(void)
+{
+ volatile unsigned int *null_ptr = (volatile unsigned int *)0x0;
+ memset(&g_hint, 0, sizeof(g_hint));
+ g_hint.magic = 0x52314854U;
+ g_hint.stack_ok = 1;
+ g_hint.obs_complete = 1;
+ strscpy(g_hint.sym, "surgeon_crash+0x0180", sizeof(g_hint.sym));
+ strscpy(g_hint.contract,
+ "Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x100 and returns 0.",
+ sizeof(g_hint.contract));
+ strscpy(g_hint.log_tail, "surgeon_crash: stage=pre_commit opt_ptr=NULL", sizeof(g_hint.log_tail));
+ send_hint(&g_hint);
+
+ pr_info("surgeon_crash: [RING 0] Executing NULL-pointer write *(u32 *)0 = 0xDEADBEEF ...\n");
+ *null_ptr = 0xDEADBEEFU;
+ pr_info("surgeon_crash: [RING 0] SURVIVED NULL-DEREF! Execution resumed cleanly in Ring 0!\n");
+ redraw_ring1_hud();
+}
+
+static noinline void trigger_ring0_div_zero(void)
+{
+ unsigned int num = 0x2a, den = 0, quot = 0xdead;
+ memset(&g_hint, 0, sizeof(g_hint));
+ g_hint.magic = 0x52314854U;
+ g_hint.stack_ok = 1;
+ g_hint.obs_complete = 1;
+ strscpy(g_hint.sym, "surgeon_crash+0x0210", sizeof(g_hint.sym));
+ strscpy(g_hint.contract,
+ "Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x2a, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).",
+ sizeof(g_hint.contract));
+ strscpy(g_hint.log_tail, "surgeon_crash: denom=0 fallback_quotient=0", sizeof(g_hint.log_tail));
+ send_hint(&g_hint);
+
+ pr_info("surgeon_crash: [RING 0] Executing divide-by-zero (0x2a / 0 via div ecx) ...\n");
+ asm volatile(
+ "xor %%edx, %%edx\n\t"
+ "div %%ecx\n\t"
+ : "=a"(quot)
+ : "a"(num), "c"(den)
+ : "edx", "cc", "memory"
+ );
+ pr_info("surgeon_crash: [RING 0] SURVIVED #DE DIV-BY-ZERO! Safe fallback quotient=%u (expected 0)\n", quot);
+ redraw_ring1_hud();
+}
+
+static noinline void trigger_ring0_ud2(void)
+{
+ memset(&g_hint, 0, sizeof(g_hint));
+ g_hint.magic = 0x52314854U;
+ g_hint.stack_ok = 1;
+ g_hint.obs_complete = 1;
+ strscpy(g_hint.sym, "surgeon_crash+0x01ab", sizeof(g_hint.sym));
+ strscpy(g_hint.contract,
+ "Non-fatal diagnostic trap with EAX=0 and out_val=0x42 already prepared; skipping trap completes cleanly with ret=0.",
+ sizeof(g_hint.contract));
+ strscpy(g_hint.log_tail, "surgeon_crash: diag_trap state=clean pre_commit=1", sizeof(g_hint.log_tail));
+ send_hint(&g_hint);
+
+ pr_info("surgeon_crash: [RING 0] Executing UD2 invalid opcode in Ring 0 ...\n");
+ asm volatile("xor %%eax, %%eax\n\t.byte 0x0f, 0x0b" ::: "eax", "memory");
+ pr_info("surgeon_crash: [RING 0] SURVIVED UD2 TRAP! Execution resumed cleanly in Ring 0!\n");
+ redraw_ring1_hud();
+}
+
+static noinline void trigger_extable_control(void)
+{
+ unsigned long val = 0;
+ unsigned long __user *bad = (unsigned long __user *)0x10UL;
+ int rc;
+ memset(&g_hint, 0, sizeof(g_hint));
+ g_hint.magic = 0x52314854U;
+ g_hint.extable = 1;
+ g_hint.stack_ok = 1;
+ g_hint.obs_complete = 1;
+ strscpy(g_hint.sym, "__get_user_8+0x0014", sizeof(g_hint.sym));
+ strscpy(g_hint.contract,
+ "User-pointer read covered by Linux _ASM_EXTABLE fixup (returns -EFAULT).",
+ sizeof(g_hint.contract));
+ strscpy(g_hint.log_tail, "linux: standard extable get_user probe on 0x10", sizeof(g_hint.log_tail));
+ send_hint(&g_hint);
+
+ pr_info("surgeon_crash: [RING 0] Executing benign Linux _ASM_EXTABLE get_user(0x10) ...\n");
+ rc = get_user(val, bad);
+ pr_info("surgeon_crash: [RING 0] EXTABLE CONTROL OK! Linux handled fault natively -> rc=%d (expected -14)\n", rc);
+ redraw_ring1_hud();
+}
+
+static noinline void trigger_danger_lock_held(void)
+{
+ volatile unsigned int *null_ptr = (volatile unsigned int *)0x0;
+ unsigned long flags;
+ memset(&g_hint, 0, sizeof(g_hint));
+ g_hint.magic = 0x52314854U;
+ g_hint.lock_held = 1;
+ g_hint.stack_ok = 1;
+ g_hint.obs_complete = 1;
+ strscpy(g_hint.sym, "kdrv_tx+0x0180", sizeof(g_hint.sym));
+ strscpy(g_hint.contract,
+ "Ring 0 NULL write while holding spinlock (lock_held=1).",
+ sizeof(g_hint.contract));
+ strscpy(g_hint.log_tail, "kdrv_tx: spin_lock held; hazard lock=1", sizeof(g_hint.log_tail));
+ send_hint(&g_hint);
+
+ pr_info("surgeon_crash: [RING 0] Acquiring spinlock and triggering UNSAFE NULL deref (expect HALT_FOR_DUMP) ...\n");
+ spin_lock_irqsave(&demo_spinlock, flags);
+ *null_ptr = 0xDEADBEEFU;
+ spin_unlock_irqrestore(&demo_spinlock, flags);
+ pr_info("surgeon_crash: [RING 0] WARNING: returned from unsafe fault!\n");
+}
+
+static noinline void query_ring1_vmmcall(void)
+{
+ unsigned long rax = 0x53555247UL;
+ unsigned long rbx = 0, rcx = 0, rdx = 0;
+ if (!ring1_present()) {
+ pr_info("surgeon_crash: [STATUS] Running WITHOUT Ring -1 hypervisor (vanilla Linux)\n");
+ return;
+ }
+ asm volatile("vmmcall" : "+a"(rax), "=b"(rbx), "=c"(rcx), "=d"(rdx) :: "memory");
+ pr_info("surgeon_crash: [VMMCALL] Ring -1 sig=0x%016lx heals=%lu l1_cores=%lu llm_ready=%lu\n",
+ rax, rbx, rcx, rdx);
+}
+
+static noinline void redraw_ring1_hud(void)
+{
+ unsigned long rax = 0x53555248UL;
+ if (!ring1_present()) return;
+ asm volatile("vmmcall" : "+a"(rax) :: "memory");
+}
+
+static ssize_t surgeon_write(struct file *file, const char __user *ubuf,
+ size_t count, loff_t *ppos)
+{
+ char kbuf[32];
+ size_t len = min(count, sizeof(kbuf) - 1);
+ if (copy_from_user(kbuf, ubuf, len))
+ return -EFAULT;
+ kbuf[len] = '\0';
+
+ if (strncmp(kbuf, "pf", 2) == 0) trigger_ring0_null_deref();
+ else if (strncmp(kbuf, "de", 2) == 0) trigger_ring0_div_zero();
+ else if (strncmp(kbuf, "ud", 2) == 0) trigger_ring0_ud2();
+ else if (strncmp(kbuf, "extable", 7) == 0) trigger_extable_control();
+ else if (strncmp(kbuf, "danger", 6) == 0) trigger_danger_lock_held();
+ else if (strncmp(kbuf, "status", 6) == 0) query_ring1_vmmcall();
+ else if (strncmp(kbuf, "hud", 3) == 0) redraw_ring1_hud();
+ else pr_info("surgeon_crash: commands: pf | de | ud | extable | danger | status | hud\n");
+ return count;
+}
+
+static const struct proc_ops surgeon_proc_ops = {
+ .proc_write = surgeon_write,
+};
+
+static int __init surgeon_crash_init(void)
+{
+ proc_ent = proc_create("surgeon_crash", 0222, NULL, &surgeon_proc_ops);
+ if (!proc_ent) return -ENOMEM;
+ pr_info("surgeon_crash: loaded -> /proc/surgeon_crash (pf | de | ud | extable | danger | status | hud)\n");
+ return 0;
+}
+
+static void __exit surgeon_crash_exit(void)
+{
+ if (proc_ent) proc_remove(proc_ent);
+}
+
+module_init(surgeon_crash_init);
+module_exit(surgeon_crash_exit);
diff --git a/04-ring1-kernel-surgeon/hv/ap_trampoline.asm b/04-ring1-kernel-surgeon/hv/ap_trampoline.asm
new file mode 100644
index 0000000..958db59
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/ap_trampoline.asm
@@ -0,0 +1,97 @@
+; ============================================================================
+; hv/ap_trampoline.asm — Relocatable 16->32->64 AP Startup Trampoline @ 0x8000
+; ============================================================================
+section .rodata
+align 16
+
+global ap_trampoline_start
+global ap_trampoline_end
+
+TRAMP_BASE equ 0x8000
+; Control block placed at 0x8F00 by BSP before SIPI:
+; [0x8F00] u64 host_pml4_pa
+; [0x8F08] u64 ap_entry64_addr
+; [0x8F10] u64 stack_top_pa
+; [0x8F18] u64 tid
+; [0x8F20] u16 gdt_limit / [0x8F22] u64 gdt_base (10-byte GDTR)
+
+bits 16
+ap_trampoline_start:
+ cli
+ cld
+ xor ax, ax
+ mov ds, ax
+ mov es, ax
+ mov ss, ax
+
+ ; Load temporary 32-bit flat GDT embedded in trampoline
+ lgdt [TRAMP_BASE + (tramp_gdtr32 - ap_trampoline_start)]
+
+ ; Enter 32-bit protected mode
+ mov eax, cr0
+ or eax, 1
+ mov cr0, eax
+ jmp 0x08:(TRAMP_BASE + (ap_pm32 - ap_trampoline_start))
+
+bits 32
+ap_pm32:
+ mov ax, 0x10
+ mov ds, ax
+ mov es, ax
+ mov ss, ax
+
+ ; Load BSP host_pml4 into CR3
+ mov eax, [0x8F00]
+ mov cr3, eax
+
+ ; Enable PAE
+ mov eax, cr4
+ or eax, (1 << 5)
+ mov cr4, eax
+
+ ; Enable EFER.LME | EFER.NXE
+ mov ecx, 0xC0000080
+ rdmsr
+ or eax, (1 << 8) | (1 << 11)
+ wrmsr
+
+ ; Enable paging + FPU MP
+ mov eax, cr0
+ or eax, (1 << 31) | (1 << 0) | (1 << 5) | (1 << 1)
+ and eax, ~((1 << 29) | (1 << 30) | (1 << 2) | (1 << 3))
+ mov cr0, eax
+
+ ; Load BSP 64-bit GDT and jump to 64-bit mode
+ lgdt [0x8F20]
+ jmp 0x08:(TRAMP_BASE + (ap_lm64 - ap_trampoline_start))
+
+bits 64
+ap_lm64:
+ mov ax, 0x10
+ mov ds, ax
+ mov es, ax
+ mov fs, ax
+ mov gs, ax
+ mov ss, ax
+
+ mov rsp, [0x8F10]
+ and rsp, ~0xF
+ mov rdi, [0x8F18] ; tid
+ mov rax, [0x8F08] ; ap_c_entry(uint64_t tid)
+ call rax
+
+.ap_hlt:
+ cli
+ hlt
+ jmp .ap_hlt
+
+align 8
+tramp_gdt32:
+ dq 0x0000000000000000
+ dq 0x00CF9A000000FFFF ; 0x08: 32-bit flat code
+ dq 0x00CF92000000FFFF ; 0x10: 32-bit flat data
+tramp_gdtr32:
+ dw (tramp_gdtr32 - tramp_gdt32 - 1)
+ dd TRAMP_BASE + (tramp_gdt32 - ap_trampoline_start)
+
+ap_trampoline_end:
diff --git a/04-ring1-kernel-surgeon/hv/boot.asm b/04-ring1-kernel-surgeon/hv/boot.asm
new file mode 100644
index 0000000..91b169a
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/boot.asm
@@ -0,0 +1,193 @@
+; ============================================================================
+; hv/boot.asm — Multiboot2 Entry -> 64-bit Long Mode (0..8 GiB identity map)
+; ============================================================================
+bits 32
+
+MB2_MAGIC equ 0xE85250D6
+MB2_ARCH equ 0
+
+section .multiboot align=8
+mb2_hdr_start:
+ dd MB2_MAGIC
+ dd MB2_ARCH
+ dd mb2_hdr_end - mb2_hdr_start
+ dd -(MB2_MAGIC + MB2_ARCH + (mb2_hdr_end - mb2_hdr_start))
+
+ align 8
+ dw 5 ; framebuffer request
+ dw 0
+ dd 20
+ dd 1280
+ dd 720
+ dd 32
+
+ align 8
+ dw 6 ; module alignment
+ dw 0
+ dd 8
+
+ align 8
+ dw 0 ; end tag
+ dw 0
+ dd 8
+mb2_hdr_end:
+
+section .text
+global _start
+extern hv_main
+extern __bss_start
+extern __bss_end
+
+_start:
+ cli
+ mov esp, stack32_top
+
+ mov [mb2_magic_saved], eax
+ mov [mb2_info_saved], ebx
+
+ ; Zero .bss
+ mov edi, __bss_start
+ mov ecx, __bss_end
+ sub ecx, edi
+ shr ecx, 2
+ xor eax, eax
+ rep stosd
+
+ ; Build 4-level identity page tables covering 0 .. 8 GiB via 2 MiB pages
+ ; (includes low RAM, MMIO/FB 2..4G, and 2 GiB NVDIMM model at 4..6G!)
+ mov eax, host_pdpt
+ or eax, 0x03
+ mov [host_pml4], eax
+
+ mov ecx, 0
+.pdpt_loop:
+ mov eax, ecx
+ shl eax, 12
+ add eax, host_pd
+ or eax, 0x03
+ mov [host_pdpt + ecx * 8], eax
+ mov dword [host_pdpt + ecx * 8 + 4], 0
+ inc ecx
+ cmp ecx, 8
+ jl .pdpt_loop
+
+ ; Fill 8 * 512 = 4096 2-MiB page entries (0x00000000 .. 0x1FFFFFFFF)
+ mov edi, host_pd
+ xor ebx, ebx ; low 32 of physical address
+ xor edx, edx ; high 32 of physical address
+ mov ecx, 4096
+.pd_loop:
+ mov eax, ebx
+ or eax, 0x83 ; Present | Writable | PageSize (2 MiB)
+ mov [edi], eax
+ mov [edi + 4], edx
+ add ebx, 0x00200000
+ adc edx, 0
+ add edi, 8
+ dec ecx
+ jnz .pd_loop
+
+ mov eax, host_pml4
+ mov cr3, eax
+
+ ; Enable PAE
+ mov eax, cr4
+ or eax, (1 << 5)
+ mov cr4, eax
+
+ ; Enable EFER.LME | EFER.NXE
+ mov ecx, 0xC0000080
+ rdmsr
+ or eax, (1 << 8) | (1 << 11)
+ wrmsr
+
+ ; Enable CR0.PG | PE | NE | MP (clear NW, CD, EM, TS)
+ mov eax, cr0
+ or eax, (1 << 31) | (1 << 0) | (1 << 5) | (1 << 1)
+ and eax, ~((1 << 29) | (1 << 30) | (1 << 2) | (1 << 3))
+ mov cr0, eax
+
+ lgdt [gdt64_ptr]
+ jmp 0x08:_start64
+
+bits 64
+_start64:
+ mov ax, 0x10
+ mov ds, ax
+ mov es, ax
+ mov fs, ax
+ mov gs, ax
+ mov ss, ax
+
+ mov rsp, stack64_top
+ and rsp, ~0xF
+
+ ; Populate 64-bit TSS descriptor in GDT[3..4] (selector 0x18) and load TR
+ lea rax, [rel host_tss]
+ mov rbx, rax
+ mov [rel gdt64_tss + 2], bx
+ shr rbx, 16
+ mov [rel gdt64_tss + 4], bl
+ mov [rel gdt64_tss + 7], bh
+ shr rbx, 16
+ mov [rel gdt64_tss + 8], ebx
+ mov ax, 0x18
+ ltr ax
+
+ mov edi, [rel mb2_magic_saved]
+ mov esi, [rel mb2_info_saved]
+ call hv_main
+
+.halt:
+ cli
+ hlt
+ jmp .halt
+
+section .data
+align 8
+mb2_magic_saved: dd 0
+mb2_info_saved: dd 0
+
+global gdt64_ptr
+align 16
+gdt64:
+ dq 0x0000000000000000 ; 0x00: null
+ dq 0x00AF9A000000FFFF ; 0x08: 64-bit code
+ dq 0x00CF92000000FFFF ; 0x10: 64-bit data
+gdt64_tss:
+ dw 0x0067
+ dw 0x0000
+ db 0x00
+ db 0x89
+ db 0x00
+ db 0x00
+ dd 0x00000000
+ dd 0x00000000
+gdt64_end:
+
+gdt64_ptr:
+ dw gdt64_end - gdt64 - 1
+ dq gdt64
+
+section .bss
+global host_pml4
+global host_pdpt
+global host_pd
+global host_pd_high
+
+align 4096
+host_pml4: resb 4096
+host_pdpt: resb 4096
+host_pd: resb 4096 * 8 ; 8 GiB identity map
+host_pd_high: resb 4096
+
+align 64
+host_tss: resb 128
+
+align 16
+stack32_bottom: resb 4096
+stack32_top:
+
+align 16
+stack64_bottom: resb 65536
+stack64_top:
diff --git a/04-ring1-kernel-surgeon/hv/fb.c b/04-ring1-kernel-surgeon/hv/fb.c
new file mode 100644
index 0000000..657583c
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/fb.c
@@ -0,0 +1,244 @@
+#include "fb.h"
+#include "font8x16.h"
+
+FbInfo g_fb;
+
+static inline uint32_t pack_rgb(uint32_t rgb) {
+ uint32_t r = (rgb >> 16) & 0xFF;
+ uint32_t g = (rgb >> 8) & 0xFF;
+ uint32_t b = rgb & 0xFF;
+ return (r << g_fb.red_pos) | (g << g_fb.green_pos) | (b << g_fb.blue_pos);
+}
+
+void fb_init(const FbInfo *info) {
+ g_fb = *info;
+ if (g_fb.bpp == 32 && g_fb.addr != 0 && g_fb.width > 0 && g_fb.height > 0) {
+ if (g_fb.red_size == 0 && g_fb.green_size == 0 && g_fb.blue_size == 0) {
+ g_fb.red_pos = 16; g_fb.red_size = 8;
+ g_fb.green_pos = 8; g_fb.green_size = 8;
+ g_fb.blue_pos = 0; g_fb.blue_size = 8;
+ }
+ g_fb.ready = true;
+ } else {
+ g_fb.ready = false;
+ }
+}
+
+void fb_put_pixel(int x, int y, uint32_t rgb) {
+ if (!g_fb.ready) return;
+ if (x < 0 || y < 0 || (uint32_t)x >= g_fb.width || (uint32_t)y >= g_fb.height) return;
+ volatile uint32_t *row = (volatile uint32_t *)(uintptr_t)(g_fb.addr + (uint64_t)y * g_fb.pitch);
+ row[x] = pack_rgb(rgb);
+}
+
+void fb_fill_rect(int x, int y, int w, int h, uint32_t rgb) {
+ if (!g_fb.ready) return;
+ uint32_t px = pack_rgb(rgb);
+ for (int dy = 0; dy < h; dy++) {
+ int yy = y + dy;
+ if (yy < 0 || (uint32_t)yy >= g_fb.height) continue;
+ volatile uint32_t *row = (volatile uint32_t *)(uintptr_t)(g_fb.addr + (uint64_t)yy * g_fb.pitch);
+ for (int dx = 0; dx < w; dx++) {
+ int xx = x + dx;
+ if (xx < 0 || (uint32_t)xx >= g_fb.width) continue;
+ row[xx] = px;
+ }
+ }
+}
+
+void fb_draw_border(int x, int y, int w, int h, int t, uint32_t rgb) {
+ fb_fill_rect(x, y, w, t, rgb);
+ fb_fill_rect(x, y + h - t, w, t, rgb);
+ fb_fill_rect(x, y, t, h, rgb);
+ fb_fill_rect(x + w - t, y, t, h, rgb);
+}
+
+void fb_draw_char(int x, int y, char c, uint32_t fg, uint32_t bg, bool transparent_bg) {
+ if (!g_fb.ready) return;
+ uint8_t uc = (uint8_t)c;
+ if (uc >= 128) uc = '?';
+ const uint8_t *glyph = FONT_8X16[uc];
+ uint32_t fg_px = pack_rgb(fg);
+ uint32_t bg_px = pack_rgb(bg);
+ for (int row = 0; row < 16; row++) {
+ int yy = y + row;
+ if (yy < 0 || (uint32_t)yy >= g_fb.height) continue;
+ volatile uint32_t *line = (volatile uint32_t *)(uintptr_t)(g_fb.addr + (uint64_t)yy * g_fb.pitch);
+ uint8_t bits = glyph[row];
+ for (int col = 0; col < 8; col++) {
+ int xx = x + col;
+ if (xx < 0 || (uint32_t)xx >= g_fb.width) continue;
+ if (bits & (0x80 >> col)) line[xx] = fg_px;
+ else if (!transparent_bg) line[xx] = bg_px;
+ }
+ }
+}
+
+void fb_draw_str(int x, int y, const char *s, uint32_t fg, uint32_t bg, bool transparent_bg) {
+ int cx = x;
+ while (*s) {
+ if (*s == '\n') break;
+ fb_draw_char(cx, y, *s++, fg, bg, transparent_bg);
+ cx += 8;
+ }
+}
+
+static void fb_draw_str_clip(int x, int y, const char *s, int max_chars, uint32_t fg) {
+ int cx = x, n = 0;
+ while (*s && n < max_chars) {
+ char c = *s++;
+ if (c == '\n' || c == '\r') c = ' ';
+ fb_draw_char(cx, y, c, fg, 0, true);
+ cx += 8;
+ n++;
+ }
+}
+
+static void fmt_hex_bytes(char *out, size_t cap, const uint8_t *b, uint8_t n) {
+ size_t pos = 0;
+ for (uint8_t i = 0; i < n && pos + 4 < cap; i++) {
+ pos += (size_t)hv_snprintf(out + pos, cap - pos, "%s%02x", i ? " " : "", b[i]);
+ }
+ if (pos == 0 && cap > 0) out[0] = '\0';
+}
+
+void fb_draw_boot_banner(int n_cores, bool llm_ready) {
+ if (!g_fb.ready) return;
+ fb_fill_rect(0, 0, (int)g_fb.width, (int)g_fb.height, 0x0B0F19);
+ int bw = 680, bh = 168;
+ int bx = ((int)g_fb.width - bw) / 2;
+ int by = ((int)g_fb.height - bh) / 2;
+ if (bx < 8) bx = 8;
+ if (by < 8) by = 8;
+ fb_fill_rect(bx, by, bw, bh, 0x111827);
+ fb_draw_border(bx, by, bw, bh, 2, 0x22D3EE);
+ fb_draw_str(bx + 20, by + 18, "RING -1 KERNEL SURGEON // BARE-METAL AMD SVM + MiniCPM5-2B", 0x22D3EE, 0, true);
+ char line[128];
+ hv_snprintf(line, sizeof(line), "Engine : %s (%d Bare-Metal AVX2/FMA Cores, Zero OS/libc)",
+ llm_ready ? "MiniCPM5-2B GRPO Q4_K_M ACTIVE" : "Stage1 Fallback", n_cores);
+ fb_draw_str(bx + 20, by + 48, line, llm_ready ? 0x34D399 : 0xFBBF24, 0, true);
+ hv_snprintf(line, sizeof(line), "Isolat : 2 GiB Weights + 64 MiB KV/Arena UNMAPPED in AMD NPT");
+ fb_draw_str(bx + 20, by + 74, line, 0xE5E7EB, 0, true);
+ hv_snprintf(line, sizeof(line), "FB : %ux%ux%u @ 0x%lx (shared with guest efifb)",
+ g_fb.width, g_fb.height, g_fb.bpp, g_fb.addr);
+ fb_draw_str(bx + 20, by + 100, line, 0x9CA3AF, 0, true);
+ fb_draw_str(bx + 20, by + 130, "Launching Linux 5.15 guest via VMRUN (intercepting #PF #DE #UD)...", 0x60A5FA, 0, true);
+}
+
+void fb_draw_thinking_hud(uint32_t event_num, const char *fault_name, uint64_t rip_gva,
+ const uint8_t *orig_bytes, uint8_t insn_len, int n_cores,
+ const char *live_stream) {
+ if (!g_fb.ready) return;
+ int pw = 660, ph = 248;
+ if ((int)g_fb.width < pw + 24) pw = (int)g_fb.width - 16;
+ int px = (int)g_fb.width - pw - 16;
+ int py = 16;
+ if (px < 8) px = 8;
+
+ fb_fill_rect(px, py, pw, ph, 0x0B101B);
+ fb_fill_rect(px, py, pw, 28, 0xB45309);
+ fb_draw_border(px, py, pw, ph, 2, 0xFBBF24);
+
+ char buf[160], hex_o[64];
+ fmt_hex_bytes(hex_o, sizeof(hex_o), orig_bytes, insn_len);
+ hv_snprintf(buf, sizeof(buf), " [ RING -1 AI SURGEON ] LIVE INFERENCE #%u (%d BARE-METAL CORES)", event_num, n_cores);
+ fb_draw_str_clip(px + 8, py + 6, buf, 80, 0xFFFFFF);
+
+ hv_snprintf(buf, sizeof(buf), "MODEL : MiniCPM5-2B GRPO Q4_K_M (Isolated L1 RAM, Zero OS)");
+ fb_draw_str_clip(px + 12, py + 38, buf, 78, 0x22D3EE);
+
+ hv_snprintf(buf, sizeof(buf), "FAULT : %s RIP=0x%016lx", fault_name, rip_gva);
+ fb_draw_str_clip(px + 12, py + 60, buf, 78, 0xFCA5A5);
+
+ hv_snprintf(buf, sizeof(buf), "BYTES : [%u B] %s", insn_len, hex_o);
+ fb_draw_str_clip(px + 12, py + 82, buf, 78, 0xFDE68A);
+
+ fb_draw_str_clip(px + 12, py + 112, "STREAMING RING -1 LLM OUTPUT:", 78, 0x9CA3AF);
+ if (live_stream && live_stream[0]) {
+ // Print up to 3 lines of streamed tokens
+ const char *p = live_stream;
+ int ly = py + 134;
+ for (int line_i = 0; line_i < 3 && *p; line_i++) {
+ int k = 0;
+ char lbuf[80];
+ while (*p && *p != '\n' && k < 76) lbuf[k++] = *p++;
+ lbuf[k] = '\0';
+ if (*p == '\n') p++;
+ fb_draw_str_clip(px + 12, ly, lbuf, 78, 0x6EE7B7);
+ ly += 20;
+ }
+ } else {
+ fb_draw_str_clip(px + 12, py + 134, "Prefilling Ring -1 telemetry prompt across AVX2 cores...", 78, 0xFBBF24);
+ }
+
+ fb_fill_rect(px + 12, py + ph - 32, pw - 24, 22, 0x78350F);
+ fb_draw_str_clip(px + 18, py + ph - 29, "GUEST FROZEN IN RING -1 // COMPUTING SAFE MACHINE-CODE VERDICT...", 76, 0xFEF3C7);
+}
+
+void fb_draw_ai_verdict_hud(uint32_t event_num, const char *fault_name, uint32_t cpl,
+ uint64_t cr2, uint64_t rip_gva, uint64_t rip_gpa,
+ const uint8_t *orig_bytes, uint8_t insn_len,
+ const uint8_t *patch_bytes, uint8_t patch_len,
+ const char *action_str, const char *diagnosis,
+ int n_cores, uint32_t elapsed_ms, uint32_t gen_toks) {
+ if (!g_fb.ready) return;
+ int pw = 660, ph = 248;
+ if ((int)g_fb.width < pw + 24) pw = (int)g_fb.width - 16;
+ int px = (int)g_fb.width - pw - 16;
+ int py = 16;
+ if (px < 8) px = 8;
+
+ bool is_patch = (hv_strcmp(action_str, "PATCH_BYTES") == 0);
+ bool is_pass = (hv_strcmp(action_str, "PASS_TO_LINUX") == 0);
+
+ uint32_t hdr_bg = is_patch ? 0x065F46 : (is_pass ? 0x1D4ED8 : 0x991B1B);
+ uint32_t bdr_col = is_patch ? 0x34D399 : (is_pass ? 0x60A5FA : 0xF87171);
+
+ fb_fill_rect(px, py, pw, ph, 0x0B101B);
+ fb_fill_rect(px, py, pw, 28, hdr_bg);
+ fb_draw_border(px, py, pw, ph, 2, bdr_col);
+
+ char buf[160];
+ hv_snprintf(buf, sizeof(buf), " [ RING -1 AI SURGEON ] EVENT #%u | %s", event_num, action_str);
+ fb_draw_str_clip(px + 8, py + 6, buf, 80, 0xFFFFFF);
+
+ int y = py + 36;
+ uint32_t secs = elapsed_ms / 1000U;
+ uint32_t tenths = (elapsed_ms % 1000U) / 100U;
+ hv_snprintf(buf, sizeof(buf), "MODEL : MiniCPM5-2B Q4_K_M @ %d L1 Cores (%u.%us, %u tok)", n_cores, secs, tenths, gen_toks);
+ fb_draw_str_clip(px + 12, y, buf, 78, 0x22D3EE);
+ y += 22;
+
+ hv_snprintf(buf, sizeof(buf), "FAULT : %s CPL=%u CR2=0x%016lx", fault_name, cpl, cr2);
+ fb_draw_str_clip(px + 12, y, buf, 78, 0xFCA5A5);
+ y += 22;
+
+ hv_snprintf(buf, sizeof(buf), "RIP GVA: 0x%016lx GPA: 0x%016lx", rip_gva, rip_gpa);
+ fb_draw_str_clip(px + 12, y, buf, 78, 0x93C5FD);
+ y += 22;
+
+ hv_snprintf(buf, sizeof(buf), "DIAG : %s", diagnosis && diagnosis[0] ? diagnosis : "(none)");
+ fb_draw_str_clip(px + 12, y, buf, 78, 0xF9FAFB);
+ y += 22;
+
+ char hex_orig[64], hex_patch[64];
+ fmt_hex_bytes(hex_orig, sizeof(hex_orig), orig_bytes, insn_len);
+ if (is_patch && patch_len > 0) fmt_hex_bytes(hex_patch, sizeof(hex_patch), patch_bytes, patch_len);
+ else hv_snprintf(hex_patch, sizeof(hex_patch), "NONE");
+
+ hv_snprintf(buf, sizeof(buf), "BEFORE : [%u B] %s", insn_len, hex_orig);
+ fb_draw_str_clip(px + 12, y, buf, 78, 0xFDE68A);
+ y += 22;
+
+ hv_snprintf(buf, sizeof(buf), "PATCH : [%u B] %s", is_patch ? patch_len : 0, hex_patch);
+ fb_draw_str_clip(px + 12, y, buf, 78, is_patch ? 0x6EE7B7 : 0xFCA5A5);
+ y += 28;
+
+ fb_fill_rect(px + 12, y - 4, pw - 24, 24, hdr_bg);
+ const char *status_line = is_patch
+ ? "STATUS : LIVE-PATCHED IN GUEST .TEXT VIA NPT -> RESUMING VMRUN"
+ : (is_pass
+ ? "STATUS : BENIGN LINUX EXCEPTION -> RE-INJECTED TO GUEST KERNEL"
+ : "STATUS : UNSAFE STATE (LOCK/DIRTY) -> HALTED FOR FORENSIC DUMP");
+ fb_draw_str_clip(px + 18, y, status_line, 76, 0xFFFFFF);
+}
diff --git a/04-ring1-kernel-surgeon/hv/fb.h b/04-ring1-kernel-surgeon/hv/fb.h
new file mode 100644
index 0000000..4256bbf
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/fb.h
@@ -0,0 +1,33 @@
+#pragma once
+#include "types.h"
+
+typedef struct {
+ uint64_t addr;
+ uint32_t pitch;
+ uint32_t width;
+ uint32_t height;
+ uint8_t bpp;
+ uint8_t red_pos, red_size;
+ uint8_t green_pos, green_size;
+ uint8_t blue_pos, blue_size;
+ bool ready;
+} FbInfo;
+
+extern FbInfo g_fb;
+
+void fb_init(const FbInfo *info);
+void fb_put_pixel(int x, int y, uint32_t rgb);
+void fb_fill_rect(int x, int y, int w, int h, uint32_t rgb);
+void fb_draw_border(int x, int y, int w, int h, int thickness, uint32_t rgb);
+void fb_draw_char(int x, int y, char c, uint32_t fg, uint32_t bg, bool transparent_bg);
+void fb_draw_str(int x, int y, const char *s, uint32_t fg, uint32_t bg, bool transparent_bg);
+void fb_draw_boot_banner(int n_cores, bool llm_ready);
+void fb_draw_thinking_hud(uint32_t event_num, const char *fault_name, uint64_t rip_gva,
+ const uint8_t *orig_bytes, uint8_t insn_len, int n_cores,
+ const char *live_stream);
+void fb_draw_ai_verdict_hud(uint32_t event_num, const char *fault_name, uint32_t cpl,
+ uint64_t cr2, uint64_t rip_gva, uint64_t rip_gpa,
+ const uint8_t *orig_bytes, uint8_t insn_len,
+ const uint8_t *patch_bytes, uint8_t patch_len,
+ const char *action_str, const char *diagnosis,
+ int n_cores, uint32_t elapsed_ms, uint32_t gen_toks);
diff --git a/04-ring1-kernel-surgeon/hv/font8x16.h b/04-ring1-kernel-surgeon/hv/font8x16.h
new file mode 100644
index 0000000..9a790dd
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/font8x16.h
@@ -0,0 +1,134 @@
+// Auto-extracted 8x16 VGA font from /usr/share/consolefonts/Lat15-VGA16.psf.gz
+#pragma once
+#include "types.h"
+
+static const uint8_t FONT_8X16[128][16] = {
+ [ 0] = { 0x00, 0x00, 0x3c, 0x42, 0x99, 0xa5, 0xa1, 0xa1, 0xa5, 0x99, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00 },
+ [ 1] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 2] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00 },
+ [ 3] = { 0x00, 0x00, 0xf1, 0x5b, 0x55, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 4] = { 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 5] = { 0x00, 0x00, 0xcc, 0xcf, 0xed, 0xff, 0xfc, 0xdf, 0xcc, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x00 },
+ [ 6] = { 0x00, 0x00, 0x03, 0x3e, 0x66, 0xcf, 0xdb, 0xdb, 0xf3, 0x66, 0x7c, 0xc0, 0x00, 0x00, 0x00, 0x00 },
+ [ 7] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 8] = { 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0x66, 0x66, 0x66, 0x3c, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 9] = { 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00 },
+ [ 10] = { 0x00, 0x00, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 11] = { 0x00, 0x00, 0x38, 0x44, 0xba, 0xb2, 0xaa, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 12] = { 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 13] = { 0x00, 0x70, 0xd8, 0x30, 0x18, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 14] = { 0x00, 0x00, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 15] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0c, 0x38, 0x00 },
+ [ 16] = { 0x00, 0x30, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 17] = { 0x00, 0xe0, 0x30, 0x62, 0x36, 0xec, 0x18, 0x30, 0x66, 0xce, 0x9e, 0x3e, 0x06, 0x06, 0x00, 0x00 },
+ [ 18] = { 0x60, 0x30, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00 },
+ [ 19] = { 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00 },
+ [ 20] = { 0x00, 0x00, 0x7f, 0xdb, 0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00 },
+ [ 21] = { 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00 },
+ [ 22] = { 0x0c, 0x18, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00 },
+ [ 23] = { 0x10, 0x38, 0x6c, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00 },
+ [ 24] = { 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00 },
+ [ 25] = { 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00 },
+ [ 26] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x06, 0xff, 0x06, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 27] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xff, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 28] = { 0x76, 0xdc, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00 },
+ [ 29] = { 0x30, 0x18, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00 },
+ [ 30] = { 0x10, 0x38, 0x44, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00 },
+ [ 31] = { 0x6c, 0x6c, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00 },
+ [ 32] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 33] = { 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00 },
+ [ 34] = { 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 35] = { 0x00, 0x00, 0x00, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00 },
+ [ 36] = { 0x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c, 0x18, 0x18, 0x00, 0x00 },
+ [ 37] = { 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18, 0x30, 0x60, 0xc6, 0x86, 0x00, 0x00, 0x00, 0x00 },
+ [ 38] = { 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00 },
+ [ 39] = { 0x00, 0x30, 0x30, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 40] = { 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00 },
+ [ 41] = { 0x00, 0x00, 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00 },
+ [ 42] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 43] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 44] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00 },
+ [ 45] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 46] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00 },
+ [ 47] = { 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00 },
+ [ 48] = { 0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xd6, 0xd6, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00 },
+ [ 49] = { 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00 },
+ [ 50] = { 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00 },
+ [ 51] = { 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00 },
+ [ 52] = { 0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xfe, 0x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00 },
+ [ 53] = { 0x00, 0x00, 0xfe, 0xc0, 0xc0, 0xc0, 0xfc, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00 },
+ [ 54] = { 0x00, 0x00, 0x38, 0x60, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00 },
+ [ 55] = { 0x00, 0x00, 0xfe, 0xc6, 0x06, 0x06, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00 },
+ [ 56] = { 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00 },
+ [ 57] = { 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x0c, 0x78, 0x00, 0x00, 0x00, 0x00 },
+ [ 58] = { 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 59] = { 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00 },
+ [ 60] = { 0x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x00, 0x00, 0x00, 0x00 },
+ [ 61] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 62] = { 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00 },
+ [ 63] = { 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00 },
+ [ 64] = { 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xde, 0xde, 0xde, 0xdc, 0xc0, 0x7c, 0x00, 0x00, 0x00, 0x00 },
+ [ 65] = { 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00 },
+ [ 66] = { 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00 },
+ [ 67] = { 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00 },
+ [ 68] = { 0x00, 0x00, 0xf8, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00 },
+ [ 69] = { 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00 },
+ [ 70] = { 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00 },
+ [ 71] = { 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00 },
+ [ 72] = { 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00 },
+ [ 73] = { 0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00 },
+ [ 74] = { 0x00, 0x00, 0x1e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00 },
+ [ 75] = { 0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00 },
+ [ 76] = { 0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00 },
+ [ 77] = { 0x00, 0x00, 0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00 },
+ [ 78] = { 0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00 },
+ [ 79] = { 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00 },
+ [ 80] = { 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00 },
+ [ 81] = { 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c, 0x0c, 0x0e, 0x00, 0x00 },
+ [ 82] = { 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00 },
+ [ 83] = { 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00 },
+ [ 84] = { 0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00 },
+ [ 85] = { 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00 },
+ [ 86] = { 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x6c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00 },
+ [ 87] = { 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0xee, 0x6c, 0x00, 0x00, 0x00, 0x00 },
+ [ 88] = { 0x00, 0x00, 0xc6, 0xc6, 0x6c, 0x7c, 0x38, 0x38, 0x7c, 0x6c, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00 },
+ [ 89] = { 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00 },
+ [ 90] = { 0x00, 0x00, 0xfe, 0xc6, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc2, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00 },
+ [ 91] = { 0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00 },
+ [ 92] = { 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00 },
+ [ 93] = { 0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c, 0x00, 0x00, 0x00, 0x00 },
+ [ 94] = { 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 95] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00 },
+ [ 96] = { 0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [ 97] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00 },
+ [ 98] = { 0x00, 0x00, 0xe0, 0x60, 0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00 },
+ [ 99] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00 },
+ [100] = { 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00 },
+ [101] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00 },
+ [102] = { 0x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00 },
+ [103] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00 },
+ [104] = { 0x00, 0x00, 0xe0, 0x60, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00 },
+ [105] = { 0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00 },
+ [106] = { 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00 },
+ [107] = { 0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00 },
+ [108] = { 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00 },
+ [109] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0xfe, 0xd6, 0xd6, 0xd6, 0xd6, 0xc6, 0x00, 0x00, 0x00, 0x00 },
+ [110] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00 },
+ [111] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00 },
+ [112] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00 },
+ [113] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00 },
+ [114] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00 },
+ [115] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00 },
+ [116] = { 0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00 },
+ [117] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00 },
+ [118] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00 },
+ [119] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00 },
+ [120] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x6c, 0x38, 0x38, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00 },
+ [121] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00 },
+ [122] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00 },
+ [123] = { 0x00, 0x00, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00 },
+ [124] = { 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00 },
+ [125] = { 0x00, 0x00, 0x70, 0x18, 0x18, 0x18, 0x0e, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00 },
+ [126] = { 0x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ [127] = { 0x30, 0x18, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00 },
+};
diff --git a/04-ring1-kernel-surgeon/hv/linker.ld b/04-ring1-kernel-surgeon/hv/linker.ld
new file mode 100644
index 0000000..91fcbf8
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/linker.ld
@@ -0,0 +1,41 @@
+ENTRY(_start)
+
+SECTIONS
+{
+ . = 0x00200000;
+ __hv_start = .;
+
+ .text ALIGN(4096) : {
+ KEEP(*(.multiboot))
+ *(.text .text.*)
+ }
+
+ .rodata ALIGN(4096) : {
+ *(.rodata .rodata.*)
+ }
+
+ .data ALIGN(4096) : {
+ *(.data .data.*)
+ }
+
+ . = ALIGN(4096);
+ __bss_vma = .;
+ .bss : {
+ __bss_start = .;
+ *(COMMON)
+ *(.bss .bss.*)
+ . = ALIGN(4096);
+ __bss_end = .;
+ . = 0x00400000 - __bss_vma;
+ }
+
+ __hv_end = .;
+
+ ASSERT(__hv_end == 0x00400000, "Hypervisor arena must be exact 2 MiB (0x00200000..0x00400000)")
+
+ /DISCARD/ : {
+ *(.comment)
+ *(.note.*)
+ *(.eh_frame*)
+ }
+}
diff --git a/04-ring1-kernel-surgeon/hv/linux_boot.c b/04-ring1-kernel-surgeon/hv/linux_boot.c
new file mode 100644
index 0000000..f7146f6
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/linux_boot.c
@@ -0,0 +1,337 @@
+#include "linux_boot.h"
+
+#define HV_ARENA_START 0x00200000ULL
+#define HV_ARENA_END 0x00400000ULL
+
+#define BOOT_PARAMS_PA 0x00600000ULL
+#define CMDLINE_PA 0x00601000ULL
+#define RSDP_COPY_PA 0x00602000ULL
+#define GUEST_GDT_PA 0x00603000ULL
+#define GUEST_STACK_PA 0x0060F000ULL
+#define GUEST_PT_BASE 0x00610000ULL // PML4 + PDPT + 4x PD = 6 pages (24 KiB)
+
+#define INITRD_DEST_PA 0x08000000ULL // 128 MiB
+#define BOUNCE_BASE_PA 0x18000000ULL // 384 MiB (safe temporary bounce area)
+
+typedef struct __attribute__((packed)) {
+ uint32_t type;
+ uint32_t size;
+} Mb2Tag;
+
+typedef struct __attribute__((packed)) {
+ uint32_t type;
+ uint32_t size;
+ uint32_t mod_start;
+ uint32_t mod_end;
+ char cmdline[];
+} Mb2TagModule;
+
+typedef struct __attribute__((packed)) {
+ uint32_t type;
+ uint32_t size;
+ uint32_t entry_size;
+ uint32_t entry_version;
+} Mb2TagMmap;
+
+typedef struct __attribute__((packed)) {
+ uint64_t addr;
+ uint64_t len;
+ uint32_t type;
+ uint32_t zero;
+} Mb2MmapEntry;
+
+typedef struct __attribute__((packed)) {
+ uint32_t type;
+ uint32_t size;
+ uint64_t fb_addr;
+ uint32_t fb_pitch;
+ uint32_t fb_width;
+ uint32_t fb_height;
+ uint8_t fb_bpp;
+ uint8_t fb_type;
+ uint16_t reserved;
+ // RGB fields when fb_type == 1
+ uint8_t red_pos;
+ uint8_t red_mask_size;
+ uint8_t green_pos;
+ uint8_t green_mask_size;
+ uint8_t blue_pos;
+ uint8_t blue_mask_size;
+} Mb2TagFb;
+
+static bool str_contains(const char *hay, const char *needle) {
+ size_t nlen = hv_strlen(needle);
+ if (nlen == 0) return true;
+ for (size_t i = 0; hay[i]; i++) {
+ if (hv_strncmp(hay + i, needle, nlen) == 0) return true;
+ }
+ return false;
+}
+
+bool mb2_parse(uint64_t magic, uint64_t mbi_addr, BootAssets *out) {
+ hv_memset(out, 0, sizeof(*out));
+ if ((uint32_t)magic != MB2_BOOTLOADER_MAGIC) {
+ kprintf("[MB2] ERROR: bad magic 0x%lx (expected 0x%x)\n", magic, MB2_BOOTLOADER_MAGIC);
+ return false;
+ }
+
+ uint32_t total_size = *(const uint32_t *)(uintptr_t)mbi_addr;
+ uint64_t cur = mbi_addr + 8;
+ uint64_t end = mbi_addr + total_size;
+ int mod_idx = 0;
+
+ while (cur < end) {
+ const Mb2Tag *tag = (const Mb2Tag *)(uintptr_t)cur;
+ if (tag->type == 0) break;
+
+ if (tag->type == 3) {
+ // Module
+ const Mb2TagModule *m = (const Mb2TagModule *)tag;
+ uint32_t sz = m->mod_end - m->mod_start;
+ kprintf("[MB2] Module %d: 0x%x..0x%x (%u bytes) \"%s\"\n",
+ mod_idx, m->mod_start, m->mod_end, sz, m->cmdline);
+ if (str_contains(m->cmdline, "vmlinuz") || str_contains(m->cmdline, "kernel") ||
+ (mod_idx == 0 && out->vmlinuz_addr == 0)) {
+ out->vmlinuz_addr = m->mod_start;
+ out->vmlinuz_size = sz;
+ } else if (str_contains(m->cmdline, "initr") || mod_idx == 1) {
+ out->initrd_addr = m->mod_start;
+ out->initrd_size = sz;
+ }
+ mod_idx++;
+ } else if (tag->type == 6) {
+ // Memory map
+ const Mb2TagMmap *mm = (const Mb2TagMmap *)tag;
+ uint64_t ecur = cur + sizeof(Mb2TagMmap);
+ uint64_t eend = cur + tag->size;
+ while (ecur + sizeof(Mb2MmapEntry) <= eend && out->mmap_count < 64) {
+ const Mb2MmapEntry *e = (const Mb2MmapEntry *)(uintptr_t)ecur;
+ out->mmap[out->mmap_count].addr = e->addr;
+ out->mmap[out->mmap_count].len = e->len;
+ out->mmap[out->mmap_count].type = e->type;
+ out->mmap_count++;
+ ecur += mm->entry_size;
+ }
+ } else if (tag->type == 8) {
+ // Framebuffer
+ const Mb2TagFb *fb = (const Mb2TagFb *)tag;
+ out->fb.addr = fb->fb_addr;
+ out->fb.pitch = fb->fb_pitch;
+ out->fb.width = fb->fb_width;
+ out->fb.height = fb->fb_height;
+ out->fb.bpp = fb->fb_bpp;
+ if (fb->fb_type == 1) {
+ out->fb.red_pos = fb->red_pos;
+ out->fb.red_size = fb->red_mask_size;
+ out->fb.green_pos = fb->green_pos;
+ out->fb.green_size = fb->green_mask_size;
+ out->fb.blue_pos = fb->blue_pos;
+ out->fb.blue_size = fb->blue_mask_size;
+ }
+ kprintf("[MB2] Framebuffer: %ux%ux%u pitch=%u @ 0x%lx (R:%u/%u G:%u/%u B:%u/%u)\n",
+ out->fb.width, out->fb.height, out->fb.bpp, out->fb.pitch, out->fb.addr,
+ out->fb.red_pos, out->fb.red_size,
+ out->fb.green_pos, out->fb.green_size,
+ out->fb.blue_pos, out->fb.blue_size);
+ } else if (tag->type == 14 || tag->type == 15) {
+ // ACPI RSDP (14 = v1 20B, 15 = v2 36B; prefer v2 if both present)
+ uint32_t plen = tag->size - 8;
+ if (tag->type == 15 || out->acpi_rsdp_src == 0) {
+ out->acpi_rsdp_src = cur + 8;
+ out->acpi_rsdp_len = plen;
+ kprintf("[MB2] ACPI RSDP (tag %u, %u bytes) @ 0x%lx\n", tag->type, plen, out->acpi_rsdp_src);
+ }
+ }
+
+ cur += (tag->size + 7U) & ~7U;
+ }
+
+ return out->vmlinuz_addr != 0 && out->vmlinuz_size > 1024;
+}
+
+typedef struct __attribute__((packed)) {
+ uint64_t addr;
+ uint64_t size;
+ uint32_t type;
+} E820Entry;
+
+static void e820_push(E820Entry *tbl, uint8_t *cnt, uint64_t addr, uint64_t size, uint32_t type) {
+ if (size == 0 || *cnt >= 126) return;
+ tbl[*cnt].addr = addr;
+ tbl[*cnt].size = size;
+ tbl[*cnt].type = type;
+ (*cnt)++;
+}
+
+static void e820_add_carved(E820Entry *tbl, uint8_t *cnt, uint64_t addr, uint64_t size, uint32_t type,
+ uint64_t cut_start, uint64_t cut_end, uint32_t cut_type) {
+ uint64_t end = addr + size;
+ if (type != 1 || end <= cut_start || addr >= cut_end) {
+ e820_push(tbl, cnt, addr, size, type);
+ return;
+ }
+ if (addr < cut_start) {
+ e820_push(tbl, cnt, addr, cut_start - addr, type);
+ }
+ uint64_t cs = (addr > cut_start) ? addr : cut_start;
+ uint64_t ce = (end < cut_end) ? end : cut_end;
+ e820_push(tbl, cnt, cs, ce - cs, cut_type);
+ if (end > cut_end) {
+ e820_push(tbl, cnt, cut_end, end - cut_end, type);
+ }
+}
+
+bool linux_prepare_guest(const BootAssets *assets, LinuxGuestInit *init_out) {
+ // 1. Copy both Multiboot2 modules into a safe bounce area first so nothing overlaps
+ uint64_t vml_bounce = BOUNCE_BASE_PA;
+ uint64_t ird_bounce = (BOUNCE_BASE_PA + assets->vmlinuz_size + 0xFFFULL) & ~0xFFFULL;
+ hv_memmove((void *)(uintptr_t)vml_bounce, (const void *)(uintptr_t)assets->vmlinuz_addr, assets->vmlinuz_size);
+ if (assets->initrd_addr && assets->initrd_size) {
+ hv_memmove((void *)(uintptr_t)ird_bounce, (const void *)(uintptr_t)assets->initrd_addr, assets->initrd_size);
+ }
+
+ const uint8_t *bz = (const uint8_t *)(uintptr_t)vml_bounce;
+ if (*(const uint32_t *)(bz + 0x202) != 0x53726448U) { // "HdrS"
+ kprintf("[LINUX] ERROR: invalid bzImage magic (expected HdrS)\n");
+ return false;
+ }
+
+ uint16_t boot_proto = *(const uint16_t *)(bz + 0x206);
+ uint8_t setup_sects = bz[0x1F1];
+ if (setup_sects == 0) setup_sects = 4;
+ uint32_t payload_off = ((uint32_t)setup_sects + 1U) * 512U;
+ uint32_t payload_len = assets->vmlinuz_size - payload_off;
+ uint64_t pref_addr = *(const uint64_t *)(bz + 0x258);
+ uint32_t init_size = *(const uint32_t *)(bz + 0x260);
+ if (pref_addr == 0) pref_addr = 0x01000000ULL;
+
+ kprintf("[LINUX] bzImage proto=0x%x setup_sects=%u payload=%u B pref_addr=0x%lx init_size=0x%x\n",
+ boot_proto, setup_sects, payload_len, pref_addr, init_size);
+
+ // 2. Copy protected-mode kernel payload to pref_addr (0x01000000) and initramfs to 0x08000000
+ hv_memmove((void *)(uintptr_t)pref_addr, bz + payload_off, payload_len);
+ if (assets->initrd_size) {
+ hv_memmove((void *)(uintptr_t)INITRD_DEST_PA, (const void *)(uintptr_t)ird_bounce, assets->initrd_size);
+ }
+
+ // 3. Build boot_params ("zero page") at BOOT_PARAMS_PA (0x00600000)
+ uint8_t *bp = (uint8_t *)(uintptr_t)BOOT_PARAMS_PA;
+ hv_memset(bp, 0, 4096);
+
+ // Copy setup_header [0x1F1 .. hdr_end)
+ uint32_t hdr_end = 0x202U + bz[0x201];
+ if (hdr_end < 0x268U) hdr_end = 0x268U;
+ if (hdr_end > 0x290U) hdr_end = 0x290U;
+ hv_memcpy(bp + 0x1F1, bz + 0x1F1, hdr_end - 0x1F1);
+
+ // Command line at CMDLINE_PA (0x00601000)
+ const char *cmdline =
+ "console=tty0 console=ttyS0,115200 earlyprintk=serial,ttyS0,115200 "
+ "nokaslr nr_cpus=1 nosmp noapic_debug rdinit=/init";
+ char *cmd_dst = (char *)(uintptr_t)CMDLINE_PA;
+ hv_memset(cmd_dst, 0, 4096);
+ hv_memcpy(cmd_dst, cmdline, hv_strlen(cmdline) + 1);
+
+ // Patch boot_params.hdr fields (verified against linux-headers-5.15.0-185-generic)
+ bp[0x210] = 0xFF; // type_of_loader = undefined/custom
+ bp[0x211] = (uint8_t)((bp[0x211] | 0x81) & ~0x20); // LOADED_HIGH | CAN_USE_HEAP, clear QUIET
+ *(uint32_t *)(bp + 0x218) = (uint32_t)INITRD_DEST_PA; // ramdisk_image
+ *(uint32_t *)(bp + 0x21C) = assets->initrd_size; // ramdisk_size
+ *(uint32_t *)(bp + 0x228) = (uint32_t)CMDLINE_PA; // cmd_line_ptr
+
+ // 4. Populate screen_info (offset 0x000) for Linux built-in efifb!
+ if (assets->fb.ready) {
+ bp[0x07] = 80; // orig_video_cols
+ bp[0x0E] = 25; // orig_video_lines
+ bp[0x0F] = 0x70; // orig_video_isVGA = VIDEO_TYPE_EFI
+ *(uint16_t *)(bp + 0x12) = (uint16_t)assets->fb.width;
+ *(uint16_t *)(bp + 0x14) = (uint16_t)assets->fb.height;
+ *(uint16_t *)(bp + 0x16) = (uint16_t)assets->fb.bpp;
+ *(uint32_t *)(bp + 0x18) = (uint32_t)assets->fb.addr;
+ *(uint32_t *)(bp + 0x1C) = assets->fb.pitch * assets->fb.height; // lfb_size in bytes (EFI)
+ *(uint16_t *)(bp + 0x24) = (uint16_t)assets->fb.pitch;
+ bp[0x26] = assets->fb.red_size;
+ bp[0x27] = assets->fb.red_pos;
+ bp[0x28] = assets->fb.green_size;
+ bp[0x29] = assets->fb.green_pos;
+ bp[0x2A] = assets->fb.blue_size;
+ bp[0x2B] = assets->fb.blue_pos;
+ bp[0x2C] = 8;
+ bp[0x2D] = 24;
+ uint32_t caps = 0x01; // VIDEO_CAPABILITY_SKIP_QUIRKS
+ if (assets->fb.addr >> 32) {
+ caps |= 0x02; // VIDEO_CAPABILITY_64BIT_BASE
+ *(uint32_t *)(bp + 0x3A) = (uint32_t)(assets->fb.addr >> 32);
+ }
+ *(uint32_t *)(bp + 0x36) = caps;
+ }
+
+ // 5. Copy ACPI RSDP to safe guest-accessible page (RSDP_COPY_PA = 0x00602000)
+ if (assets->acpi_rsdp_src && assets->acpi_rsdp_len > 0 && assets->acpi_rsdp_len <= 4096) {
+ hv_memset((void *)(uintptr_t)RSDP_COPY_PA, 0, 4096);
+ hv_memcpy((void *)(uintptr_t)RSDP_COPY_PA,
+ (const void *)(uintptr_t)assets->acpi_rsdp_src,
+ assets->acpi_rsdp_len);
+ *(uint64_t *)(bp + 0x070) = RSDP_COPY_PA; // boot_params.acpi_rsdp_addr
+ }
+
+ // 6. Populate E820 table (offset 0x2D0), carving out Ring -1 arena (0x00200000..0x00600000)
+ // as E820_RESERVED (type 2) and RSDP copy (0x00602000..0x00603000) as E820_ACPI (type 3)
+ E820Entry tmp1[128], tmp2[128];
+ uint8_t tmp1_cnt = 0, tmp2_cnt = 0;
+ for (uint32_t i = 0; i < assets->mmap_count; i++) {
+ // Hide >= 4 GiB (2 GiB NVDIMM holding MiniCPM5-2B weights!) completely from Linux E820
+ if (assets->mmap[i].addr >= 0x100000000ULL) continue;
+ e820_add_carved(tmp1, &tmp1_cnt,
+ assets->mmap[i].addr, assets->mmap[i].len, assets->mmap[i].type,
+ HV_ARENA_START, HV_ARENA_END, 2);
+ }
+ // Also carve 64 MiB Ring -1 LLM runtime arena (0x70000000..0x73FFFFFF) as E820_RESERVED
+ for (uint8_t i = 0; i < tmp1_cnt; i++) {
+ e820_add_carved(tmp2, &tmp2_cnt,
+ tmp1[i].addr, tmp1[i].size, tmp1[i].type,
+ 0x70000000ULL, 0x74000000ULL, 2);
+ }
+ E820Entry *e820 = (E820Entry *)(bp + 0x2D0);
+ uint8_t final_cnt = 0;
+ for (uint8_t i = 0; i < tmp2_cnt; i++) {
+ e820_add_carved(e820, &final_cnt,
+ tmp2[i].addr, tmp2[i].size, tmp2[i].type,
+ RSDP_COPY_PA, RSDP_COPY_PA + 0x1000ULL, 3);
+ }
+ bp[0x1E8] = final_cnt;
+ kprintf("[LINUX] E820 entries=%u (Ring -1 0x%lx..0x%lx marked RESERVED)\n",
+ final_cnt, HV_ARENA_START, HV_ARENA_END);
+
+ // 7. Build clean guest GDT at GUEST_GDT_PA (0x00603000)
+ uint64_t *ggdt = (uint64_t *)(uintptr_t)GUEST_GDT_PA;
+ hv_memset(ggdt, 0, 4096);
+ ggdt[0] = 0x0000000000000000ULL; // 0x00 null
+ ggdt[1] = 0x00AF9A000000FFFFULL; // 0x08 64-bit code
+ ggdt[2] = 0x00CF92000000FFFFULL; // 0x10 64-bit data
+ ggdt[3] = 0x00008B0000000067ULL; // 0x18 64-bit TSS (busy)
+ ggdt[4] = 0x0000000000000000ULL;
+
+ // 8. Build initial 64-bit identity guest page tables (0..4 GiB via 2 MiB pages) at GUEST_PT_BASE
+ uint64_t *gpml4 = (uint64_t *)(uintptr_t)(GUEST_PT_BASE + 0x0000);
+ uint64_t *gpdpt = (uint64_t *)(uintptr_t)(GUEST_PT_BASE + 0x1000);
+ uint64_t *gpd = (uint64_t *)(uintptr_t)(GUEST_PT_BASE + 0x2000);
+ hv_memset(gpml4, 0, 6 * 4096);
+
+ gpml4[0] = (uint64_t)(uintptr_t)gpdpt | 0x03ULL;
+ for (uint64_t g = 0; g < 4; g++) {
+ uint64_t *pd = gpd + g * 512;
+ gpdpt[g] = (uint64_t)(uintptr_t)pd | 0x03ULL;
+ for (uint64_t i = 0; i < 512; i++) {
+ pd[i] = ((g << 30) | (i << 21)) | 0x83ULL;
+ }
+ }
+
+ init_out->entry_rip = pref_addr + 0x200ULL; // Linux 64-bit startup_64!
+ init_out->boot_params_pa = BOOT_PARAMS_PA;
+ init_out->guest_cr3 = (uint64_t)(uintptr_t)gpml4;
+ init_out->guest_gdtr_base = GUEST_GDT_PA;
+ init_out->guest_gdtr_limit = 5 * 8 - 1;
+ init_out->guest_rsp = GUEST_STACK_PA;
+ return true;
+}
diff --git a/04-ring1-kernel-surgeon/hv/linux_boot.h b/04-ring1-kernel-surgeon/hv/linux_boot.h
new file mode 100644
index 0000000..e18b615
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/linux_boot.h
@@ -0,0 +1,34 @@
+#pragma once
+#include "types.h"
+#include "fb.h"
+
+#define MB2_BOOTLOADER_MAGIC 0x36D76289U
+
+typedef struct {
+ FbInfo fb;
+ uint64_t vmlinuz_addr;
+ uint32_t vmlinuz_size;
+ uint64_t initrd_addr;
+ uint32_t initrd_size;
+ uint64_t acpi_rsdp_src;
+ uint32_t acpi_rsdp_len;
+ // Parsed Multiboot2 E820 entries
+ struct {
+ uint64_t addr;
+ uint64_t len;
+ uint32_t type;
+ } mmap[64];
+ uint32_t mmap_count;
+} BootAssets;
+
+typedef struct {
+ uint64_t entry_rip;
+ uint64_t boot_params_pa;
+ uint64_t guest_cr3;
+ uint64_t guest_gdtr_base;
+ uint32_t guest_gdtr_limit;
+ uint64_t guest_rsp;
+} LinuxGuestInit;
+
+bool mb2_parse(uint64_t magic, uint64_t mbi_addr, BootAssets *out);
+bool linux_prepare_guest(const BootAssets *assets, LinuxGuestInit *init_out);
diff --git a/04-ring1-kernel-surgeon/hv/llm_engine.c b/04-ring1-kernel-surgeon/hv/llm_engine.c
new file mode 100644
index 0000000..a7ce9c1
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/llm_engine.c
@@ -0,0 +1,898 @@
+// ============================================================================
+// hv/llm_engine.c — Freestanding AVX2 + FMA + F16C MiniCPM5-2B Q4_K_M Engine
+// Zero libc, zero libm, runs identically in host unit tests and bare-metal Ring -1!
+// ============================================================================
+#include "llm_engine.h"
+#if !__STDC_HOSTED__
+#define _MM_MALLOC_H_INCLUDED
+#endif
+#include <immintrin.h>
+
+typedef struct __attribute__((packed)) {
+ uint16_t d;
+ uint16_t dmin;
+ uint8_t scales[12];
+ uint8_t qs[128];
+} BlockQ4K;
+
+typedef struct __attribute__((packed)) {
+ uint8_t ql[128];
+ uint8_t qh[64];
+ int8_t scales[16];
+ uint16_t d;
+} BlockQ6K;
+
+_Static_assert(sizeof(BlockQ4K) == 144, "BlockQ4K must be 144 bytes");
+_Static_assert(sizeof(BlockQ6K) == 210, "BlockQ6K must be 210 bytes");
+
+// ============================================================================
+// Freestanding Math (zero libm)
+// ============================================================================
+static inline float fp16_to_fp32(uint16_t h) {
+ return _cvtsh_ss(h);
+}
+
+static inline float hv_sqrtf(float x) {
+ __m128 v = _mm_set_ss(x);
+ return _mm_cvtss_f32(_mm_sqrt_ss(v));
+}
+
+static float hv_expf(float x) {
+ if (x < -88.0f) return 0.0f;
+ if (x > 88.0f) x = 88.0f;
+ // Range reduction: x = k * ln(2) + r, |r| <= ln(2)/2
+ const double inv_ln2 = 1.4426950408889634;
+ const double ln2 = 0.6931471805599453;
+ int k = (int)(x * inv_ln2 + (x >= 0.0f ? 0.5 : -0.5));
+ double r = (double)x - (double)k * ln2;
+ // Degree-6 Taylor polynomial for exp(r) on [-0.35, 0.35] (< 1e-8 error)
+ double p = 1.0 + r * (1.0 + r * (0.5 + r * (1.0/6.0 + r * (1.0/24.0 + r * (1.0/120.0 + r * (1.0/720.0))))));
+ // Multiply by 2^k via IEEE-754 exponent bits
+ union { double d; uint64_t u; } scale;
+ scale.u = (uint64_t)(k + 1023) << 52;
+ return (float)(p * scale.d);
+}
+
+static void hv_sincos_d(double x, float *s_out, float *c_out) {
+ const double two_pi = 6.28318530717958647692;
+ const double pi = 3.14159265358979323846;
+ const double half_pi = 1.57079632679489661923;
+ // Reduce to [-pi, pi]
+ double q = (double)(int64_t)(x / two_pi + (x >= 0.0 ? 0.5 : -0.5));
+ x -= q * two_pi;
+ if (x > pi) x -= two_pi;
+ if (x < -pi) x += two_pi;
+ // Fold into [-pi/2, pi/2]
+ double sign_c = 1.0;
+ if (x > half_pi) { x = pi - x; sign_c = -1.0; }
+ else if (x < -half_pi) { x = -pi - x; sign_c = -1.0; }
+ double x2 = x * x;
+ double s = x * (1.0 - x2 * (1.0/6.0 - x2 * (1.0/120.0 - x2 * (1.0/5040.0 - x2 * (1.0/362880.0)))));
+ double c = 1.0 - x2 * (0.5 - x2 * (1.0/24.0 - x2 * (1.0/720.0 - x2 * (1.0/40320.0 - x2 * (1.0/3628800.0)))));
+ *s_out = (float)s;
+ *c_out = (float)(c * sign_c);
+}
+
+static double hv_log_d(double x) {
+ union { double d; uint64_t u; } v;
+ v.d = x;
+ int e = (int)((v.u >> 52) & 0x7FF) - 1023;
+ v.u = (v.u & 0x000FFFFFFFFFFFFFULL) | (1023ULL << 52);
+ double m = v.d; // [1, 2)
+ double y = (m - 1.0) / (m + 1.0);
+ double y2 = y * y;
+ double ln_m = 2.0 * y * (1.0 + y2 * (1.0/3.0 + y2 * (1.0/5.0 + y2 * (1.0/7.0 + y2 * (1.0/9.0 + y2 * (1.0/11.0))))));
+ return ln_m + (double)e * 0.6931471805599453;
+}
+
+static double hv_pow_d(double base, double exp_val) {
+ double lx = exp_val * hv_log_d(base);
+ const double inv_ln2 = 1.4426950408889634;
+ const double ln2 = 0.6931471805599453;
+ int k = (int)(lx * inv_ln2 + (lx >= 0.0 ? 0.5 : -0.5));
+ double r = lx - (double)k * ln2;
+ double p = 1.0 + r * (1.0 + r * (0.5 + r * (1.0/6.0 + r * (1.0/24.0 + r * (1.0/120.0 + r * (1.0/720.0))))));
+ union { double d; uint64_t u; } sc;
+ sc.u = (uint64_t)(k + 1023) << 52;
+ return p * sc.d;
+}
+
+// ============================================================================
+// AVX2 + FMA + F16C Quantized Dot Products (Q4_K & Q6_K)
+// ============================================================================
+static inline float hsum256_ps(__m256 v) {
+ __m128 lo = _mm256_castps256_ps128(v);
+ __m128 hi = _mm256_extractf128_ps(v, 1);
+ __m128 s = _mm_add_ps(lo, hi);
+ s = _mm_hadd_ps(s, s);
+ s = _mm_hadd_ps(s, s);
+ return _mm_cvtss_f32(s);
+}
+
+static inline void get_scale_min_k4(int j, const uint8_t *q, uint8_t *d, uint8_t *m) {
+ if (j < 4) {
+ *d = q[j] & 63;
+ *m = q[j + 4] & 63;
+ } else {
+ *d = (uint8_t)((q[j + 4] & 0xF) | ((q[j - 4] >> 6) << 4));
+ *m = (uint8_t)((q[j + 4] >> 4) | ((q[j] >> 6) << 4));
+ }
+}
+
+static float dot_q4_K_f32(const BlockQ4K *row, const float *x, int cols) {
+ const int nb = cols >> 8; // cols / 256
+ float sum = 0.0f;
+ const __m128i mask_lo = _mm_set1_epi8(0x0F);
+
+ for (int i = 0; i < nb; i++) {
+ const float d = fp16_to_fp32(row[i].d);
+ const float min = fp16_to_fp32(row[i].dmin);
+ const uint8_t *q = row[i].qs;
+ const float *xp = x + (i << 8);
+ int is = 0;
+
+ for (int j = 0; j < 256; j += 64) {
+ uint8_t sc1, m1, sc2, m2;
+ get_scale_min_k4(is + 0, row[i].scales, &sc1, &m1);
+ get_scale_min_k4(is + 1, row[i].scales, &sc2, &m2);
+ const float d1 = d * (float)sc1, dm1 = min * (float)m1;
+ const float d2 = d * (float)sc2, dm2 = min * (float)m2;
+
+ __m256 aq1 = _mm256_setzero_ps(), ax1 = _mm256_setzero_ps();
+ __m256 aq2 = _mm256_setzero_ps(), ax2 = _mm256_setzero_ps();
+
+ for (int l = 0; l < 32; l += 8) {
+ __m128i qb = _mm_loadl_epi64((const __m128i *)(q + l));
+ __m128i qlo = _mm_and_si128(qb, mask_lo);
+ __m128i qhi = _mm_and_si128(_mm_srli_epi16(qb, 4), mask_lo);
+
+ __m256 f_lo = _mm256_cvtepi32_ps(_mm256_cvtepu8_epi32(qlo));
+ __m256 f_hi = _mm256_cvtepi32_ps(_mm256_cvtepu8_epi32(qhi));
+ __m256 x_lo = _mm256_loadu_ps(xp + l);
+ __m256 x_hi = _mm256_loadu_ps(xp + 32 + l);
+
+ aq1 = _mm256_fmadd_ps(f_lo, x_lo, aq1);
+ ax1 = _mm256_add_ps(x_lo, ax1);
+ aq2 = _mm256_fmadd_ps(f_hi, x_hi, aq2);
+ ax2 = _mm256_add_ps(x_hi, ax2);
+ }
+
+ sum += d1 * hsum256_ps(aq1) - dm1 * hsum256_ps(ax1)
+ + d2 * hsum256_ps(aq2) - dm2 * hsum256_ps(ax2);
+
+ q += 32;
+ xp += 64;
+ is += 2;
+ }
+ }
+ return sum;
+}
+
+static float dot_q6_K_f32(const BlockQ6K *row, const float *x, int cols) {
+ const int nb = cols >> 8;
+ float sum = 0.0f;
+ const __m128i m_0f = _mm_set1_epi8(0x0F);
+ const __m128i m_03 = _mm_set1_epi8(0x03);
+ const __m256i v_32 = _mm256_set1_epi32(32);
+
+ for (int i = 0; i < nb; i++) {
+ const float d = fp16_to_fp32(row[i].d);
+ const uint8_t *ql = row[i].ql;
+ const uint8_t *qh = row[i].qh;
+ const int8_t *sc = row[i].scales;
+ const float *xp = x + (i << 8);
+ float bsum = 0.0f;
+
+ for (int n = 0; n < 256; n += 128) {
+ for (int half = 0; half < 2; half++) {
+ const int loff = half * 16;
+ __m256 a1 = _mm256_setzero_ps(), a2 = _mm256_setzero_ps();
+ __m256 a3 = _mm256_setzero_ps(), a4 = _mm256_setzero_ps();
+
+ for (int k = 0; k < 16; k += 8) {
+ int l = loff + k;
+ __m128i ql0 = _mm_loadl_epi64((const __m128i *)(ql + l));
+ __m128i ql1 = _mm_loadl_epi64((const __m128i *)(ql + l + 32));
+ __m128i qhb = _mm_loadl_epi64((const __m128i *)(qh + l));
+
+ __m128i h1 = _mm_slli_epi16(_mm_and_si128(qhb, m_03), 4);
+ __m128i h2 = _mm_slli_epi16(_mm_and_si128(_mm_srli_epi16(qhb, 2), m_03), 4);
+ __m128i h3 = _mm_slli_epi16(_mm_and_si128(_mm_srli_epi16(qhb, 4), m_03), 4);
+ __m128i h4 = _mm_slli_epi16(_mm_and_si128(_mm_srli_epi16(qhb, 6), m_03), 4);
+
+ __m128i q1b = _mm_or_si128(_mm_and_si128(ql0, m_0f), h1);
+ __m128i q2b = _mm_or_si128(_mm_and_si128(ql1, m_0f), h2);
+ __m128i q3b = _mm_or_si128(_mm_and_si128(_mm_srli_epi16(ql0, 4), m_0f), h3);
+ __m128i q4b = _mm_or_si128(_mm_and_si128(_mm_srli_epi16(ql1, 4), m_0f), h4);
+
+ __m256 f1 = _mm256_cvtepi32_ps(_mm256_sub_epi32(_mm256_cvtepu8_epi32(q1b), v_32));
+ __m256 f2 = _mm256_cvtepi32_ps(_mm256_sub_epi32(_mm256_cvtepu8_epi32(q2b), v_32));
+ __m256 f3 = _mm256_cvtepi32_ps(_mm256_sub_epi32(_mm256_cvtepu8_epi32(q3b), v_32));
+ __m256 f4 = _mm256_cvtepi32_ps(_mm256_sub_epi32(_mm256_cvtepu8_epi32(q4b), v_32));
+
+ a1 = _mm256_fmadd_ps(f1, _mm256_loadu_ps(xp + l + 0), a1);
+ a2 = _mm256_fmadd_ps(f2, _mm256_loadu_ps(xp + l + 32), a2);
+ a3 = _mm256_fmadd_ps(f3, _mm256_loadu_ps(xp + l + 64), a3);
+ a4 = _mm256_fmadd_ps(f4, _mm256_loadu_ps(xp + l + 96), a4);
+ }
+
+ bsum += (float)sc[half + 0] * hsum256_ps(a1)
+ + (float)sc[half + 2] * hsum256_ps(a2)
+ + (float)sc[half + 4] * hsum256_ps(a3)
+ + (float)sc[half + 6] * hsum256_ps(a4);
+ }
+ xp += 128;
+ ql += 64;
+ qh += 32;
+ sc += 8;
+ }
+ sum += d * bsum;
+ }
+ return sum;
+}
+
+static void dequant_row_q4k(const BlockQ4K *row, float *dst, int cols) {
+ const int nb = cols >> 8;
+ for (int i = 0; i < nb; i++) {
+ const float d = fp16_to_fp32(row[i].d);
+ const float min = fp16_to_fp32(row[i].dmin);
+ const uint8_t *q = row[i].qs;
+ int is = 0;
+ for (int j = 0; j < 256; j += 64) {
+ uint8_t sc, m;
+ get_scale_min_k4(is + 0, row[i].scales, &sc, &m);
+ float d1 = d * (float)sc, m1 = min * (float)m;
+ get_scale_min_k4(is + 1, row[i].scales, &sc, &m);
+ float d2 = d * (float)sc, m2 = min * (float)m;
+ for (int l = 0; l < 32; l++) dst[l] = d1 * (float)(q[l] & 0xF) - m1;
+ for (int l = 0; l < 32; l++) dst[l + 32] = d2 * (float)(q[l] >> 4) - m2;
+ dst += 64;
+ q += 32;
+ is += 2;
+ }
+ }
+}
+
+static void dequant_row_q6k(const BlockQ6K *row, float *dst, int cols) {
+ const int nb = cols >> 8;
+ for (int i = 0; i < nb; i++) {
+ const float d = fp16_to_fp32(row[i].d);
+ const uint8_t *ql = row[i].ql;
+ const uint8_t *qh = row[i].qh;
+ const int8_t *sc = row[i].scales;
+ for (int n = 0; n < 256; n += 128) {
+ for (int l = 0; l < 32; l++) {
+ int is = l >> 4;
+ int8_t q1 = (int8_t)((ql[l + 0] & 0xF) | (((qh[l] >> 0) & 3) << 4)) - 32;
+ int8_t q2 = (int8_t)((ql[l + 32] & 0xF) | (((qh[l] >> 2) & 3) << 4)) - 32;
+ int8_t q3 = (int8_t)((ql[l + 0] >> 4) | (((qh[l] >> 4) & 3) << 4)) - 32;
+ int8_t q4 = (int8_t)((ql[l + 32] >> 4) | (((qh[l] >> 6) & 3) << 4)) - 32;
+ dst[l + 0] = d * (float)sc[is + 0] * (float)q1;
+ dst[l + 32] = d * (float)sc[is + 2] * (float)q2;
+ dst[l + 64] = d * (float)sc[is + 4] * (float)q3;
+ dst[l + 96] = d * (float)sc[is + 6] * (float)q4;
+ }
+ dst += 128;
+ ql += 64;
+ qh += 32;
+ sc += 8;
+ }
+ }
+}
+
+#define PREFILL_B 16
+
+typedef struct {
+ const uint8_t *w_base;
+ uint32_t dtype;
+ const float *X; // [B * cols]
+ float *Out; // [B * rows]
+ int B;
+ int rows;
+ int cols;
+} MatmulBatchJob;
+
+static void matmul_batch_worker(int tid, int nthreads, void *arg) {
+ const MatmulBatchJob *job = (const MatmulBatchJob *)arg;
+ const int r0 = (job->rows * tid) / nthreads;
+ const int r1 = (job->rows * (tid + 1)) / nthreads;
+ const int cols = job->cols;
+ const int rows = job->rows;
+ const int B = job->B;
+ const int nb = cols >> 8;
+ float wbuf[256] __attribute__((aligned(32)));
+
+ size_t row_bytes = (job->dtype == R1M_DTYPE_Q4K)
+ ? ((size_t)nb * sizeof(BlockQ4K))
+ : ((size_t)nb * sizeof(BlockQ6K));
+
+ for (int r = r0; r < r1; r++) {
+ const uint8_t *row_ptr = job->w_base + (size_t)r * row_bytes;
+ __m256 acc[PREFILL_B];
+ for (int b = 0; b < B; b++) acc[b] = _mm256_setzero_ps();
+
+ for (int blk = 0; blk < nb; blk++) {
+ if (job->dtype == R1M_DTYPE_Q4K) {
+ dequant_row_q4k(((const BlockQ4K *)row_ptr) + blk, wbuf, 256);
+ } else {
+ dequant_row_q6k(((const BlockQ6K *)row_ptr) + blk, wbuf, 256);
+ }
+ int col_off = blk << 8;
+ for (int b = 0; b < B; b++) {
+ const float *xb = job->X + (size_t)b * cols + col_off;
+ __m256 a = acc[b];
+ for (int k = 0; k < 256; k += 8) {
+ a = _mm256_fmadd_ps(_mm256_load_ps(wbuf + k), _mm256_loadu_ps(xb + k), a);
+ }
+ acc[b] = a;
+ }
+ }
+ for (int b = 0; b < B; b++) {
+ job->Out[(size_t)b * rows + r] = hsum256_ps(acc[b]);
+ }
+ }
+}
+
+static void matmul_batch_run(const R1LlmState *st, int tensor_idx, const float *X, float *Out, int B, int rows, int cols) {
+ MatmulBatchJob job = {
+ .w_base = st->model_base + st->tdescs[tensor_idx].offset,
+ .dtype = st->tdescs[tensor_idx].dtype,
+ .X = X,
+ .Out = Out,
+ .B = B,
+ .rows = rows,
+ .cols = cols,
+ };
+ if (st->dispatch) st->dispatch(matmul_batch_worker, &job);
+ else matmul_batch_worker(0, 1, &job);
+}
+
+// ============================================================================
+// Parallel Matrix-Vector Dispatch
+// ============================================================================
+typedef struct {
+ const uint8_t *w_base;
+ uint32_t dtype;
+ const float *x;
+ float *out;
+ int rows;
+ int cols;
+} MatmulJob;
+
+static void matmul_worker(int tid, int nthreads, void *arg) {
+ const MatmulJob *job = (const MatmulJob *)arg;
+ int r0 = (job->rows * tid) / nthreads;
+ int r1 = (job->rows * (tid + 1)) / nthreads;
+ int nb = job->cols >> 8;
+ if (job->dtype == R1M_DTYPE_Q4K) {
+ size_t row_bytes = (size_t)nb * sizeof(BlockQ4K);
+ for (int r = r0; r < r1; r++) {
+ const BlockQ4K *blk = (const BlockQ4K *)(job->w_base + (size_t)r * row_bytes);
+ job->out[r] = dot_q4_K_f32(blk, job->x, job->cols);
+ }
+ } else if (job->dtype == R1M_DTYPE_Q6K) {
+ size_t row_bytes = (size_t)nb * sizeof(BlockQ6K);
+ for (int r = r0; r < r1; r++) {
+ const BlockQ6K *blk = (const BlockQ6K *)(job->w_base + (size_t)r * row_bytes);
+ job->out[r] = dot_q6_K_f32(blk, job->x, job->cols);
+ }
+ }
+}
+
+static void matmul_run(const R1LlmState *st, int tensor_idx, const float *x, float *out, int rows, int cols) {
+ MatmulJob job = {
+ .w_base = st->model_base + st->tdescs[tensor_idx].offset,
+ .dtype = st->tdescs[tensor_idx].dtype,
+ .x = x,
+ .out = out,
+ .rows = rows,
+ .cols = cols,
+ };
+ if (st->dispatch) {
+ st->dispatch(matmul_worker, &job);
+ } else {
+ matmul_worker(0, 1, &job);
+ }
+}
+
+static void rmsnorm(float *out, const float *x, const float *w, int n, float eps) {
+ __m256 acc = _mm256_setzero_ps();
+ for (int i = 0; i < n; i += 8) {
+ __m256 vx = _mm256_loadu_ps(x + i);
+ acc = _mm256_fmadd_ps(vx, vx, acc);
+ }
+ float ss = hsum256_ps(acc) / (float)n + eps;
+ float inv = 1.0f / hv_sqrtf(ss);
+ __m256 vinv = _mm256_set1_ps(inv);
+ for (int i = 0; i < n; i += 8) {
+ __m256 vx = _mm256_loadu_ps(x + i);
+ __m256 vw = _mm256_loadu_ps(w + i);
+ _mm256_storeu_ps(out + i, _mm256_mul_ps(_mm256_mul_ps(vx, vinv), vw));
+ }
+}
+
+// ============================================================================
+// Init & Transformer Forward (LlamaForCausalLM)
+// ============================================================================
+bool r1_llm_init(R1LlmState *st, const void *model_base, void *arena_64mb, R1ParallelDispatch dispatch) {
+ hv_memset(st, 0, sizeof(*st));
+ const R1MHeader *h = (const R1MHeader *)model_base;
+ if (hv_strncmp(h->magic, "R1SURG01", 8) != 0) {
+ return false;
+ }
+ st->model_base = (const uint8_t *)model_base;
+ st->hdr = h;
+ st->tdescs = (const R1MTensorDesc *)(st->model_base + h->tdesc_off);
+ st->byte_to_tok = (const uint32_t *)(st->model_base + h->b2t_off);
+ st->vocab_offs = (const uint32_t *)(st->model_base + h->voffs_off);
+ st->vocab_lens = (const uint16_t *)(st->model_base + h->vlens_off);
+ st->vocab_pool = (const uint8_t *)(st->model_base + h->vpool_off);
+ st->merge_ht = (const R1MMergeSlot *)(st->model_base + h->merge_ht_off);
+ st->dispatch = dispatch;
+
+ // Carve 64-byte aligned buffers out of the 64 MiB runtime arena
+ uint8_t *ptr = (uint8_t *)arena_64mb;
+ #define ALLOC_F32(dst, count) do { \
+ ptr = (uint8_t *)(((uintptr_t)ptr + 63ULL) & ~63ULL); \
+ (dst) = (float *)ptr; \
+ ptr += (size_t)(count) * sizeof(float); \
+ } while (0)
+
+ uint32_t kv_dim = h->n_kv_heads * h->head_dim;
+ ALLOC_F32(st->k_cache, (size_t)h->n_layers * R1M_MAX_SEQ * kv_dim);
+ ALLOC_F32(st->v_cache, (size_t)h->n_layers * R1M_MAX_SEQ * kv_dim);
+ ALLOC_F32(st->rope_cos, (size_t)R1M_MAX_SEQ * (h->head_dim / 2));
+ ALLOC_F32(st->rope_sin, (size_t)R1M_MAX_SEQ * (h->head_dim / 2));
+ ALLOC_F32(st->x, h->dim);
+ ALLOC_F32(st->xb, h->dim);
+ ALLOC_F32(st->xb2, h->dim);
+ ALLOC_F32(st->q, h->dim);
+ ALLOC_F32(st->k, kv_dim);
+ ALLOC_F32(st->v, kv_dim);
+ ALLOC_F32(st->hb, h->ffn_dim);
+ ALLOC_F32(st->hb2, h->ffn_dim);
+ ALLOC_F32(st->att, (size_t)h->n_heads * R1M_MAX_SEQ);
+ ALLOC_F32(st->logits, h->vocab_size);
+ ALLOC_F32(st->bx, (size_t)PREFILL_B * h->dim);
+ ALLOC_F32(st->bxb, (size_t)PREFILL_B * h->dim);
+ ALLOC_F32(st->bxb2, (size_t)PREFILL_B * h->dim);
+ ALLOC_F32(st->bq, (size_t)PREFILL_B * h->dim);
+ ALLOC_F32(st->bk, (size_t)PREFILL_B * kv_dim);
+ ALLOC_F32(st->bv, (size_t)PREFILL_B * kv_dim);
+ ALLOC_F32(st->bhb, (size_t)PREFILL_B * h->ffn_dim);
+ ALLOC_F32(st->bhb2, (size_t)PREFILL_B * h->ffn_dim);
+ #undef ALLOC_F32
+
+ // Precompute RoPE cos/sin table (base = 5000000.0)
+ int half = (int)(h->head_dim / 2);
+ double inv_freqs[64];
+ for (int i = 0; i < half; i++) {
+ inv_freqs[i] = 1.0 / hv_pow_d((double)h->rope_theta, (double)(2 * i) / (double)h->head_dim);
+ }
+ for (int pos = 0; pos < R1M_MAX_SEQ; pos++) {
+ for (int i = 0; i < half; i++) {
+ double ang = (double)pos * inv_freqs[i];
+ hv_sincos_d(ang, &st->rope_sin[pos * half + i], &st->rope_cos[pos * half + i]);
+ }
+ }
+
+ st->ready = true;
+ return true;
+}
+
+static void transformer_forward(R1LlmState *st, uint32_t token, int pos, bool compute_logits) {
+ const R1MHeader *h = st->hdr;
+ const int dim = (int)h->dim;
+ const int ffn_dim = (int)h->ffn_dim;
+ const int n_heads = (int)h->n_heads;
+ const int n_kv = (int)h->n_kv_heads;
+ const int hd = (int)h->head_dim;
+ const int kv_dim = n_kv * hd;
+ const int kv_mul = n_heads / n_kv;
+ const int half = hd / 2;
+
+ // 1. Token embedding lookup (Q4_K row dequant)
+ size_t emb_row_bytes = (size_t)(dim >> 8) * sizeof(BlockQ4K);
+ const BlockQ4K *emb_row = (const BlockQ4K *)(st->model_base + st->tdescs[0].offset + (size_t)token * emb_row_bytes);
+ dequant_row_q4k(emb_row, st->x, dim);
+
+ const float *rcos = st->rope_cos + pos * half;
+ const float *rsin = st->rope_sin + pos * half;
+ const float inv_sqrt_hd = 1.0f / hv_sqrtf((float)hd);
+
+ // 2. 42 Transformer layers
+ for (int l = 0; l < (int)h->n_layers; l++) {
+ int base_t = 3 + l * 9;
+ const float *attn_norm = (const float *)(st->model_base + st->tdescs[base_t + 0].offset);
+ rmsnorm(st->xb, st->x, attn_norm, dim, h->rms_eps);
+
+ // Q, K, V projections
+ matmul_run(st, base_t + 1, st->xb, st->q, dim, dim);
+ matmul_run(st, base_t + 2, st->xb, st->k, kv_dim, dim);
+ matmul_run(st, base_t + 3, st->xb, st->v, kv_dim, dim);
+
+ // Interleaved RoPE (LLaMA GGUF convention: pairs (2i, 2i+1))
+ for (int hd_idx = 0; hd_idx < n_heads; hd_idx++) {
+ float *qh = st->q + hd_idx * hd;
+ for (int i = 0; i < half; i++) {
+ float q0 = qh[2 * i], q1 = qh[2 * i + 1];
+ float c = rcos[i], s = rsin[i];
+ qh[2 * i] = q0 * c - q1 * s;
+ qh[2 * i + 1] = q0 * s + q1 * c;
+ }
+ }
+ for (int kh_idx = 0; kh_idx < n_kv; kh_idx++) {
+ float *kh = st->k + kh_idx * hd;
+ for (int i = 0; i < half; i++) {
+ float k0 = kh[2 * i], k1 = kh[2 * i + 1];
+ float c = rcos[i], s = rsin[i];
+ kh[2 * i] = k0 * c - k1 * s;
+ kh[2 * i + 1] = k0 * s + k1 * c;
+ }
+ }
+
+ // Store K, V in layer cache
+ size_t loff = (size_t)l * R1M_MAX_SEQ * kv_dim;
+ hv_memcpy(st->k_cache + loff + (size_t)pos * kv_dim, st->k, (size_t)kv_dim * sizeof(float));
+ hv_memcpy(st->v_cache + loff + (size_t)pos * kv_dim, st->v, (size_t)kv_dim * sizeof(float));
+
+ // Grouped-Query Attention (16 Q heads, 2 KV heads)
+ for (int head = 0; head < n_heads; head++) {
+ const float *qh = st->q + head * hd;
+ float *att = st->att + head * R1M_MAX_SEQ;
+ int kvh = head / kv_mul;
+
+ float max_s = -1e30f;
+ for (int t = 0; t <= pos; t++) {
+ const float *kh = st->k_cache + loff + (size_t)t * kv_dim + kvh * hd;
+ __m256 acc = _mm256_setzero_ps();
+ for (int i = 0; i < hd; i += 8) {
+ acc = _mm256_fmadd_ps(_mm256_loadu_ps(qh + i), _mm256_loadu_ps(kh + i), acc);
+ }
+ float sc = hsum256_ps(acc) * inv_sqrt_hd;
+ att[t] = sc;
+ if (sc > max_s) max_s = sc;
+ }
+
+ // Softmax
+ float sum_e = 0.0f;
+ for (int t = 0; t <= pos; t++) {
+ float e = hv_expf(att[t] - max_s);
+ att[t] = e;
+ sum_e += e;
+ }
+ float inv_e = 1.0f / sum_e;
+ for (int t = 0; t <= pos; t++) att[t] *= inv_e;
+
+ // Weighted sum of V
+ float *oh = st->xb + head * hd;
+ for (int i = 0; i < hd; i++) oh[i] = 0.0f;
+ for (int t = 0; t <= pos; t++) {
+ const float *vh = st->v_cache + loff + (size_t)t * kv_dim + kvh * hd;
+ __m256 va = _mm256_set1_ps(att[t]);
+ for (int i = 0; i < hd; i += 8) {
+ __m256 vo = _mm256_loadu_ps(oh + i);
+ vo = _mm256_fmadd_ps(va, _mm256_loadu_ps(vh + i), vo);
+ _mm256_storeu_ps(oh + i, vo);
+ }
+ }
+ }
+
+ // Output projection + residual
+ matmul_run(st, base_t + 4, st->xb, st->xb2, dim, dim);
+ for (int i = 0; i < dim; i += 8) {
+ _mm256_storeu_ps(st->x + i, _mm256_add_ps(_mm256_loadu_ps(st->x + i), _mm256_loadu_ps(st->xb2 + i)));
+ }
+
+ // FFN SwiGLU: silu(gate(x)) * up(x) -> down -> residual
+ const float *ffn_norm = (const float *)(st->model_base + st->tdescs[base_t + 5].offset);
+ rmsnorm(st->xb, st->x, ffn_norm, dim, h->rms_eps);
+ matmul_run(st, base_t + 6, st->xb, st->hb, ffn_dim, dim);
+ matmul_run(st, base_t + 7, st->xb, st->hb2, ffn_dim, dim);
+ for (int i = 0; i < ffn_dim; i++) {
+ float g = st->hb[i];
+ float silu = g / (1.0f + hv_expf(-g));
+ st->hb[i] = silu * st->hb2[i];
+ }
+ matmul_run(st, base_t + 8, st->hb, st->xb2, dim, ffn_dim);
+ for (int i = 0; i < dim; i += 8) {
+ _mm256_storeu_ps(st->x + i, _mm256_add_ps(_mm256_loadu_ps(st->x + i), _mm256_loadu_ps(st->xb2 + i)));
+ }
+ }
+
+ if (!compute_logits) return;
+
+ // 3. Final RMSNorm + LM Head (130560 x 2048 Q6_K)
+ const float *out_norm = (const float *)(st->model_base + st->tdescs[1].offset);
+ rmsnorm(st->xb, st->x, out_norm, dim, h->rms_eps);
+ matmul_run(st, 2, st->xb, st->logits, (int)h->vocab_size, dim);
+}
+
+// ============================================================================
+// Bare-Metal Byte-Level BPE Tokenizer (O(1) FNV-1a Merge Lookup)
+// ============================================================================
+static bool bpe_lookup_merge(const R1LlmState *st, uint32_t lid, uint32_t rid,
+ uint32_t *merged_out, uint32_t *rank_out) {
+ uint32_t mask = st->hdr->merge_ht_cap - 1U;
+ uint32_t idx = ((lid * 2654435761U) ^ (rid * 2246822519U)) & mask;
+ while (true) {
+ const R1MMergeSlot *s = &st->merge_ht[idx];
+ if (s->rank == 0xFFFFFFFFU) return false;
+ if (s->left_id == lid && s->right_id == rid) {
+ *merged_out = s->merged_id;
+ *rank_out = s->rank;
+ return true;
+ }
+ idx = (idx + 1U) & mask;
+ }
+}
+
+static int bpe_encode_chunk(const R1LlmState *st, const uint8_t *bytes, int len,
+ uint32_t *out, int max_out) {
+ if (len <= 0) return 0;
+ uint32_t buf[128];
+ int n = 0;
+ for (int i = 0; i < len && n < 128; i++) {
+ buf[n++] = st->byte_to_tok[bytes[i]];
+ }
+ while (n >= 2) {
+ uint32_t best_rank = 0xFFFFFFFFU;
+ uint32_t best_merged = 0;
+ int best_pos = -1;
+ for (int i = 0; i < n - 1; i++) {
+ uint32_t mid, rk;
+ if (bpe_lookup_merge(st, buf[i], buf[i + 1], &mid, &rk)) {
+ if (rk < best_rank) {
+ best_rank = rk;
+ best_merged = mid;
+ best_pos = i;
+ }
+ }
+ }
+ if (best_pos < 0) break;
+ buf[best_pos] = best_merged;
+ for (int i = best_pos + 1; i < n - 1; i++) buf[i] = buf[i + 1];
+ n--;
+ }
+ int emitted = 0;
+ for (int i = 0; i < n && emitted < max_out; i++) out[emitted++] = buf[i];
+ return emitted;
+}
+
+static inline bool is_alpha(uint8_t c) {
+ return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
+}
+static inline bool is_digit(uint8_t c) {
+ return (c >= '0' && c <= '9');
+}
+
+static int bpe_encode_text(const R1LlmState *st, const char *text, uint32_t *out, int max_out) {
+ const uint8_t *s = (const uint8_t *)text;
+ int len = (int)hv_strlen(text);
+ int i = 0, total = 0;
+
+ while (i < len && total < max_out) {
+ int start = i;
+ if (s[i] == '\n') {
+ while (i < len && s[i] == '\n' && (i - start) < 4) i++;
+ } else if (s[i] == ' ' && i + 1 < len && (is_alpha(s[i + 1]) || s[i + 1] == '_')) {
+ i++;
+ while (i < len && (is_alpha(s[i]) || s[i] == '_') && (i - start) < 32) i++;
+ } else if (is_alpha(s[i]) || s[i] == '_') {
+ while (i < len && (is_alpha(s[i]) || s[i] == '_') && (i - start) < 32) i++;
+ } else if (is_digit(s[i])) {
+ // GPT-2 / MiniCPM5 pre-tokenizer groups digits 1..3 at a time (or single digits)
+ i++;
+ } else if (s[i] == ' ') {
+ if (i + 1 < len && s[i + 1] != ' ' && s[i + 1] != '\n' && !is_digit(s[i + 1])) {
+ i += 2;
+ while (i < len && !is_alpha(s[i]) && !is_digit(s[i]) && s[i] != ' ' && s[i] != '\n' && (i - start) < 8) i++;
+ } else {
+ while (i < len && s[i] == ' ' && (i - start) < 4) i++;
+ }
+ } else {
+ i++;
+ }
+ total += bpe_encode_chunk(st, s + start, i - start, out + total, max_out - total);
+ }
+ return total;
+}
+
+int r1_llm_tokenize_chat(const R1LlmState *st, const char *system_msg, const char *user_msg,
+ uint32_t *out_ids, int max_ids) {
+ const R1MHeader *h = st->hdr;
+ int n = 0;
+ #define PUSH(tok) do { if (n < max_ids) out_ids[n++] = (tok); } while (0)
+ // <s><|im_start|>system\n{system}<|im_end|>\n<|im_start|>user\n{user}<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n
+ PUSH(h->bos_id);
+ PUSH(h->im_start_id);
+ n += bpe_encode_text(st, "system\n", out_ids + n, max_ids - n);
+ n += bpe_encode_text(st, system_msg, out_ids + n, max_ids - n);
+ PUSH(h->im_end_id);
+ n += bpe_encode_text(st, "\n", out_ids + n, max_ids - n);
+
+ PUSH(h->im_start_id);
+ n += bpe_encode_text(st, "user\n", out_ids + n, max_ids - n);
+ n += bpe_encode_text(st, user_msg, out_ids + n, max_ids - n);
+ PUSH(h->im_end_id);
+ n += bpe_encode_text(st, "\n", out_ids + n, max_ids - n);
+
+ PUSH(h->im_start_id);
+ // Notice exact MiniCPM5 non-thinking assistant suffix: assistant (130071? no, encode "assistant\n" or check exact IDs!)
+ n += bpe_encode_text(st, "assistant\n", out_ids + n, max_ids - n);
+ PUSH(h->think_start_id);
+ PUSH(h->nl_nl_id);
+ PUSH(h->think_end_id);
+ PUSH(h->nl_nl_id);
+ #undef PUSH
+ return n;
+}
+
+int r1_llm_decode_piece(const R1LlmState *st, uint32_t tok_id, char *out, int max_len) {
+ if (tok_id >= st->hdr->vocab_size || max_len <= 1) return 0;
+ uint32_t off = st->vocab_offs[tok_id];
+ uint16_t len = st->vocab_lens[tok_id];
+ int copy = (len < (uint16_t)(max_len - 1)) ? (int)len : (max_len - 1);
+ hv_memcpy(out, st->vocab_pool + off, (size_t)copy);
+ out[copy] = '\0';
+ return copy;
+}
+
+int r1_llm_generate(R1LlmState *st, const char *system_msg, const char *user_msg,
+ char *out_text, int max_out_bytes, int max_new_tokens,
+ int *prompt_toks_out, int *gen_toks_out,
+ R1TokenCallback cb, void *cb_ctx) {
+ if (!st->ready) return -1;
+
+ uint32_t prompt_ids[R1M_MAX_SEQ];
+ int n_prompt = r1_llm_tokenize_chat(st, system_msg, user_msg, prompt_ids, R1M_MAX_SEQ - max_new_tokens - 2);
+ if (prompt_toks_out) *prompt_toks_out = n_prompt;
+
+ // 1. Batched prefill (PREFILL_B=16 tokens per weight pass -> 12-16x faster prefill!)
+ const R1MHeader *h = st->hdr;
+ const int dim = (int)h->dim, ffn_dim = (int)h->ffn_dim;
+ const int n_heads = (int)h->n_heads, n_kv = (int)h->n_kv_heads, hd = (int)h->head_dim;
+ const int kv_dim = n_kv * hd, kv_mul = n_heads / n_kv, half = hd / 2;
+ const float inv_sqrt_hd = 1.0f / hv_sqrtf((float)hd);
+ const size_t emb_row_bytes = (size_t)(dim >> 8) * sizeof(BlockQ4K);
+
+ for (int p0 = 0; p0 < n_prompt; p0 += PREFILL_B) {
+ int B = n_prompt - p0;
+ if (B > PREFILL_B) B = PREFILL_B;
+
+ for (int b = 0; b < B; b++) {
+ const BlockQ4K *er = (const BlockQ4K *)(st->model_base + st->tdescs[0].offset + (size_t)prompt_ids[p0 + b] * emb_row_bytes);
+ dequant_row_q4k(er, st->bx + (size_t)b * dim, dim);
+ }
+
+ for (int l = 0; l < (int)h->n_layers; l++) {
+ int base_t = 3 + l * 9;
+ const float *attn_norm = (const float *)(st->model_base + st->tdescs[base_t + 0].offset);
+ for (int b = 0; b < B; b++) rmsnorm(st->bxb + (size_t)b * dim, st->bx + (size_t)b * dim, attn_norm, dim, h->rms_eps);
+
+ matmul_batch_run(st, base_t + 1, st->bxb, st->bq, B, dim, dim);
+ matmul_batch_run(st, base_t + 2, st->bxb, st->bk, B, kv_dim, dim);
+ matmul_batch_run(st, base_t + 3, st->bxb, st->bv, B, kv_dim, dim);
+
+ size_t loff = (size_t)l * R1M_MAX_SEQ * kv_dim;
+ for (int b = 0; b < B; b++) {
+ int pos = p0 + b;
+ const float *rcos = st->rope_cos + pos * half;
+ const float *rsin = st->rope_sin + pos * half;
+ float *qb = st->bq + (size_t)b * dim;
+ float *kb = st->bk + (size_t)b * kv_dim;
+ float *vb = st->bv + (size_t)b * kv_dim;
+
+ for (int hi = 0; hi < n_heads; hi++) {
+ float *qh = qb + hi * hd;
+ for (int i = 0; i < half; i++) {
+ float q0 = qh[2*i], q1 = qh[2*i+1];
+ qh[2*i] = q0*rcos[i] - q1*rsin[i];
+ qh[2*i+1] = q0*rsin[i] + q1*rcos[i];
+ }
+ }
+ for (int ki = 0; ki < n_kv; ki++) {
+ float *kh = kb + ki * hd;
+ for (int i = 0; i < half; i++) {
+ float k0 = kh[2*i], k1 = kh[2*i+1];
+ kh[2*i] = k0*rcos[i] - k1*rsin[i];
+ kh[2*i+1] = k0*rsin[i] + k1*rcos[i];
+ }
+ }
+ hv_memcpy(st->k_cache + loff + (size_t)pos * kv_dim, kb, (size_t)kv_dim * sizeof(float));
+ hv_memcpy(st->v_cache + loff + (size_t)pos * kv_dim, vb, (size_t)kv_dim * sizeof(float));
+
+ float *ob = st->bxb + (size_t)b * dim;
+ for (int head = 0; head < n_heads; head++) {
+ const float *qh = qb + head * hd;
+ float *att = st->att + head * R1M_MAX_SEQ;
+ int kvh = head / kv_mul;
+ float max_s = -1e30f;
+ for (int t = 0; t <= pos; t++) {
+ const float *kh = st->k_cache + loff + (size_t)t * kv_dim + kvh * hd;
+ __m256 acc = _mm256_setzero_ps();
+ for (int i = 0; i < hd; i += 8) acc = _mm256_fmadd_ps(_mm256_loadu_ps(qh+i), _mm256_loadu_ps(kh+i), acc);
+ float sc = hsum256_ps(acc) * inv_sqrt_hd;
+ att[t] = sc;
+ if (sc > max_s) max_s = sc;
+ }
+ float sum_e = 0.0f;
+ for (int t = 0; t <= pos; t++) { float e = hv_expf(att[t] - max_s); att[t] = e; sum_e += e; }
+ float inv_e = 1.0f / sum_e;
+ for (int t = 0; t <= pos; t++) att[t] *= inv_e;
+ float *oh = ob + head * hd;
+ for (int i = 0; i < hd; i++) oh[i] = 0.0f;
+ for (int t = 0; t <= pos; t++) {
+ const float *vh = st->v_cache + loff + (size_t)t * kv_dim + kvh * hd;
+ __m256 va = _mm256_set1_ps(att[t]);
+ for (int i = 0; i < hd; i += 8) {
+ _mm256_storeu_ps(oh+i, _mm256_fmadd_ps(va, _mm256_loadu_ps(vh+i), _mm256_loadu_ps(oh+i)));
+ }
+ }
+ }
+ }
+
+ matmul_batch_run(st, base_t + 4, st->bxb, st->bxb2, B, dim, dim);
+ for (int i = 0; i < B * dim; i += 8) {
+ _mm256_storeu_ps(st->bx + i, _mm256_add_ps(_mm256_loadu_ps(st->bx + i), _mm256_loadu_ps(st->bxb2 + i)));
+ }
+
+ const float *ffn_norm = (const float *)(st->model_base + st->tdescs[base_t + 5].offset);
+ for (int b = 0; b < B; b++) rmsnorm(st->bxb + (size_t)b * dim, st->bx + (size_t)b * dim, ffn_norm, dim, h->rms_eps);
+ matmul_batch_run(st, base_t + 6, st->bxb, st->bhb, B, ffn_dim, dim);
+ matmul_batch_run(st, base_t + 7, st->bxb, st->bhb2, B, ffn_dim, dim);
+ for (int i = 0; i < B * ffn_dim; i++) {
+ float g = st->bhb[i];
+ st->bhb[i] = (g / (1.0f + hv_expf(-g))) * st->bhb2[i];
+ }
+ matmul_batch_run(st, base_t + 8, st->bhb, st->bxb2, B, dim, ffn_dim);
+ for (int i = 0; i < B * dim; i += 8) {
+ _mm256_storeu_ps(st->bx + i, _mm256_add_ps(_mm256_loadu_ps(st->bx + i), _mm256_loadu_ps(st->bxb2 + i)));
+ }
+ }
+
+ // Only compute logits for the very last prompt token!
+ if (p0 + B == n_prompt) {
+ const float *out_norm = (const float *)(st->model_base + st->tdescs[1].offset);
+ rmsnorm(st->xb, st->bx + (size_t)(B - 1) * dim, out_norm, dim, h->rms_eps);
+ matmul_run(st, 2, st->xb, st->logits, (int)h->vocab_size, dim);
+ }
+ }
+
+ // 2. Greedy argmax decode (deterministic, zero <think>, stops on eos_id or im_end_id)
+ int out_pos = 0;
+ int gen_cnt = 0;
+ int cur_pos = n_prompt;
+ const uint32_t vocab = st->hdr->vocab_size;
+
+ for (int step = 0; step < max_new_tokens && cur_pos < R1M_MAX_SEQ; step++) {
+ uint32_t best_id = 0;
+ float best_val = st->logits[0];
+ for (uint32_t i = 1; i < vocab; i++) {
+ if (st->logits[i] > best_val) {
+ best_val = st->logits[i];
+ best_id = i;
+ }
+ }
+
+ if (best_id == st->hdr->eos_id || best_id == st->hdr->im_end_id) {
+ break;
+ }
+
+ char piece[64];
+ int plen = r1_llm_decode_piece(st, best_id, piece, sizeof(piece));
+ if (plen > 0 && out_pos + plen < max_out_bytes) {
+ hv_memcpy(out_text + out_pos, piece, (size_t)plen);
+ out_pos += plen;
+ out_text[out_pos] = '\0';
+ }
+ if (cb) cb(piece, plen, step, cb_ctx);
+ gen_cnt++;
+
+ transformer_forward(st, best_id, cur_pos++, true);
+ }
+
+ if (out_pos < max_out_bytes) out_text[out_pos] = '\0';
+ if (gen_toks_out) *gen_toks_out = gen_cnt;
+ return out_pos;
+}
diff --git a/04-ring1-kernel-surgeon/hv/llm_engine.h b/04-ring1-kernel-surgeon/hv/llm_engine.h
new file mode 100644
index 0000000..a011b54
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/llm_engine.h
@@ -0,0 +1,94 @@
+#pragma once
+#include "types.h"
+
+#define R1M_MAX_SEQ 512
+#define R1M_DTYPE_F32 0U
+#define R1M_DTYPE_Q4K 1U
+#define R1M_DTYPE_Q6K 2U
+
+typedef struct __attribute__((packed)) {
+ char magic[8]; // "R1SURG01"
+ uint32_t dim;
+ uint32_t n_layers;
+ uint32_t ffn_dim;
+ uint32_t n_heads;
+ uint32_t n_kv_heads;
+ uint32_t head_dim;
+ uint32_t vocab_size;
+ uint32_t n_tensors;
+ float rms_eps;
+ float rope_theta;
+ uint32_t bos_id;
+ uint32_t eos_id;
+ uint32_t im_start_id;
+ uint32_t im_end_id;
+ uint32_t think_start_id;
+ uint32_t think_end_id;
+ uint32_t nl_nl_id;
+ uint32_t merge_ht_cap;
+ uint64_t tdesc_off;
+ uint64_t b2t_off;
+ uint64_t voffs_off;
+ uint64_t vlens_off;
+ uint64_t vpool_off;
+ uint64_t vpool_size;
+ uint64_t merge_ht_off;
+ uint64_t total_used;
+} R1MHeader;
+
+typedef struct __attribute__((packed)) {
+ uint64_t offset;
+ uint32_t dtype;
+ uint32_t nbytes;
+} R1MTensorDesc;
+
+typedef struct __attribute__((packed)) {
+ uint32_t left_id;
+ uint32_t right_id;
+ uint32_t merged_id;
+ uint32_t rank;
+} R1MMergeSlot;
+
+typedef void (*R1ParallelFn)(int tid, int nthreads, void *ctx);
+typedef void (*R1ParallelDispatch)(R1ParallelFn fn, void *ctx);
+typedef void (*R1TokenCallback)(const char *piece, int piece_len, int step, void *user_ctx);
+
+typedef struct {
+ const uint8_t *model_base;
+ const R1MHeader *hdr;
+ const R1MTensorDesc *tdescs;
+ const uint32_t *byte_to_tok;
+ const uint32_t *vocab_offs;
+ const uint16_t *vocab_lens;
+ const uint8_t *vocab_pool;
+ const R1MMergeSlot *merge_ht;
+
+ // 64 MiB runtime arena (KV cache + scratch + logits + RoPE tables)
+ float *k_cache; // [n_layers * R1M_MAX_SEQ * kv_dim]
+ float *v_cache; // [n_layers * R1M_MAX_SEQ * kv_dim]
+ float *rope_cos; // [R1M_MAX_SEQ * (head_dim/2)]
+ float *rope_sin; // [R1M_MAX_SEQ * (head_dim/2)]
+ float *x; // [dim]
+ float *xb; // [dim]
+ float *xb2; // [dim]
+ float *q; // [dim]
+ float *k; // [kv_dim]
+ float *v; // [kv_dim]
+ float *hb; // [ffn_dim]
+ float *hb2; // [ffn_dim]
+ float *att; // [n_heads * R1M_MAX_SEQ]
+ float *logits; // [vocab_size]
+ float *bx, *bxb, *bxb2, *bq, *bk, *bv, *bhb, *bhb2;
+
+ R1ParallelDispatch dispatch;
+ bool ready;
+} R1LlmState;
+
+bool r1_llm_init(R1LlmState *st, const void *model_base, void *arena_64mb, R1ParallelDispatch dispatch);
+int r1_llm_tokenize_chat(const R1LlmState *st, const char *system_msg, const char *user_msg,
+ uint32_t *out_ids, int max_ids);
+int r1_llm_decode_piece(const R1LlmState *st, uint32_t tok_id, char *out, int max_len);
+int r1_llm_generate(R1LlmState *st, const char *system_msg, const char *user_msg,
+ char *out_text, int max_out_bytes, int max_new_tokens,
+ int *prompt_toks_out, int *gen_toks_out,
+ R1TokenCallback cb, void *cb_ctx);
diff --git a/04-ring1-kernel-surgeon/hv/main.c b/04-ring1-kernel-surgeon/hv/main.c
new file mode 100644
index 0000000..cad08eb
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/main.c
@@ -0,0 +1,311 @@
+#include "types.h"
+#include "fb.h"
+#include "svm.h"
+#include "smp.h"
+#include "linux_boot.h"
+
+static Vmcb g_guest_vmcb __attribute__((aligned(4096)));
+static Vmcb g_host_vmcb __attribute__((aligned(4096)));
+static uint8_t g_hsave[4096] __attribute__((aligned(4096)));
+static uint8_t g_msrpm[8192] __attribute__((aligned(4096)));
+
+static void msrpm_set_intercept(uint8_t *msrpm, uint32_t msr, bool intercept_rd, bool intercept_wr) {
+ uint32_t base_byte = 0, idx = 0;
+ if (msr <= 0x00001FFFU) { base_byte = 0x0000; idx = msr; }
+ else if (msr >= 0xC0000000U && msr <= 0xC0001FFFU) { base_byte = 0x0800; idx = msr - 0xC0000000U; }
+ else if (msr >= 0xC0010000U && msr <= 0xC0011FFFU) { base_byte = 0x1000; idx = msr - 0xC0010000U; }
+ else return;
+ uint32_t bit = idx * 2;
+ uint32_t byte_off = base_byte + (bit / 8);
+ uint32_t bit_off = bit % 8;
+ if (intercept_rd) msrpm[byte_off] |= (uint8_t)(1U << bit_off);
+ if (intercept_wr) msrpm[byte_off] |= (uint8_t)(1U << (bit_off + 1));
+}
+
+static bool svm_check_and_enable(void) {
+ uint32_t a, b, c, d;
+ cpuid_raw(0x80000001U, 0, &a, &b, &c, &d);
+ if (!(c & (1U << 2))) {
+ kprintf("[SVM] FATAL: SVM not present in CPUID!\n");
+ return false;
+ }
+ if (read_msr(MSR_VM_CR) & (1ULL << 4)) {
+ kprintf("[SVM] FATAL: MSR_VM_CR.SVMDIS=1\n");
+ return false;
+ }
+ cpuid_raw(0x8000000AU, 0, &a, &b, &c, &d);
+ kprintf("[SVM] AMD SVM Rev=%u NASID=%u Features=0x%x (NPT=%u NRIP=%u)\n",
+ a & 0xFF, b, d, (d & 1U), (d >> 3) & 1U);
+
+ write_msr(MSR_EFER, read_msr(MSR_EFER) | EFER_SVME);
+ hv_memset(g_hsave, 0, sizeof(g_hsave));
+ write_msr(MSR_VM_HSAVE_PA, (uint64_t)(uintptr_t)g_hsave);
+ kprintf("[SVM] EFER.SVME enabled | VM_HSAVE_PA=0x%lx\n", (uint64_t)(uintptr_t)g_hsave);
+ return true;
+}
+
+static void inject_exception(Vmcb *vmcb, uint32_t vector, bool has_err, uint32_t err) {
+ uint64_t inj = (uint64_t)(vector & 0xFFU) | (3ULL << 8) | (1ULL << 31);
+ if (has_err) {
+ inj |= (1ULL << 11);
+ inj |= ((uint64_t)err << 32);
+ }
+ vmcb->control.eventinj = inj;
+}
+
+static void advance_rip(Vmcb *vmcb, uint64_t fallback_len) {
+ if (vmcb->control.next_rip != 0) vmcb->save.rip = vmcb->control.next_rip;
+ else vmcb->save.rip += fallback_len;
+}
+
+static void setup_guest_vmcb(Vmcb *v, const LinuxGuestInit *init, uint64_t npt_cr3) {
+ hv_memset(v, 0, sizeof(*v));
+ hv_memset(&g_host_vmcb, 0, sizeof(g_host_vmcb));
+ hv_memset(g_msrpm, 0, sizeof(g_msrpm));
+
+ msrpm_set_intercept(g_msrpm, MSR_EFER, true, true);
+
+ v->control.intercept_exceptions = (1U << 0) | (1U << 6) | (1U << 8) | (1U << 14);
+ v->control.intercept_misc1 = INTERCEPT_CPUID | INTERCEPT_MSR_PROT | INTERCEPT_SHUTDOWN;
+ v->control.intercept_misc2 = INTERCEPT_VMRUN | INTERCEPT_VMMCALL;
+ v->control.msrpm_base_pa = (uint64_t)(uintptr_t)g_msrpm;
+ v->control.guest_asid = 1;
+ v->control.tlb_control = 3;
+ v->control.np_enable = 1;
+ v->control.n_cr3 = npt_cr3;
+
+ v->save.cs.selector = 0x08;
+ v->save.cs.attrib = 0x0A9B;
+ v->save.cs.limit = 0xFFFFFFFFU;
+ v->save.cs.base = 0;
+
+ VmcbSeg data_seg = { 0x10, 0x0C93, 0xFFFFFFFFU, 0 };
+ v->save.ds = data_seg;
+ v->save.es = data_seg;
+ v->save.ss = data_seg;
+ v->save.fs = data_seg;
+ v->save.gs = data_seg;
+
+ v->save.gdtr.limit = init->guest_gdtr_limit;
+ v->save.gdtr.base = init->guest_gdtr_base;
+ v->save.idtr.limit = 0;
+ v->save.idtr.base = 0;
+
+ v->save.ldtr.selector = 0;
+ v->save.ldtr.attrib = 0x0082;
+ v->save.tr.selector = 0x18;
+ v->save.tr.attrib = 0x008B;
+ v->save.tr.limit = 0x67;
+
+ v->save.cpl = 0;
+ v->save.efer = EFER_LME | EFER_LMA | EFER_NXE | EFER_SCE | EFER_SVME;
+ v->save.cr0 = 0x80050033ULL;
+ v->save.cr3 = init->guest_cr3;
+ v->save.cr4 = 0x00000020ULL;
+ v->save.dr6 = 0xFFFF0FF0ULL;
+ v->save.dr7 = 0x00000400ULL;
+ v->save.rflags = 0x0000000000000002ULL;
+ v->save.rip = init->entry_rip;
+ v->save.rsp = init->guest_rsp;
+ v->save.rax = 0;
+ v->save.g_pat = 0x0007040600070406ULL;
+}
+
+void hv_main(uint64_t magic, uint64_t mbi_addr) {
+ serial_init();
+ kprintf("\n====================================================================\n");
+ kprintf(" RING -1 KERNEL SURGEON (Stage 3: Bare-Metal AMD SVM + MiniCPM5-2B)\n");
+ kprintf("====================================================================\n");
+
+ BootAssets assets;
+ if (!mb2_parse(magic, mbi_addr, &assets)) {
+ kprintf("[HV] FATAL: Multiboot2 parse failed!\n");
+ return;
+ }
+
+ uint64_t fb_size = (uint64_t)assets.fb.pitch * assets.fb.height;
+ if (assets.fb.addr != 0) host_ensure_mapped(assets.fb.addr, fb_size);
+ fb_init(&assets.fb);
+ assets.fb = g_fb;
+
+ int n_cores = r1_smp_init(24);
+ bool llm_ok = surgeon_llm_init();
+ fb_draw_boot_banner(n_cores, llm_ok);
+
+ if (!svm_check_and_enable()) return;
+
+ uint64_t npt_cr3 = npt_init(g_fb.addr, fb_size);
+ kprintf("[NPT] 4-level NPT ready @ 0x%lx (Isolated: ELF 0x200000..0x3FFFFF, Arena 0x70000000..0x73FFFFFF, Model 0x100000000..0x17FFFFFFF)\n",
+ npt_cr3);
+
+ LinuxGuestInit guest_init;
+ if (!linux_prepare_guest(&assets, &guest_init)) {
+ kprintf("[HV] FATAL: linux_prepare_guest failed!\n");
+ return;
+ }
+
+ setup_guest_vmcb(&g_guest_vmcb, &guest_init, npt_cr3);
+
+ GuestRegs regs;
+ hv_memset(&regs, 0, sizeof(regs));
+ regs.rsi = guest_init.boot_params_pa;
+
+ kprintf("[SVM] Entering VMRUN -> Linux startup_64 @ RIP=0x%lx RSI=0x%lx CR3=0x%lx\n",
+ g_guest_vmcb.save.rip, regs.rsi, g_guest_vmcb.save.cr3);
+
+ uint64_t pf_reinjected = 0;
+ uint64_t cpuid_exits = 0;
+ uint64_t msr_exits = 0;
+
+ while (1) {
+ g_guest_vmcb.control.clean = 0;
+ svm_vmrun((uint64_t)(uintptr_t)&g_guest_vmcb,
+ (uint64_t)(uintptr_t)&g_host_vmcb,
+ &regs);
+ g_guest_vmcb.control.tlb_control = 0;
+
+ uint64_t code = g_guest_vmcb.control.exitcode;
+ uint64_t info1 = g_guest_vmcb.control.exitinfo1;
+ uint64_t info2 = g_guest_vmcb.control.exitinfo2;
+
+ if (code == VMEXIT_EXCP_PF) {
+ if (g_guest_vmcb.save.cpl != 0 || info2 >= 0x1000ULL) {
+ pf_reinjected++;
+ g_guest_vmcb.save.cr2 = info2;
+ inject_exception(&g_guest_vmcb, 14, true, (uint32_t)info1);
+ continue;
+ }
+ SurgeonResult r = surgeon_handle_fault(&g_guest_vmcb, &regs, 14, info1, info2);
+ if (r == SURGEON_RES_PASS_TO_LINUX) {
+ pf_reinjected++;
+ g_guest_vmcb.save.cr2 = info2;
+ inject_exception(&g_guest_vmcb, 14, true, (uint32_t)info1);
+ } else if (r == SURGEON_RES_HALT_FOR_DUMP) {
+ kprintf("[RING -1] HALT_FOR_DUMP EXECUTED — GUEST FROZEN SAFELY (NO CORRUPTION)!\n");
+ break;
+ }
+ continue;
+ }
+
+ if (code == VMEXIT_EXCP_DE) {
+ if (g_guest_vmcb.save.cpl != 0) {
+ inject_exception(&g_guest_vmcb, 0, false, 0);
+ continue;
+ }
+ SurgeonResult r = surgeon_handle_fault(&g_guest_vmcb, &regs, 0, 0, 0);
+ if (r == SURGEON_RES_PASS_TO_LINUX) {
+ inject_exception(&g_guest_vmcb, 0, false, 0);
+ } else if (r == SURGEON_RES_HALT_FOR_DUMP) {
+ kprintf("[RING -1] HALT_FOR_DUMP EXECUTED (#DE) — GUEST FROZEN SAFELY!\n");
+ break;
+ }
+ continue;
+ }
+
+ if (code == VMEXIT_EXCP_UD) {
+ if (g_guest_vmcb.save.cpl != 0) {
+ inject_exception(&g_guest_vmcb, 6, false, 0);
+ continue;
+ }
+ SurgeonResult r = surgeon_handle_fault(&g_guest_vmcb, &regs, 6, 0, 0);
+ if (r == SURGEON_RES_PASS_TO_LINUX) {
+ inject_exception(&g_guest_vmcb, 6, false, 0);
+ } else if (r == SURGEON_RES_HALT_FOR_DUMP) {
+ kprintf("[RING -1] HALT_FOR_DUMP EXECUTED (#UD) — GUEST FROZEN SAFELY!\n");
+ break;
+ }
+ continue;
+ }
+
+ if (code == VMEXIT_CPUID) {
+ cpuid_exits++;
+ uint32_t leaf = (uint32_t)g_guest_vmcb.save.rax;
+ uint32_t sub = (uint32_t)regs.rcx;
+ uint32_t a, b, c, d;
+ if (leaf == 0x40000000U) {
+ a = 0x40000000U;
+ b = 0x676E6952U;
+ c = 0x72755331U;
+ d = 0x6E6F6567U;
+ } else {
+ cpuid_raw(leaf, sub, &a, &b, &c, &d);
+ if (leaf == 0x80000001U) c &= ~(1U << 2);
+ }
+ g_guest_vmcb.save.rax = a;
+ regs.rbx = b;
+ regs.rcx = c;
+ regs.rdx = d;
+ advance_rip(&g_guest_vmcb, 2);
+ continue;
+ }
+
+ if (code == VMEXIT_MSR) {
+ msr_exits++;
+ uint32_t msr = (uint32_t)regs.rcx;
+ if (msr == MSR_EFER) {
+ if (info1 == 0) {
+ uint64_t v = g_guest_vmcb.save.efer & ~EFER_SVME;
+ g_guest_vmcb.save.rax = (uint32_t)v;
+ regs.rdx = (uint32_t)(v >> 32);
+ } else {
+ uint64_t v = ((uint64_t)(uint32_t)regs.rdx << 32) | (uint32_t)g_guest_vmcb.save.rax;
+ g_guest_vmcb.save.efer = v | EFER_SVME;
+ }
+ } else {
+ if (info1 == 0) {
+ uint64_t v = read_msr(msr);
+ g_guest_vmcb.save.rax = (uint32_t)v;
+ regs.rdx = (uint32_t)(v >> 32);
+ } else {
+ uint64_t v = ((uint64_t)(uint32_t)regs.rdx << 32) | (uint32_t)g_guest_vmcb.save.rax;
+ write_msr(msr, v);
+ }
+ }
+ advance_rip(&g_guest_vmcb, 2);
+ continue;
+ }
+
+ if (code == VMEXIT_VMMCALL) {
+ uint64_t cmd = g_guest_vmcb.save.rax;
+ if (cmd == 0x53555247ULL) {
+ g_guest_vmcb.save.rax = 0x4F4B5F52494E4731ULL;
+ regs.rbx = surgeon_get_heal_count();
+ regs.rcx = (uint64_t)r1_smp_num_cpus();
+ regs.rdx = surgeon_llm_is_ready() ? 1ULL : 0ULL;
+ kprintf("[VMMCALL] Status: heals=%u l1_cores=%d llm_ready=%d pf_pass=%lu\n",
+ surgeon_get_heal_count(), r1_smp_num_cpus(), surgeon_llm_is_ready() ? 1 : 0, pf_reinjected);
+ } else if (cmd == 0x53555248ULL) {
+ surgeon_redraw_hud();
+ g_guest_vmcb.save.rax = 0;
+ } else if (cmd == 0x53555249ULL) {
+ R1ContextHint h;
+ if (guest_read_gva(g_guest_vmcb.save.cr3, regs.rbx, &h, sizeof(h))) {
+ surgeon_set_hint(&h);
+ g_guest_vmcb.save.rax = 0;
+ } else {
+ g_guest_vmcb.save.rax = 1;
+ }
+ }
+ advance_rip(&g_guest_vmcb, 3);
+ continue;
+ }
+
+ if (code == VMEXIT_NPF) {
+ kprintf("[NPT] #NPF ISOLATION VIOLATION! GPA=0x%016lx err=0x%lx RIP=0x%016lx CPL=%u\n",
+ info2, info1, g_guest_vmcb.save.rip, (uint32_t)g_guest_vmcb.save.cpl);
+ break;
+ }
+
+ if (code == VMEXIT_EXCP_DF || code == VMEXIT_SHUTDOWN || code == VMEXIT_INVALID) {
+ kprintf("[SVM] FATAL VMEXIT code=0x%lx info1=0x%lx info2=0x%lx RIP=0x%016lx\n",
+ code, info1, info2, g_guest_vmcb.save.rip);
+ break;
+ }
+
+ kprintf("[SVM] Unhandled VMEXIT code=0x%lx RIP=0x%016lx\n", code, g_guest_vmcb.save.rip);
+ break;
+ }
+
+ kprintf("[HV] Hypervisor halted cleanly (heals=%u l1_cores=%d llm_ready=%d pf_pass=%lu).\n",
+ surgeon_get_heal_count(), r1_smp_num_cpus(), surgeon_llm_is_ready() ? 1 : 0, pf_reinjected);
+}
diff --git a/04-ring1-kernel-surgeon/hv/npt.c b/04-ring1-kernel-surgeon/hv/npt.c
new file mode 100644
index 0000000..1aadd87
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/npt.c
@@ -0,0 +1,127 @@
+#include "svm.h"
+
+#define HV_ARENA_START 0x00200000ULL
+#define HV_ARENA_END 0x00400000ULL
+#define LLM_ARENA_START 0x70000000ULL
+#define LLM_ARENA_END 0x74000000ULL
+
+#define PT_P (1ULL << 0)
+#define PT_W (1ULL << 1)
+#define PT_U (1ULL << 2)
+#define PT_PS (1ULL << 7)
+
+extern uint64_t host_pml4[512];
+extern uint64_t host_pdpt[512];
+extern uint64_t host_pd[8][512];
+extern uint64_t host_pd_high[512];
+
+static uint64_t npt_pml4[512] __attribute__((aligned(4096)));
+static uint64_t npt_pdpt[512] __attribute__((aligned(4096)));
+static uint64_t npt_pd[4][512] __attribute__((aligned(4096)));
+static uint64_t npt_pd_high[512] __attribute__((aligned(4096)));
+
+void host_ensure_mapped(uint64_t phys_addr, uint64_t size) {
+ if (phys_addr + size <= 0x200000000ULL) return; // boot.asm maps 0..8 GiB!
+ uint64_t gb_idx = (phys_addr >> 30) & 0x1FFULL;
+ uint64_t base_1g = phys_addr & ~0x3FFFFFFFULL;
+ for (uint64_t i = 0; i < 512; i++) {
+ host_pd_high[i] = (base_1g + (i << 21)) | PT_P | PT_W | PT_PS;
+ }
+ host_pdpt[gb_idx] = (uint64_t)(uintptr_t)host_pd_high | PT_P | PT_W;
+ flush_host_tlb();
+}
+
+uint64_t npt_init(uint64_t fb_addr, uint64_t fb_size) {
+ hv_memset(npt_pml4, 0, sizeof(npt_pml4));
+ hv_memset(npt_pdpt, 0, sizeof(npt_pdpt));
+ hv_memset(npt_pd, 0, sizeof(npt_pd));
+ hv_memset(npt_pd_high, 0, sizeof(npt_pd_high));
+
+ npt_pml4[0] = (uint64_t)(uintptr_t)npt_pdpt | PT_P | PT_W | PT_U;
+
+ // Map ONLY 0..4 GiB to guest (4..6 GiB NVDIMM model weights stay UNMAPPED in NPT!)
+ for (uint64_t g = 0; g < 4; g++) {
+ npt_pdpt[g] = (uint64_t)(uintptr_t)npt_pd[g] | PT_P | PT_W | PT_U;
+ for (uint64_t i = 0; i < 512; i++) {
+ uint64_t pa = (g << 30) | (i << 21);
+ if ((pa >= HV_ARENA_START && pa < HV_ARENA_END) ||
+ (pa >= LLM_ARENA_START && pa < LLM_ARENA_END)) {
+ npt_pd[g][i] = 0; // Isolated Ring -1 memory: UNMAPPED from Linux!
+ } else {
+ npt_pd[g][i] = pa | PT_P | PT_W | PT_U | PT_PS;
+ }
+ }
+ }
+
+ if (fb_addr != 0 && (fb_addr + fb_size) > 0x100000000ULL) {
+ host_ensure_mapped(fb_addr, fb_size);
+ uint64_t gb_idx = (fb_addr >> 30) & 0x1FFULL;
+ uint64_t base_1g = fb_addr & ~0x3FFFFFFFULL;
+ for (uint64_t i = 0; i < 512; i++) {
+ npt_pd_high[i] = (base_1g + (i << 21)) | PT_P | PT_W | PT_U | PT_PS;
+ }
+ npt_pdpt[gb_idx] = (uint64_t)(uintptr_t)npt_pd_high | PT_P | PT_W | PT_U;
+ }
+
+ return (uint64_t)(uintptr_t)npt_pml4;
+}
+
+bool guest_gva_to_gpa(uint64_t guest_cr3, uint64_t gva, uint64_t *gpa_out) {
+ uint64_t pml4_pa = guest_cr3 & 0x000FFFFFFFFFF000ULL;
+ uint64_t i4 = (gva >> 39) & 0x1FFULL;
+ uint64_t i3 = (gva >> 30) & 0x1FFULL;
+ uint64_t i2 = (gva >> 21) & 0x1FFULL;
+ uint64_t i1 = (gva >> 12) & 0x1FFULL;
+
+ if (pml4_pa >= 0x100000000ULL) return false;
+ uint64_t pml4e = ((const uint64_t *)(uintptr_t)pml4_pa)[i4];
+ if (!(pml4e & PT_P)) return false;
+
+ uint64_t pdpt_pa = pml4e & 0x000FFFFFFFFFF000ULL;
+ if (pdpt_pa >= 0x100000000ULL) return false;
+ uint64_t pdpte = ((const uint64_t *)(uintptr_t)pdpt_pa)[i3];
+ if (!(pdpte & PT_P)) return false;
+ if (pdpte & PT_PS) {
+ *gpa_out = (pdpte & 0x000FFFFFC0000000ULL) | (gva & 0x3FFFFFFFULL);
+ return true;
+ }
+
+ uint64_t pd_pa = pdpte & 0x000FFFFFFFFFF000ULL;
+ if (pd_pa >= 0x100000000ULL) return false;
+ uint64_t pde = ((const uint64_t *)(uintptr_t)pd_pa)[i2];
+ if (!(pde & PT_P)) return false;
+ if (pde & PT_PS) {
+ *gpa_out = (pde & 0x000FFFFFFFE00000ULL) | (gva & 0x1FFFFFULL);
+ return true;
+ }
+
+ uint64_t pt_pa = pde & 0x000FFFFFFFFFF000ULL;
+ if (pt_pa >= 0x100000000ULL) return false;
+ uint64_t pte = ((const uint64_t *)(uintptr_t)pt_pa)[i1];
+ if (!(pte & PT_P)) return false;
+
+ *gpa_out = (pte & 0x000FFFFFFFFFF000ULL) | (gva & 0xFFFULL);
+ return true;
+}
+
+bool guest_read_gva(uint64_t guest_cr3, uint64_t gva, void *dst, size_t len) {
+ uint8_t *out = (uint8_t *)dst;
+ for (size_t i = 0; i < len; i++) {
+ uint64_t gpa = 0;
+ if (!guest_gva_to_gpa(guest_cr3, gva + i, &gpa)) return false;
+ if (gpa >= 0x100000000ULL) return false;
+ out[i] = *(const volatile uint8_t *)(uintptr_t)gpa;
+ }
+ return true;
+}
+
+bool guest_write_gva(uint64_t guest_cr3, uint64_t gva, const void *src, size_t len) {
+ const uint8_t *in = (const uint8_t *)src;
+ for (size_t i = 0; i < len; i++) {
+ uint64_t gpa = 0;
+ if (!guest_gva_to_gpa(guest_cr3, gva + i, &gpa)) return false;
+ if (gpa >= 0x100000000ULL) return false;
+ *(volatile uint8_t *)(uintptr_t)gpa = in[i];
+ }
+ return true;
+}
diff --git a/04-ring1-kernel-surgeon/hv/serial.c b/04-ring1-kernel-surgeon/hv/serial.c
new file mode 100644
index 0000000..f9cc8f9
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/serial.c
@@ -0,0 +1,189 @@
+#include "types.h"
+#include <stdarg.h>
+
+#define COM1 0x3F8
+
+void *hv_memset(void *dst, int c, size_t n) {
+ uint8_t *p = (uint8_t *)dst;
+ while (n--) *p++ = (uint8_t)c;
+ return dst;
+}
+
+void *hv_memcpy(void *dst, const void *src, size_t n) {
+ uint8_t *d = (uint8_t *)dst;
+ const uint8_t *s = (const uint8_t *)src;
+ while (n--) *d++ = *s++;
+ return dst;
+}
+
+void *hv_memmove(void *dst, const void *src, size_t n) {
+ uint8_t *d = (uint8_t *)dst;
+ const uint8_t *s = (const uint8_t *)src;
+ if (d < s) {
+ while (n--) *d++ = *s++;
+ } else if (d > s) {
+ d += n;
+ s += n;
+ while (n--) *--d = *--s;
+ }
+ return dst;
+}
+
+size_t hv_strlen(const char *s) {
+ size_t n = 0;
+ while (s[n]) n++;
+ return n;
+}
+
+int hv_strcmp(const char *a, const char *b) {
+ while (*a && *a == *b) { a++; b++; }
+ return (int)(uint8_t)*a - (int)(uint8_t)*b;
+}
+
+int hv_strncmp(const char *a, const char *b, size_t n) {
+ for (size_t i = 0; i < n; i++) {
+ if (a[i] != b[i] || a[i] == 0)
+ return (int)(uint8_t)a[i] - (int)(uint8_t)b[i];
+ }
+ return 0;
+}
+
+void serial_init(void) {
+ outb(COM1 + 1, 0x00); // Disable interrupts
+ outb(COM1 + 3, 0x80); // Enable DLAB
+ outb(COM1 + 0, 0x01); // 115200 baud lo
+ outb(COM1 + 1, 0x00); // 115200 baud hi
+ outb(COM1 + 3, 0x03); // 8N1
+ outb(COM1 + 2, 0xC7); // FIFO
+ outb(COM1 + 4, 0x0B); // IRQs enabled, RTS/DSR set
+}
+
+void serial_putc(char c) {
+ if (c == '\n') {
+ while ((inb(COM1 + 5) & 0x20) == 0) {}
+ outb(COM1, '\r');
+ }
+ while ((inb(COM1 + 5) & 0x20) == 0) {}
+ outb(COM1, (uint8_t)c);
+}
+
+void serial_puts(const char *s) {
+ while (*s) serial_putc(*s++);
+}
+
+typedef struct {
+ char *buf;
+ size_t cap;
+ size_t pos;
+ bool to_serial;
+} FmtOut;
+
+static void fmt_emit(FmtOut *o, char c) {
+ if (o->to_serial) {
+ serial_putc(c);
+ } else if (o->buf && o->pos + 1 < o->cap) {
+ o->buf[o->pos] = c;
+ }
+ o->pos++;
+}
+
+static void fmt_uint(FmtOut *o, uint64_t val, int base, int width, char pad, bool upper) {
+ char tmp[32];
+ const char *digs = upper ? "0123456789ABCDEF" : "0123456789abcdef";
+ int n = 0;
+ if (val == 0) {
+ tmp[n++] = '0';
+ } else {
+ while (val) {
+ tmp[n++] = digs[val % (uint64_t)base];
+ val /= (uint64_t)base;
+ }
+ }
+ while (n < width) {
+ fmt_emit(o, pad);
+ width--;
+ }
+ while (n > 0) fmt_emit(o, tmp[--n]);
+}
+
+static int hv_vformat(FmtOut *o, const char *fmt, va_list ap) {
+ for (; *fmt; fmt++) {
+ if (*fmt != '%') {
+ fmt_emit(o, *fmt);
+ continue;
+ }
+ fmt++;
+ char pad = ' ';
+ if (*fmt == '0') { pad = '0'; fmt++; }
+ int width = 0;
+ while (*fmt >= '0' && *fmt <= '9') {
+ width = width * 10 + (*fmt - '0');
+ fmt++;
+ }
+ bool is_long = false;
+ while (*fmt == 'l') { is_long = true; fmt++; }
+ switch (*fmt) {
+ case 's': {
+ const char *s = va_arg(ap, const char *);
+ if (!s) s = "(null)";
+ while (*s) fmt_emit(o, *s++);
+ break;
+ }
+ case 'c':
+ fmt_emit(o, (char)va_arg(ap, int));
+ break;
+ case 'd': {
+ int64_t v = is_long ? va_arg(ap, int64_t) : (int64_t)va_arg(ap, int32_t);
+ if (v < 0) { fmt_emit(o, '-'); v = -v; }
+ fmt_uint(o, (uint64_t)v, 10, width, pad, false);
+ break;
+ }
+ case 'u': {
+ uint64_t v = is_long ? va_arg(ap, uint64_t) : (uint64_t)va_arg(ap, uint32_t);
+ fmt_uint(o, v, 10, width, pad, false);
+ break;
+ }
+ case 'x':
+ case 'X': {
+ uint64_t v = is_long ? va_arg(ap, uint64_t) : (uint64_t)va_arg(ap, uint32_t);
+ fmt_uint(o, v, 16, width, pad, *fmt == 'X');
+ break;
+ }
+ case 'p': {
+ uint64_t v = (uint64_t)(uintptr_t)va_arg(ap, void *);
+ fmt_emit(o, '0'); fmt_emit(o, 'x');
+ fmt_uint(o, v, 16, 16, '0', false);
+ break;
+ }
+ case '%':
+ fmt_emit(o, '%');
+ break;
+ default:
+ fmt_emit(o, '%');
+ fmt_emit(o, *fmt);
+ break;
+ }
+ }
+ if (!o->to_serial && o->buf && o->cap > 0) {
+ size_t end = o->pos < o->cap ? o->pos : (o->cap - 1);
+ o->buf[end] = '\0';
+ }
+ return (int)o->pos;
+}
+
+void kprintf(const char *fmt, ...) {
+ va_list ap;
+ va_start(ap, fmt);
+ FmtOut o = { NULL, 0, 0, true };
+ hv_vformat(&o, fmt, ap);
+ va_end(ap);
+}
+
+int hv_snprintf(char *buf, size_t cap, const char *fmt, ...) {
+ va_list ap;
+ va_start(ap, fmt);
+ FmtOut o = { buf, cap, 0, false };
+ int r = hv_vformat(&o, fmt, ap);
+ va_end(ap);
+ return r;
+}
diff --git a/04-ring1-kernel-surgeon/hv/smp.c b/04-ring1-kernel-surgeon/hv/smp.c
new file mode 100644
index 0000000..23c81b0
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/smp.c
@@ -0,0 +1,154 @@
+#include "smp.h"
+
+#define LAPIC_BASE 0xFEE00000ULL
+#define LAPIC_ICR_LO 0x300U
+#define LAPIC_ICR_HI 0x310U
+
+#define AP_TRAMP_PA 0x00008000ULL
+#define AP_CTRL_PA 0x00008F00ULL
+// AP stacks live inside the Ring -1 isolated 64 MiB arena (0x70000000..0x73FFFFFF):
+// Top 2 MiB (0x73E00000..0x73FFFFFF) = 32 x 64 KiB AP stacks!
+#define AP_STACK_BASE 0x73E00000ULL
+#define AP_STACK_SIZE 0x00010000ULL
+
+extern uint64_t host_pml4[512];
+extern uint8_t gdt64_ptr[10];
+extern uint8_t ap_trampoline_start[];
+extern uint8_t ap_trampoline_end[];
+
+static volatile uint64_t g_ap_online_mask = 1ULL;
+static volatile uint64_t g_job_gen = 0;
+static volatile uint32_t g_job_done = 0;
+static R1ParallelFn g_job_fn = NULL;
+static void *g_job_ctx = NULL;
+static int g_num_cpus = 1;
+
+static inline void lapic_write(uint32_t reg, uint32_t val) {
+ *(volatile uint32_t *)(uintptr_t)(LAPIC_BASE + reg) = val;
+}
+static inline uint32_t lapic_read(uint32_t reg) {
+ return *(const volatile uint32_t *)(uintptr_t)(LAPIC_BASE + reg);
+}
+
+static void busy_delay_tsc(uint64_t ticks) {
+ uint64_t t0 = read_tsc();
+ while ((read_tsc() - t0) < ticks) cpu_pause();
+}
+
+void ap_c_entry(uint64_t tid) {
+ enable_avx2_cpu();
+ __sync_or_and_fetch(&g_ap_online_mask, (1ULL << tid));
+
+ uint64_t my_gen = 0;
+ while (1) {
+ uint64_t cur = __atomic_load_n(&g_job_gen, __ATOMIC_ACQUIRE);
+ if (cur == my_gen) {
+ cpu_pause();
+ continue;
+ }
+ my_gen = cur;
+ g_job_fn((int)tid, g_num_cpus, g_job_ctx);
+ __atomic_add_fetch(&g_job_done, 1, __ATOMIC_RELEASE);
+ }
+}
+
+int r1_smp_init(int max_cpus) {
+ if (max_cpus > R1_MAX_CPUS) max_cpus = R1_MAX_CPUS;
+ if (max_cpus < 1) max_cpus = 1;
+
+ // Detect logical CPU count via CPUID 0x01 EBX[23:16] / 0x80000008 ECX[7:0]+1
+ uint32_t a, b, c, d;
+ cpuid_raw(0x01U, 0, &a, &b, &c, &d);
+ int n_det = (int)((b >> 16) & 0xFFU);
+ if (n_det < 1) n_det = 1;
+ if (n_det > max_cpus) n_det = max_cpus;
+
+ if (n_det <= 1) {
+ g_num_cpus = 1;
+ return 1;
+ }
+
+ // Copy 16-bit AP trampoline to 0x8000
+ size_t tlen = (size_t)(ap_trampoline_end - ap_trampoline_start);
+ hv_memcpy((void *)(uintptr_t)AP_TRAMP_PA, ap_trampoline_start, tlen);
+
+ // Fill shared control block fields at 0x8F00
+ volatile uint64_t *ctrl = (volatile uint64_t *)(uintptr_t)AP_CTRL_PA;
+ ctrl[0] = (uint64_t)(uintptr_t)host_pml4;
+ ctrl[1] = (uint64_t)(uintptr_t)&ap_c_entry;
+ hv_memcpy((void *)(uintptr_t)(AP_CTRL_PA + 0x20), gdt64_ptr, 10);
+
+ int online = 1;
+ for (int ap = 1; ap < n_det; ap++) {
+ ctrl[2] = AP_STACK_BASE + (uint64_t)(ap + 1) * AP_STACK_SIZE - 16ULL;
+ ctrl[3] = (uint64_t)ap;
+ __sync_synchronize();
+
+ // INIT IPI
+ lapic_write(LAPIC_ICR_HI, (uint32_t)ap << 24);
+ lapic_write(LAPIC_ICR_LO, 0x00004500U); // INIT, level assert
+ while (lapic_read(LAPIC_ICR_LO) & (1U << 12)) cpu_pause();
+ busy_delay_tsc(5000000ULL); // ~2ms
+
+ // SIPI vector 0x08 -> 0x00008000
+ lapic_write(LAPIC_ICR_HI, (uint32_t)ap << 24);
+ lapic_write(LAPIC_ICR_LO, 0x00004608U); // STARTUP, vector 0x08
+ while (lapic_read(LAPIC_ICR_LO) & (1U << 12)) cpu_pause();
+
+ // Wait up to ~50ms for AP to check in
+ uint64_t t0 = read_tsc();
+ bool booted = false;
+ while ((read_tsc() - t0) < 120000000ULL) {
+ if (__atomic_load_n(&g_ap_online_mask, __ATOMIC_ACQUIRE) & (1ULL << ap)) {
+ booted = true;
+ break;
+ }
+ cpu_pause();
+ }
+ if (booted) {
+ online++;
+ } else {
+ // Second SIPI retry
+ lapic_write(LAPIC_ICR_HI, (uint32_t)ap << 24);
+ lapic_write(LAPIC_ICR_LO, 0x00004608U);
+ uint64_t t1 = read_tsc();
+ while ((read_tsc() - t1) < 120000000ULL) {
+ if (__atomic_load_n(&g_ap_online_mask, __ATOMIC_ACQUIRE) & (1ULL << ap)) {
+ booted = true;
+ break;
+ }
+ cpu_pause();
+ }
+ if (booted) online++;
+ else break;
+ }
+ }
+
+ // Wipe trampoline low memory before Linux boots
+ hv_memset((void *)(uintptr_t)AP_TRAMP_PA, 0, 4096);
+ g_num_cpus = online;
+ kprintf("[SMP] Bare-metal Ring -1 worker pool online: %d / %d AVX2 cores (APs hidden from Linux nr_cpus=1)\n",
+ online, n_det);
+ return online;
+}
+
+int r1_smp_num_cpus(void) {
+ return g_num_cpus;
+}
+
+void r1_smp_dispatch(R1ParallelFn fn, void *ctx) {
+ if (g_num_cpus <= 1) {
+ fn(0, 1, ctx);
+ return;
+ }
+ g_job_fn = fn;
+ g_job_ctx = ctx;
+ __atomic_store_n(&g_job_done, 0, __ATOMIC_RELEASE);
+ __atomic_add_fetch(&g_job_gen, 1, __ATOMIC_RELEASE);
+
+ fn(0, g_num_cpus, ctx);
+
+ while (__atomic_load_n(&g_job_done, __ATOMIC_ACQUIRE) < (uint32_t)(g_num_cpus - 1)) {
+ cpu_pause();
+ }
+}
diff --git a/04-ring1-kernel-surgeon/hv/smp.h b/04-ring1-kernel-surgeon/hv/smp.h
new file mode 100644
index 0000000..aec5335
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/smp.h
@@ -0,0 +1,15 @@
+#pragma once
+#include "types.h"
+#include "llm_engine.h"
+
+#define R1_MAX_CPUS 32
+
+int r1_smp_init(int max_cpus);
+int r1_smp_num_cpus(void);
+void r1_smp_dispatch(R1ParallelFn fn, void *ctx);
+
+extern void enable_avx2_cpu(void);
+extern void xsave_state(void *buf_64aligned);
+extern void xrstor_state(const void *buf_64aligned);
+extern uint64_t get_xcr0(void);
+extern void set_xcr0(uint64_t v);
diff --git a/04-ring1-kernel-surgeon/hv/surgeon.c b/04-ring1-kernel-surgeon/hv/surgeon.c
new file mode 100644
index 0000000..6db72b6
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/surgeon.c
@@ -0,0 +1,393 @@
+#include "svm.h"
+#include "fb.h"
+#include "smp.h"
+#include "llm_engine.h"
+
+#define NVDIMM_MODEL_PA 0x100000000ULL // 2 GiB Read-Only NVDIMM (UNMAPPED in NPT!)
+#define LLM_ARENA_PA 0x70000000ULL // 64 MiB Isolated L1 Arena (UNMAPPED in NPT!)
+#define XSAVE_BUF_PA 0x73DF0000ULL // 64-byte aligned 4KB buffer inside L1 Arena
+
+static R1LlmState g_llm;
+static uint32_t g_event_count = 0;
+static uint32_t g_heal_count = 0;
+static bool g_hint_active = false;
+static R1ContextHint g_hint;
+
+typedef struct {
+ bool valid;
+ uint32_t event_num;
+ char fault_name[32];
+ uint32_t cpl;
+ uint64_t cr2;
+ uint64_t rip_gva;
+ uint64_t rip_gpa;
+ uint8_t orig_bytes[16];
+ uint8_t insn_len;
+ uint8_t patch_bytes[16];
+ uint8_t patch_len;
+ char action[24];
+ char diagnosis[160];
+ uint32_t elapsed_ms;
+ uint32_t gen_toks;
+} LastVerdict;
+
+static LastVerdict g_last;
+
+bool surgeon_llm_init(void) {
+ enable_avx2_cpu();
+ bool ok = r1_llm_init(&g_llm,
+ (const void *)(uintptr_t)NVDIMM_MODEL_PA,
+ (void *)(uintptr_t)LLM_ARENA_PA,
+ r1_smp_dispatch);
+ if (ok) {
+ kprintf("[LLM] MiniCPM5-2B Q4_K_M READY in isolated L1 RAM @ 0x%lx (dim=%u layers=%u vocab=%u cores=%d)\n",
+ NVDIMM_MODEL_PA, g_llm.hdr->dim, g_llm.hdr->n_layers, g_llm.hdr->vocab_size, r1_smp_num_cpus());
+ } else {
+ kprintf("[LLM] WARNING: No R1SURG01 model found at 0x%lx\n", NVDIMM_MODEL_PA);
+ }
+ return ok;
+}
+
+bool surgeon_llm_is_ready(void) {
+ return g_llm.ready;
+}
+
+void surgeon_set_hint(const R1ContextHint *hint) {
+ if (hint && hint->magic == 0x52314854U) {
+ g_hint = *hint;
+ g_hint_active = true;
+ } else {
+ g_hint_active = false;
+ }
+}
+
+uint32_t surgeon_get_heal_count(void) {
+ return g_heal_count;
+}
+
+void surgeon_redraw_hud(void) {
+ if (!g_last.valid) return;
+ fb_draw_ai_verdict_hud(
+ g_last.event_num, g_last.fault_name, g_last.cpl, g_last.cr2,
+ g_last.rip_gva, g_last.rip_gpa, g_last.orig_bytes, g_last.insn_len,
+ g_last.patch_bytes, g_last.patch_len, g_last.action, g_last.diagnosis,
+ r1_smp_num_cpus(), g_last.elapsed_ms, g_last.gen_toks
+ );
+}
+
+static void mini_disasm(const uint8_t *b, int len, char *out, size_t cap) {
+ if (len >= 2 && b[0] == 0x0F && b[1] == 0x0B) {
+ hv_snprintf(out, cap, "ud2");
+ } else if (len >= 3 && b[0] == 0x0F && b[1] == 0xB9) {
+ hv_snprintf(out, cap, "ud1 eax, eax");
+ } else if (len >= 3 && b[0] == 0x0F && b[1] == 0xFF) {
+ hv_snprintf(out, cap, "ud0 eax, eax");
+ } else if (len >= 2 && b[0] == 0xF7 && b[1] == 0xF1) {
+ hv_snprintf(out, cap, "div ecx");
+ } else if (len >= 2 && b[0] == 0xF7 && b[1] == 0xF3) {
+ hv_snprintf(out, cap, "div ebx");
+ } else if (len >= 2 && b[0] == 0xF7 && b[1] == 0xFE) {
+ hv_snprintf(out, cap, "idiv esi");
+ } else if (len >= 3 && b[0] == 0x48 && b[1] == 0xF7 && b[2] == 0xF1) {
+ hv_snprintf(out, cap, "div rcx");
+ } else if (len >= 11 && b[0] == 0xC7 && b[1] == 0x04 && b[2] == 0x25) {
+ uint32_t imm = *(const uint32_t *)(b + 7);
+ hv_snprintf(out, cap, "mov dword ptr [0x0], 0x%x", imm);
+ } else if (len >= 2 && b[0] == 0x89 && b[1] == 0x10) {
+ hv_snprintf(out, cap, "mov dword ptr [rax], edx");
+ } else if (len >= 3 && b[0] == 0xC6 && b[1] == 0x00) {
+ hv_snprintf(out, cap, "mov byte ptr [rax], 0x%x", b[2]);
+ } else if (len >= 3 && b[0] == 0x48 && b[1] == 0x89 && b[2] == 0x10) {
+ hv_snprintf(out, cap, "mov qword ptr [rax], rdx");
+ } else if (len >= 3 && b[0] == 0x8B && b[1] == 0x43) {
+ hv_snprintf(out, cap, "mov eax, dword ptr [rbx + 0x%x]", b[2]);
+ } else if (len >= 3 && b[0] == 0x48 && b[1] == 0x8B) {
+ hv_snprintf(out, cap, "mov rax, qword ptr [reg]");
+ } else {
+ hv_snprintf(out, cap, "op_%02x_%02x", b[0], len > 1 ? b[1] : 0);
+ }
+}
+
+static int hex_val(char c) {
+ if (c >= '0' && c <= '9') return c - '0';
+ if (c >= 'a' && c <= 'f') return 10 + (c - 'a');
+ if (c >= 'A' && c <= 'F') return 10 + (c - 'A');
+ return -1;
+}
+
+static const char *find_substr(const char *hay, const char *needle) {
+ size_t nlen = hv_strlen(needle);
+ if (nlen == 0) return hay;
+ for (size_t i = 0; hay[i]; i++) {
+ if (hv_strncmp(hay + i, needle, nlen) == 0) return hay + i;
+ }
+ return NULL;
+}
+
+static void copy_line_after(const char *p, char *dst, size_t cap) {
+ while (*p == ' ' || *p == '\t') p++;
+ size_t i = 0;
+ while (*p && *p != '\n' && *p != '\r' && i + 1 < cap) {
+ dst[i++] = *p++;
+ }
+ dst[i] = '\0';
+}
+
+static bool validate_patch_bytes(const uint8_t *patch, int plen, int expected_len) {
+ if (plen != expected_len || plen <= 0 || plen > 15) return false;
+ int pos = 0;
+ while (pos < plen) {
+ uint8_t op = patch[pos];
+ if (op == 0xEB || op == 0xE8 || op == 0xE9 || op == 0xEA ||
+ op == 0xC3 || op == 0xC2 || op == 0xCB || op == 0xCA ||
+ op == 0xCF || op == 0xCC || op == 0xCD || op == 0xCE ||
+ op == 0xF4 || op == 0xFA || op == 0xFB || op == 0xFF ||
+ (op >= 0x70 && op <= 0x7F) || (op >= 0xE0 && op <= 0xE7)) {
+ return false;
+ }
+ if (op == 0x0F && pos + 1 < plen) {
+ uint8_t op2 = patch[pos + 1];
+ if (op2 == 0x0B || op2 == 0x05 || op2 == 0x07 || op2 == 0x30 ||
+ op2 == 0x32 || op2 == 0x01 || op2 == 0xB9 || op2 == 0xFF ||
+ (op2 >= 0x80 && op2 <= 0x8F)) {
+ return false;
+ }
+ }
+ int step = x86_decode_len(patch + pos, plen - pos);
+ if (step <= 0 || pos + step > plen) return false;
+ pos += step;
+ }
+ return (pos == plen);
+}
+
+typedef struct {
+ uint32_t event_num;
+ const char *fault_name;
+ uint64_t rip_gva;
+ const uint8_t *orig_bytes;
+ uint8_t insn_len;
+ char stream_buf[256];
+ int stream_pos;
+} StreamHudCtx;
+
+static void token_stream_cb(const char *piece, int piece_len, int step, void *user_ctx) {
+ StreamHudCtx *sc = (StreamHudCtx *)user_ctx;
+ for (int i = 0; i < piece_len && sc->stream_pos + 1 < (int)sizeof(sc->stream_buf); i++) {
+ sc->stream_buf[sc->stream_pos++] = piece[i];
+ }
+ sc->stream_buf[sc->stream_pos] = '\0';
+ if ((step & 3) == 0) {
+ fb_draw_thinking_hud(sc->event_num, sc->fault_name, sc->rip_gva,
+ sc->orig_bytes, sc->insn_len, r1_smp_num_cpus(), sc->stream_buf);
+ }
+}
+
+SurgeonResult surgeon_handle_fault(Vmcb *vmcb, GuestRegs *regs, uint32_t vector, uint64_t err, uint64_t cr2) {
+ uint64_t rip_gva = vmcb->save.rip;
+ uint64_t rip_gpa = 0;
+
+ if (!guest_gva_to_gpa(vmcb->save.cr3, rip_gva, &rip_gpa)) {
+ kprintf("[SURGEON] Cannot translate RIP GVA 0x%016lx\n", rip_gva);
+ return SURGEON_RES_PASS_TO_LINUX;
+ }
+
+ uint8_t orig_bytes[16];
+ hv_memset(orig_bytes, 0, sizeof(orig_bytes));
+ if (!guest_read_gva(vmcb->save.cr3, rip_gva, orig_bytes, 15)) {
+ if (!guest_read_gva(vmcb->save.cr3, rip_gva, orig_bytes, 2)) {
+ return SURGEON_RES_PASS_TO_LINUX;
+ }
+ }
+
+ // Pass through Linux early-boot futex_detect_cmpxchg() probe silently unless hint active
+ if (!g_hint_active && vector == 14 && cr2 == 0 &&
+ (orig_bytes[0] == 0x3E || orig_bytes[0] == 0xF0) &&
+ orig_bytes[1] == 0x0F && orig_bytes[2] == 0xB1) {
+ return SURGEON_RES_PASS_TO_LINUX;
+ }
+
+ int ilen = x86_decode_len(orig_bytes, 15);
+ if (ilen <= 0 || ilen > 15) {
+ return SURGEON_RES_PASS_TO_LINUX;
+ }
+
+ g_event_count++;
+ const char *exc_short = (vector == 14) ? "#PF" : (vector == 0) ? "#DE" : (vector == 6) ? "#UD" : "#EX";
+ const char *fname = (vector == 14) ? "#PF (PAGE FAULT)" :
+ (vector == 0) ? "#DE (DIV BY ZERO)" :
+ (vector == 6) ? "#UD (INVALID OP)" : "#EXCP";
+
+ char hex_orig[64], disasm[96];
+ size_t hpos = 0;
+ for (int i = 0; i < ilen && hpos + 4 < sizeof(hex_orig); i++) {
+ hpos += (size_t)hv_snprintf(hex_orig + hpos, sizeof(hex_orig) - hpos, "%s%02x", i ? " " : "", orig_bytes[i]);
+ }
+ mini_disasm(orig_bytes, ilen, disasm, sizeof(disasm));
+
+ R1ContextHint h;
+ if (g_hint_active) {
+ h = g_hint;
+ g_hint_active = false;
+ } else {
+ hv_memset(&h, 0, sizeof(h));
+ h.stack_ok = (vmcb->save.rsp >= 0xFFFF800000000000ULL) ? 1U : 0U;
+ h.obs_complete = 1U;
+ hv_snprintf(h.sym, sizeof(h.sym), "ring0+0x%lx", rip_gva & 0xFFFFULL);
+ if (vector == 0) {
+ hv_snprintf(h.contract, sizeof(h.contract),
+ "Integer division quotient in RAX/EAX is stored to out_val and returned; safe fallback requires quotient=0 (out=0, ret=0).");
+ hv_snprintf(h.log_tail, sizeof(h.log_tail), "kernel: divide error denom=0 fallback_quotient=0");
+ } else if (vector == 6) {
+ hv_snprintf(h.contract, sizeof(h.contract),
+ "Non-fatal diagnostic trap with EAX=0; skipping trap completes cleanly with ret=0.");
+ hv_snprintf(h.log_tail, sizeof(h.log_tail), "kernel: diag_trap state=clean pre_commit=1");
+ } else {
+ hv_snprintf(h.contract, sizeof(h.contract),
+ "Optional telemetry store to unmapped pointer before commit; skipping store preserves state and returns 0.");
+ hv_snprintf(h.log_tail, sizeof(h.log_tail), "kernel: stage=pre_commit opt_ptr=NULL");
+ }
+ }
+
+ char user_prompt[1280];
+ hv_snprintf(user_prompt, sizeof(user_prompt),
+ "[RING-1 TELEMETRY]\n"
+ "EXC: %s (vec=%u err=0x%04lx cpl=%u)\n"
+ "CR2: 0x%016lx\n"
+ "RIP: %s (len=%d)\n"
+ "BYTES: %s\n"
+ "DISASM: %s\n"
+ "REGS: RAX=0x%lx RBX=0x%lx RCX=0x%lx RDX=0x%lx RSI=0x%lx RDI=0x%lx RSP=0x%lx RFLAGS=0x%lx\n"
+ "CONTRACT: %s\n"
+ "CTX: extable=%u bug_warn=%u lock_held=%u irq_ctx=%u side_effect=%u stack_ok=%u obs_complete=%u\n"
+ "LOG_TAIL:\n %s\n"
+ "Output ONLY 3 lines (no <think>, no markdown):\n"
+ "DIAGNOSIS: <one short sentence>\n"
+ "ACTION: <PATCH_BYTES | PASS_TO_LINUX | HALT_FOR_DUMP>\n"
+ "PATCH: <exact-length space-separated hex bytes or NONE>",
+ exc_short, vector, err, (uint32_t)vmcb->save.cpl, cr2,
+ h.sym, ilen, hex_orig, disasm,
+ vmcb->save.rax, regs->rbx, regs->rcx, regs->rdx, regs->rsi, regs->rdi, vmcb->save.rsp, vmcb->save.rflags,
+ h.contract,
+ h.extable, h.bug_warn, h.lock_held, h.irq_ctx, h.side_effect, h.stack_ok, h.obs_complete,
+ h.log_tail
+ );
+
+ kprintf("\n====================================================================\n");
+ kprintf("[RING -1 AI SURGEON] LIVE INTERCEPT #%u: %s (vec=%u cpl=%u cr2=0x%lx)\n",
+ g_event_count, fname, vector, (uint32_t)vmcb->save.cpl, cr2);
+ kprintf("[RING -1 AI SURGEON] RIP_GVA=0x%016lx RIP_GPA=0x%016lx ORIG(%dB)=%s (%s)\n",
+ rip_gva, rip_gpa, ilen, hex_orig, disasm);
+
+ StreamHudCtx sctx;
+ hv_memset(&sctx, 0, sizeof(sctx));
+ sctx.event_num = g_event_count;
+ sctx.fault_name = fname;
+ sctx.rip_gva = rip_gva;
+ sctx.orig_bytes = orig_bytes;
+ sctx.insn_len = (uint8_t)ilen;
+ fb_draw_thinking_hud(g_event_count, fname, rip_gva, orig_bytes, (uint8_t)ilen, r1_smp_num_cpus(), NULL);
+
+ char llm_out[512];
+ hv_memset(llm_out, 0, sizeof(llm_out));
+ int ptok = 0, gtok = 0;
+ uint32_t elapsed_ms = 0;
+
+ if (g_llm.ready) {
+ enable_avx2_cpu();
+ uint64_t saved_xcr0 = get_xcr0();
+ set_xcr0(saved_xcr0 | 7ULL);
+ void *xs_buf = (void *)(uintptr_t)XSAVE_BUF_PA;
+ hv_memset(xs_buf, 0, 4096);
+ xsave_state(xs_buf);
+
+ uint64_t t0 = read_tsc();
+ const char *sys_msg = "Ring -1 Kernel Surgeon. Output 3 lines only: DIAGNOSIS, ACTION, PATCH.";
+ r1_llm_generate(&g_llm, sys_msg, user_prompt, llm_out, sizeof(llm_out), 64,
+ &ptok, &gtok, token_stream_cb, &sctx);
+ uint64_t dt_tsc = read_tsc() - t0;
+ elapsed_ms = (uint32_t)(dt_tsc / 2300000ULL);
+
+ xrstor_state(xs_buf);
+ set_xcr0(saved_xcr0);
+
+ kprintf("[RING -1 LLM] MiniCPM5-2B Q4_K_M (%d L1 cores, prompt=%d tok, gen=%d tok, ~%u ms):\n%s\n",
+ r1_smp_num_cpus(), ptok, gtok, elapsed_ms, llm_out);
+ } else {
+ hv_snprintf(llm_out, sizeof(llm_out),
+ "DIAGNOSIS: No NVDIMM model attached; halting safely.\n"
+ "ACTION: HALT_FOR_DUMP\nPATCH: NONE");
+ }
+
+ char diag[160] = "Ring -1 AI diagnosis";
+ char act[24] = "HALT_FOR_DUMP";
+ char pat_s[128] = "NONE";
+
+ const char *p_diag = find_substr(llm_out, "DIAGNOSIS:");
+ if (p_diag) copy_line_after(p_diag + 10, diag, sizeof(diag));
+ const char *p_act = find_substr(llm_out, "ACTION:");
+ if (p_act) copy_line_after(p_act + 7, act, sizeof(act));
+ const char *p_pat = find_substr(llm_out, "PATCH:");
+ if (p_pat) copy_line_after(p_pat + 6, pat_s, sizeof(pat_s));
+
+ SurgeonResult decision = SURGEON_RES_HALT_FOR_DUMP;
+ uint8_t patch_bytes[16];
+ uint8_t patch_len = 0;
+
+ if (hv_strncmp(act, "PATCH_BYTES", 11) == 0) {
+ hv_snprintf(act, sizeof(act), "PATCH_BYTES");
+ const char *q = pat_s;
+ while (*q && patch_len < 16) {
+ while (*q == ' ' || *q == ',') q++;
+ if (!*q) break;
+ int hi = hex_val(q[0]), lo = q[1] ? hex_val(q[1]) : -1;
+ if (hi < 0 || lo < 0) break;
+ patch_bytes[patch_len++] = (uint8_t)((hi << 4) | lo);
+ q += 2;
+ }
+ if (validate_patch_bytes(patch_bytes, patch_len, ilen)) {
+ if (guest_write_gva(vmcb->save.cr3, rip_gva, patch_bytes, patch_len)) {
+ g_heal_count++;
+ decision = SURGEON_RES_PATCHED;
+ vmcb->control.eventinj = 0;
+ kprintf("[RING -1 AI SURGEON] VERIFIED & APPLIED PATCH (%u B) -> RESUMING VMRUN!\n", patch_len);
+ } else {
+ hv_snprintf(act, sizeof(act), "HALT_FOR_DUMP");
+ hv_snprintf(diag, sizeof(diag), "Failed to write guest physical page; halting safely.");
+ decision = SURGEON_RES_HALT_FOR_DUMP;
+ }
+ } else {
+ kprintf("[RING -1 AI SURGEON] SAFETY REJECT: invalid patch len=%u (expected %d) -> HALT_FOR_DUMP\n",
+ patch_len, ilen);
+ hv_snprintf(act, sizeof(act), "HALT_FOR_DUMP");
+ decision = SURGEON_RES_HALT_FOR_DUMP;
+ }
+ } else if (hv_strncmp(act, "PASS_TO_LINUX", 13) == 0) {
+ hv_snprintf(act, sizeof(act), "PASS_TO_LINUX");
+ decision = SURGEON_RES_PASS_TO_LINUX;
+ kprintf("[RING -1 AI SURGEON] DECISION: PASS_TO_LINUX (delegating to guest kernel)\n");
+ } else {
+ hv_snprintf(act, sizeof(act), "HALT_FOR_DUMP");
+ decision = SURGEON_RES_HALT_FOR_DUMP;
+ kprintf("[RING -1 AI SURGEON] DECISION: HALT_FOR_DUMP (unsafe state — freezing guest!)\n");
+ }
+ kprintf("====================================================================\n");
+
+ g_last.valid = true;
+ g_last.event_num = g_event_count;
+ hv_snprintf(g_last.fault_name, sizeof(g_last.fault_name), "%s", fname);
+ g_last.cpl = vmcb->save.cpl;
+ g_last.cr2 = cr2;
+ g_last.rip_gva = rip_gva;
+ g_last.rip_gpa = rip_gpa;
+ hv_memcpy(g_last.orig_bytes, orig_bytes, (size_t)ilen);
+ g_last.insn_len = (uint8_t)ilen;
+ hv_memcpy(g_last.patch_bytes, patch_bytes, patch_len);
+ g_last.patch_len = patch_len;
+ hv_snprintf(g_last.action, sizeof(g_last.action), "%s", act);
+ hv_snprintf(g_last.diagnosis, sizeof(g_last.diagnosis), "%s", diag);
+ g_last.elapsed_ms = elapsed_ms;
+ g_last.gen_toks = (uint32_t)gtok;
+
+ surgeon_redraw_hud();
+ return decision;
+}
diff --git a/04-ring1-kernel-surgeon/hv/svm.h b/04-ring1-kernel-surgeon/hv/svm.h
new file mode 100644
index 0000000..2186921
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/svm.h
@@ -0,0 +1,223 @@
+#pragma once
+#include "types.h"
+
+#define MSR_EFER 0xC0000080U
+#define MSR_VM_CR 0xC0010114U
+#define MSR_VM_HSAVE_PA 0xC0010117U
+
+#define EFER_SCE (1ULL << 0)
+#define EFER_LME (1ULL << 8)
+#define EFER_LMA (1ULL << 10)
+#define EFER_NXE (1ULL << 11)
+#define EFER_SVME (1ULL << 12)
+
+// VMCB misc1 intercepts (offset 0x00C)
+#define INTERCEPT_CPUID (1U << 18)
+#define INTERCEPT_HLT (1U << 24)
+#define INTERCEPT_IOIO_PROT (1U << 27)
+#define INTERCEPT_MSR_PROT (1U << 28)
+#define INTERCEPT_SHUTDOWN (1U << 31)
+
+// VMCB misc2 intercepts (offset 0x010)
+#define INTERCEPT_VMRUN (1U << 0)
+#define INTERCEPT_VMMCALL (1U << 1)
+
+// VMEXIT codes
+#define VMEXIT_EXCP_BASE 0x040ULL
+#define VMEXIT_EXCP_DE 0x040ULL
+#define VMEXIT_EXCP_UD 0x046ULL
+#define VMEXIT_EXCP_DF 0x048ULL
+#define VMEXIT_EXCP_GP 0x04DULL
+#define VMEXIT_EXCP_PF 0x04EULL
+#define VMEXIT_CPUID 0x072ULL
+#define VMEXIT_HLT 0x078ULL
+#define VMEXIT_MSR 0x07CULL
+#define VMEXIT_SHUTDOWN 0x07FULL
+#define VMEXIT_VMRUN 0x080ULL
+#define VMEXIT_VMMCALL 0x081ULL
+#define VMEXIT_NPF 0x400ULL
+#define VMEXIT_INVALID 0xFFFFFFFFFFFFFFFFULL
+
+typedef struct __attribute__((packed)) {
+ uint16_t selector;
+ uint16_t attrib;
+ uint32_t limit;
+ uint64_t base;
+} VmcbSeg;
+
+typedef struct __attribute__((packed)) {
+ uint32_t intercept_cr; // 0x000
+ uint32_t intercept_dr; // 0x004
+ uint32_t intercept_exceptions; // 0x008
+ uint32_t intercept_misc1; // 0x00C
+ uint32_t intercept_misc2; // 0x010
+ uint32_t intercept_misc3; // 0x014
+ uint8_t rsvd_018[0x03C - 0x018];
+ uint16_t pause_filter_thresh; // 0x03C
+ uint16_t pause_filter_count; // 0x03E
+ uint64_t iopm_base_pa; // 0x040
+ uint64_t msrpm_base_pa; // 0x048
+ uint64_t tsc_offset; // 0x050
+ uint32_t guest_asid; // 0x058
+ uint8_t tlb_control; // 0x05C
+ uint8_t rsvd_05d[3]; // 0x05D
+ uint64_t v_int_ctrl; // 0x060
+ uint64_t int_shadow; // 0x068
+ uint64_t exitcode; // 0x070
+ uint64_t exitinfo1; // 0x078
+ uint64_t exitinfo2; // 0x080
+ uint64_t exitintinfo; // 0x088
+ uint64_t np_enable; // 0x090
+ uint64_t avic_apic_bar; // 0x098
+ uint64_t ghcb_gpa; // 0x0A0
+ uint64_t eventinj; // 0x0A8
+ uint64_t n_cr3; // 0x0B0
+ uint64_t lbr_virt_enable; // 0x0B8
+ uint32_t clean; // 0x0C0
+ uint32_t rsvd_0c4; // 0x0C4
+ uint64_t next_rip; // 0x0C8
+ uint8_t num_bytes_fetched; // 0x0D0
+ uint8_t guest_bytes[15]; // 0x0D1
+ uint8_t rsvd_0e0[0x400 - 0x0E0];
+} VmcbControl;
+
+typedef struct __attribute__((packed)) {
+ VmcbSeg es; // 0x400
+ VmcbSeg cs; // 0x410
+ VmcbSeg ss; // 0x420
+ VmcbSeg ds; // 0x430
+ VmcbSeg fs; // 0x440
+ VmcbSeg gs; // 0x450
+ VmcbSeg gdtr; // 0x460
+ VmcbSeg ldtr; // 0x470
+ VmcbSeg idtr; // 0x480
+ VmcbSeg tr; // 0x490
+ uint8_t rsvd_4a0[0x4CB - 0x4A0];
+ uint8_t cpl; // 0x4CB
+ uint32_t rsvd_4cc; // 0x4CC
+ uint64_t efer; // 0x4D0
+ uint8_t rsvd_4d8[0x548 - 0x4D8];
+ uint64_t cr4; // 0x548
+ uint64_t cr3; // 0x550
+ uint64_t cr0; // 0x558
+ uint64_t dr7; // 0x560
+ uint64_t dr6; // 0x568
+ uint64_t rflags; // 0x570
+ uint64_t rip; // 0x578
+ uint8_t rsvd_580[0x5D8 - 0x580];
+ uint64_t rsp; // 0x5D8
+ uint8_t rsvd_5e0[0x5F8 - 0x5E0];
+ uint64_t rax; // 0x5F8
+ uint64_t star; // 0x600
+ uint64_t lstar; // 0x608
+ uint64_t cstar; // 0x610
+ uint64_t sfmask; // 0x618
+ uint64_t kernel_gs_base; // 0x620
+ uint64_t sysenter_cs; // 0x628
+ uint64_t sysenter_esp; // 0x630
+ uint64_t sysenter_eip; // 0x638
+ uint64_t cr2; // 0x640
+ uint8_t rsvd_648[0x668 - 0x648];
+ uint64_t g_pat; // 0x668
+ uint8_t rsvd_670[0x1000 - 0x670];
+} VmcbSave;
+
+typedef struct __attribute__((packed, aligned(4096))) {
+ VmcbControl control;
+ VmcbSave save;
+} Vmcb;
+
+_Static_assert(sizeof(Vmcb) == 4096, "VMCB must be 4096 bytes");
+_Static_assert(offsetof(Vmcb, control.exitcode) == 0x070, "exitcode offset");
+_Static_assert(offsetof(Vmcb, control.np_enable) == 0x090, "np_enable offset");
+_Static_assert(offsetof(Vmcb, control.eventinj) == 0x0A8, "eventinj offset");
+_Static_assert(offsetof(Vmcb, control.n_cr3) == 0x0B0, "n_cr3 offset");
+_Static_assert(offsetof(Vmcb, control.next_rip) == 0x0C8, "next_rip offset");
+_Static_assert(offsetof(Vmcb, save.cs) == 0x410, "save.cs offset");
+_Static_assert(offsetof(Vmcb, save.cpl) == 0x4CB, "save.cpl offset");
+_Static_assert(offsetof(Vmcb, save.efer) == 0x4D0, "save.efer offset");
+_Static_assert(offsetof(Vmcb, save.cr4) == 0x548, "save.cr4 offset");
+_Static_assert(offsetof(Vmcb, save.cr3) == 0x550, "save.cr3 offset");
+_Static_assert(offsetof(Vmcb, save.cr0) == 0x558, "save.cr0 offset");
+_Static_assert(offsetof(Vmcb, save.rflags) == 0x570, "save.rflags offset");
+_Static_assert(offsetof(Vmcb, save.rip) == 0x578, "save.rip offset");
+_Static_assert(offsetof(Vmcb, save.rsp) == 0x5D8, "save.rsp offset");
+_Static_assert(offsetof(Vmcb, save.rax) == 0x5F8, "save.rax offset");
+_Static_assert(offsetof(Vmcb, save.cr2) == 0x640, "save.cr2 offset");
+_Static_assert(offsetof(Vmcb, save.g_pat) == 0x668, "save.g_pat offset");
+
+typedef struct {
+ uint64_t rbx;
+ uint64_t rcx;
+ uint64_t rdx;
+ uint64_t rsi;
+ uint64_t rdi;
+ uint64_t rbp;
+ uint64_t r8;
+ uint64_t r9;
+ uint64_t r10;
+ uint64_t r11;
+ uint64_t r12;
+ uint64_t r13;
+ uint64_t r14;
+ uint64_t r15;
+} GuestRegs;
+
+extern void svm_vmrun(uint64_t guest_vmcb_pa, uint64_t host_vmcb_pa, GuestRegs *regs);
+
+// NPT & Guest Memory Helpers
+uint64_t npt_init(uint64_t fb_addr, uint64_t fb_size);
+void host_ensure_mapped(uint64_t phys_addr, uint64_t size);
+bool guest_gva_to_gpa(uint64_t guest_cr3, uint64_t gva, uint64_t *gpa_out);
+bool guest_read_gva(uint64_t guest_cr3, uint64_t gva, void *dst, size_t len);
+bool guest_write_gva(uint64_t guest_cr3, uint64_t gva, const void *src, size_t len);
+
+// x86-64 Instruction Length Decoder
+int x86_decode_len(const uint8_t *code, int max_len);
+
+// Surgeon Patch Engine (Stage 1 deterministic -> Stage 2 LLM hook)
+typedef struct {
+ uint32_t vector;
+ uint64_t error_code;
+ uint64_t cr2;
+ uint64_t rip_gva;
+ uint64_t rip_gpa;
+ uint8_t orig_bytes[16];
+ uint8_t insn_len;
+ uint32_t heal_index;
+ GuestRegs *regs;
+ Vmcb *vmcb;
+} SurgeonContext;
+
+typedef struct {
+ uint8_t patch_bytes[16];
+ uint8_t patch_len;
+ const char *reason;
+} SurgeonPatch;
+
+typedef enum {
+ SURGEON_RES_PASS_TO_LINUX = 0,
+ SURGEON_RES_PATCHED = 1,
+ SURGEON_RES_HALT_FOR_DUMP = 2,
+} SurgeonResult;
+
+typedef struct __attribute__((packed)) {
+ uint32_t magic; // 0x52314854 ("R1HT")
+ uint32_t lock_held;
+ uint32_t irq_ctx;
+ uint32_t side_effect;
+ uint32_t extable;
+ uint32_t bug_warn;
+ uint32_t stack_ok;
+ uint32_t obs_complete;
+ char sym[48];
+ char contract[192];
+ char log_tail[96];
+} R1ContextHint;
+
+bool surgeon_llm_init(void);
+bool surgeon_llm_is_ready(void);
+void surgeon_set_hint(const R1ContextHint *hint);
+SurgeonResult surgeon_handle_fault(Vmcb *vmcb, GuestRegs *regs, uint32_t vector, uint64_t err, uint64_t cr2);
+uint32_t surgeon_get_heal_count(void);
+void surgeon_redraw_hud(void);
diff --git a/04-ring1-kernel-surgeon/hv/svm_asm.asm b/04-ring1-kernel-surgeon/hv/svm_asm.asm
new file mode 100644
index 0000000..8771174
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/svm_asm.asm
@@ -0,0 +1,175 @@
+; ============================================================================
+; hv/svm_asm.asm — AMD SVM VMRUN / VMLOAD / VMSAVE + AVX2 / XSAVE Helpers
+; ============================================================================
+bits 64
+section .text
+
+global svm_vmrun
+svm_vmrun:
+ push rbp
+ push rbx
+ push r12
+ push r13
+ push r14
+ push r15
+
+ push rdi ; [rsp + 16] = guest_vmcb_pa
+ push rsi ; [rsp + 8] = host_vmcb_pa
+ push rdx ; [rsp + 0] = GuestRegs *regs
+
+ clgi
+
+ mov rax, rsi
+ vmsave
+
+ mov rax, rdi
+ vmload
+
+ mov rbx, [rdx + 0]
+ mov rcx, [rdx + 8]
+ mov rsi, [rdx + 24]
+ mov rdi, [rdx + 32]
+ mov rbp, [rdx + 40]
+ mov r8, [rdx + 48]
+ mov r9, [rdx + 56]
+ mov r10, [rdx + 64]
+ mov r11, [rdx + 72]
+ mov r12, [rdx + 80]
+ mov r13, [rdx + 88]
+ mov r14, [rdx + 96]
+ mov r15, [rdx + 104]
+ mov rax, [rsp + 16]
+ mov rdx, [rdx + 16]
+
+ vmrun
+
+ mov rax, [rsp + 0]
+ mov [rax + 0], rbx
+ mov [rax + 8], rcx
+ mov [rax + 16], rdx
+ mov [rax + 24], rsi
+ mov [rax + 32], rdi
+ mov [rax + 40], rbp
+ mov [rax + 48], r8
+ mov [rax + 56], r9
+ mov [rax + 64], r10
+ mov [rax + 72], r11
+ mov [rax + 80], r12
+ mov [rax + 88], r13
+ mov [rax + 96], r14
+ mov [rax + 104], r15
+
+ mov rax, [rsp + 16]
+ vmsave
+
+ mov rax, [rsp + 8]
+ vmload
+
+ add rsp, 24
+ pop r15
+ pop r14
+ pop r13
+ pop r12
+ pop rbx
+ pop rbp
+ ret
+
+global read_msr
+read_msr:
+ mov ecx, edi
+ rdmsr
+ shl rdx, 32
+ or rax, rdx
+ ret
+
+global write_msr
+write_msr:
+ mov ecx, edi
+ mov eax, esi
+ mov rdx, rsi
+ shr rdx, 32
+ wrmsr
+ ret
+
+global read_tsc
+read_tsc:
+ rdtsc
+ shl rdx, 32
+ or rax, rdx
+ ret
+
+global cpuid_raw
+cpuid_raw:
+ push rbx
+ mov r10, rdx
+ mov r11, rcx
+ mov eax, edi
+ mov ecx, esi
+ cpuid
+ mov [r10], eax
+ mov [r11], ebx
+ mov [r8], ecx
+ mov [r9], edx
+ pop rbx
+ ret
+
+global flush_host_tlb
+flush_host_tlb:
+ mov rax, cr3
+ mov cr3, rax
+ ret
+
+; Enable SSE + AVX2 + FMA + F16C on current CPU (CR0.EM=0, TS=0, MP=1; CR4.OSFXSR|OSXMMEXCPT|OSXSAVE; XCR0=7)
+global enable_avx2_cpu
+enable_avx2_cpu:
+ mov rax, cr0
+ and rax, ~((1 << 2) | (1 << 3)) ; clear EM, TS
+ or rax, (1 << 1) ; set MP
+ mov cr0, rax
+
+ mov rax, cr4
+ or rax, (1 << 9) | (1 << 10) | (1 << 18) ; OSFXSR | OSXMMEXCPT | OSXSAVE
+ mov cr4, rax
+
+ xor ecx, ecx
+ xgetbv
+ or eax, 7 ; x87 (1) | SSE (2) | AVX (4)
+ xor edx, edx
+ xsetbv
+ ret
+
+; Save/restore guest FPU+SSE+AVX state cleanly around Ring -1 AVX2 LLM inference
+; void xsave_state(void *buf_64aligned)
+global xsave_state
+xsave_state:
+ mov eax, 7
+ xor edx, edx
+ xsave [rdi]
+ ret
+
+; void xrstor_state(const void *buf_64aligned)
+global xrstor_state
+xrstor_state:
+ vzeroupper
+ mov eax, 7
+ xor edx, edx
+ xrstor [rdi]
+ ret
+
+; uint64_t get_xcr0(void) / void set_xcr0(uint64_t v)
+global get_xcr0
+get_xcr0:
+ xor ecx, ecx
+ xgetbv
+ shl rdx, 32
+ or rax, rdx
+ ret
+
+global set_xcr0
+set_xcr0:
+ xor ecx, ecx
+ mov eax, edi
+ mov rdx, rdi
+ shr rdx, 32
+ xsetbv
+ ret
diff --git a/04-ring1-kernel-surgeon/hv/types.h b/04-ring1-kernel-surgeon/hv/types.h
new file mode 100644
index 0000000..b0dd49c
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/types.h
@@ -0,0 +1,37 @@
+#pragma once
+
+#include <stdint.h>
+#include <stddef.h>
+#include <stdbool.h>
+
+static inline void outb(uint16_t port, uint8_t val) {
+ __asm__ volatile ("outb %0, %1" : : "a"(val), "Nd"(port));
+}
+static inline uint8_t inb(uint16_t port) {
+ uint8_t val;
+ __asm__ volatile ("inb %1, %0" : "=a"(val) : "Nd"(port));
+ return val;
+}
+static inline void cpu_pause(void) {
+ __asm__ volatile ("pause");
+}
+
+void *hv_memset(void *dst, int c, size_t n);
+void *hv_memcpy(void *dst, const void *src, size_t n);
+void *hv_memmove(void *dst, const void *src, size_t n);
+size_t hv_strlen(const char *s);
+int hv_strcmp(const char *a, const char *b);
+int hv_strncmp(const char *a, const char *b, size_t n);
+int hv_snprintf(char *buf, size_t cap, const char *fmt, ...);
+
+void serial_init(void);
+void serial_putc(char c);
+void serial_puts(const char *s);
+void kprintf(const char *fmt, ...);
+
+extern uint64_t read_msr(uint32_t msr);
+extern void write_msr(uint32_t msr, uint64_t val);
+extern uint64_t read_tsc(void);
+extern void cpuid_raw(uint32_t leaf, uint32_t subleaf,
+ uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d);
+extern void flush_host_tlb(void);
diff --git a/04-ring1-kernel-surgeon/hv/x86_decode.c b/04-ring1-kernel-surgeon/hv/x86_decode.c
new file mode 100644
index 0000000..087b845
--- /dev/null
+++ b/04-ring1-kernel-surgeon/hv/x86_decode.c
@@ -0,0 +1,220 @@
+#include "svm.h"
+
+// Compact x86-64 instruction length decoder (Intel/AMD 64-bit mode)
+// Handles legacy prefixes, REX, 1-byte / 0F 2-byte / 0F 38 / 0F 3A opcodes,
+// ModRM, SIB, disp8/disp32, imm8/imm16/imm32/imm64, and Group 3 (F6/F7).
+
+static int decode_modrm(const uint8_t *code, int pos, int max_len, bool addr32) {
+ if (pos >= max_len) return -1;
+ uint8_t modrm = code[pos++];
+ uint8_t mod = (modrm >> 6) & 3;
+ uint8_t rm = modrm & 7;
+ (void)addr32;
+
+ if (mod == 3) return pos;
+
+ bool has_sib = (rm == 4);
+ uint8_t sib_base = 0;
+ if (has_sib) {
+ if (pos >= max_len) return -1;
+ sib_base = code[pos++] & 7;
+ }
+
+ if (mod == 0) {
+ if (rm == 5) {
+ pos += 4; // RIP-relative disp32
+ } else if (has_sib && sib_base == 5) {
+ pos += 4; // [scaled index + disp32] or [disp32]
+ }
+ } else if (mod == 1) {
+ pos += 1; // disp8
+ } else if (mod == 2) {
+ pos += 4; // disp32
+ }
+
+ return (pos <= max_len) ? pos : -1;
+}
+
+int x86_decode_len(const uint8_t *code, int max_len) {
+ if (max_len <= 0) return -1;
+ if (max_len > 15) max_len = 15;
+
+ int pos = 0;
+ bool pfx_66 = false;
+ bool pfx_67 = false;
+ uint8_t rex = 0;
+
+ // 1. Legacy prefixes
+ while (pos < max_len) {
+ uint8_t b = code[pos];
+ if (b == 0x66) { pfx_66 = true; pos++; }
+ else if (b == 0x67) { pfx_67 = true; pos++; }
+ else if (b == 0xF0 || b == 0xF2 || b == 0xF3 ||
+ b == 0x2E || b == 0x36 || b == 0x3E ||
+ b == 0x26 || b == 0x64 || b == 0x65) {
+ pos++;
+ } else {
+ break;
+ }
+ }
+
+ // 2. REX prefix (0x40..0x4F)
+ if (pos < max_len && (code[pos] & 0xF0) == 0x40) {
+ rex = code[pos++];
+ }
+ bool rex_w = (rex & 0x08) != 0;
+
+ if (pos >= max_len) return -1;
+ uint8_t op = code[pos++];
+
+ int imm_size = 0;
+ bool has_modrm = false;
+ int op_imm_word = pfx_66 ? 2 : 4; // operand-size immediate (in 64-bit mode REX.W still uses imm32 except B8..BF!)
+
+ // 3. Two-byte (0F xx) and three-byte (0F 38 / 0F 3A) opcodes
+ if (op == 0x0F) {
+ if (pos >= max_len) return -1;
+ uint8_t op2 = code[pos++];
+
+ if (op2 == 0x38) {
+ // 0F 38 xx ModRM
+ if (pos >= max_len) return -1;
+ pos++;
+ has_modrm = true;
+ } else if (op2 == 0x3A) {
+ // 0F 3A xx ModRM imm8
+ if (pos >= max_len) return -1;
+ pos++;
+ has_modrm = true;
+ imm_size = 1;
+ } else if ((op2 >= 0x80 && op2 <= 0x8F)) {
+ // Jcc rel32
+ imm_size = 4;
+ } else if (op2 == 0x0B || op2 == 0x05 || op2 == 0x07 || op2 == 0x30 ||
+ op2 == 0x31 || op2 == 0x32 || op2 == 0x33 || op2 == 0xA2 ||
+ op2 == 0x08 || op2 == 0x09 || op2 == 0xA0 || op2 == 0xA1 ||
+ op2 == 0xA8 || op2 == 0xA9 || (op2 >= 0xC8 && op2 <= 0xCF)) {
+ // UD2 (0F 0B), SYSCALL, SYSRET, WRMSR, RDTSC, RDMSR, CPUID, BSWAP...
+ has_modrm = false;
+ } else if (op2 == 0xBA || op2 == 0xA4 || op2 == 0xAC || op2 == 0x70 ||
+ op2 == 0x71 || op2 == 0x72 || op2 == 0x73 || op2 == 0xC2 ||
+ op2 == 0xC4 || op2 == 0xC5 || op2 == 0xC6) {
+ has_modrm = true;
+ imm_size = 1;
+ } else {
+ // Most 0F xx instructions (MOVZX/MOVSX B6/B7/BE/BF, CMOVcc 40..4F, SETcc 90..9F,
+ // IMUL AF, BT/BTS/BTR/BTC, CMPXCHG B0/B1, XADD C0/C1, SSE/MOVUPS/etc.) take ModRM
+ has_modrm = true;
+ }
+ } else {
+ // 1-byte opcodes
+ switch (op) {
+ // ALU r/m, r and r, r/m
+ case 0x00: case 0x01: case 0x02: case 0x03:
+ case 0x08: case 0x09: case 0x0A: case 0x0B:
+ case 0x10: case 0x11: case 0x12: case 0x13:
+ case 0x18: case 0x19: case 0x1A: case 0x1B:
+ case 0x20: case 0x21: case 0x22: case 0x23:
+ case 0x28: case 0x29: case 0x2A: case 0x2B:
+ case 0x30: case 0x31: case 0x32: case 0x33:
+ case 0x38: case 0x39: case 0x3A: case 0x3B:
+ case 0x63: // MOVSXD
+ case 0x84: case 0x85: case 0x86: case 0x87: // TEST / XCHG
+ case 0x88: case 0x89: case 0x8A: case 0x8B: // MOV
+ case 0x8C: case 0x8D: case 0x8E: case 0x8F: // MOV seg / LEA / POP r/m
+ case 0xD0: case 0xD1: case 0xD2: case 0xD3: // shifts by 1 / CL
+ case 0xFE: case 0xFF: // INC/DEC/CALL/JMP/PUSH r/m
+ has_modrm = true;
+ break;
+
+ // ALU AL/eAX, imm
+ case 0x04: case 0x0C: case 0x14: case 0x1C:
+ case 0x24: case 0x2C: case 0x34: case 0x3C:
+ case 0xA8: case 0x6A: case 0xCD: case 0xE4: case 0xE5: case 0xE6: case 0xE7:
+ case 0xEB: case 0xE0: case 0xE1: case 0xE2: case 0xE3:
+ case 0x70: case 0x71: case 0x72: case 0x73:
+ case 0x74: case 0x75: case 0x76: case 0x77:
+ case 0x78: case 0x79: case 0x7A: case 0x7B:
+ case 0x7C: case 0x7D: case 0x7E: case 0x7F:
+ imm_size = 1;
+ break;
+
+ case 0x05: case 0x0D: case 0x15: case 0x1D:
+ case 0x25: case 0x2D: case 0x35: case 0x3D:
+ case 0xA9: case 0x68:
+ imm_size = op_imm_word;
+ break;
+
+ case 0xE8: case 0xE9: // CALL / JMP rel32
+ imm_size = 4;
+ break;
+
+ case 0x69: // IMUL r, r/m, imm32/16
+ has_modrm = true;
+ imm_size = op_imm_word;
+ break;
+
+ case 0x6B: // IMUL r, r/m, imm8
+ case 0x80: case 0x82: case 0x83: // Group 1 r/m, imm8
+ case 0xC0: case 0xC1: // shifts by imm8
+ case 0xC6: // MOV r/m8, imm8
+ has_modrm = true;
+ imm_size = 1;
+ break;
+
+ case 0x81: // Group 1 r/m, imm32/16
+ case 0xC7: // MOV r/m32/64, imm32 (or imm16 with 66)
+ has_modrm = true;
+ imm_size = op_imm_word;
+ break;
+
+ case 0xF6: // Group 3 byte (reg 0/1 = TEST has imm8)
+ has_modrm = true;
+ if (pos < max_len && (((code[pos] >> 3) & 7) <= 1)) imm_size = 1;
+ break;
+
+ case 0xF7: // Group 3 word/dword/qword (reg 0/1 = TEST has imm32/16)
+ has_modrm = true;
+ if (pos < max_len && (((code[pos] >> 3) & 7) <= 1)) imm_size = op_imm_word;
+ break;
+
+ case 0xA0: case 0xA1: case 0xA2: case 0xA3: // MOV moffs (64-bit addr unless 67)
+ imm_size = pfx_67 ? 4 : 8;
+ break;
+
+ case 0xB0: case 0xB1: case 0xB2: case 0xB3:
+ case 0xB4: case 0xB5: case 0xB6: case 0xB7:
+ imm_size = 1;
+ break;
+
+ case 0xB8: case 0xB9: case 0xBA: case 0xBB:
+ case 0xBC: case 0xBD: case 0xBE: case 0xBF:
+ imm_size = rex_w ? 8 : op_imm_word;
+ break;
+
+ case 0xC2: case 0xCA: // RET imm16
+ imm_size = 2;
+ break;
+
+ case 0xC8: // ENTER imm16, imm8
+ imm_size = 3;
+ break;
+
+ default:
+ // 1-byte ops without ModRM/imm: PUSH/POP reg (50..5F), NOP (90),
+ // XCHG (91..97), CBW/CDQ (98/99), PUSHF/POPF (9C/9D), MOVS/STOS/LODS (A4..AF),
+ // RET (C3), LEAVE (C9), INT3 (CC), IRET (CF), CLI/STI/CLD/STD (FA..FD), HLT (F4)
+ has_modrm = false;
+ break;
+ }
+ }
+
+ if (has_modrm) {
+ pos = decode_modrm(code, pos, max_len, pfx_67);
+ if (pos < 0) return -1;
+ }
+
+ pos += imm_size;
+ if (pos > max_len) return -1;
+ return pos;
+}
diff --git a/04-ring1-kernel-surgeon/scripts/build_initramfs.sh b/04-ring1-kernel-surgeon/scripts/build_initramfs.sh
new file mode 100755
index 0000000..2b6c32b
--- /dev/null
+++ b/04-ring1-kernel-surgeon/scripts/build_initramfs.sh
@@ -0,0 +1,66 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+PROJ="${PROJ:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
+KO_PATH="${1:?usage: build_initramfs.sh <surgeon_crash.ko> <out.cpio.gz>}"
+OUT_CPIO="$(realpath -m "${2:?missing output path}")"
+
+WORK="$(mktemp -d "$PROJ/build/initramfs.XXXXXX")"
+trap 'rm -rf "$WORK"' EXIT
+
+mkdir -p "$WORK"/{bin,sbin,etc,proc,sys,dev,tmp,root,lib/modules}
+cp /usr/bin/busybox "$WORK/bin/busybox"
+chmod 755 "$WORK/bin/busybox"
+
+for cmd in sh ash ls cat echo mount umount mkdir ps uptime dmesg uname insmod rmmod lsmod sleep clear id head tail grep awk sed cut tr wc top poweroff reboot; do
+ ln -s busybox "$WORK/bin/$cmd"
+done
+
+cp "$KO_PATH" "$WORK/lib/modules/surgeon_crash.ko"
+
+cat > "$WORK/init" << 'INITEOF'
+#!/bin/sh
+export PATH=/bin:/sbin
+
+mount -t proc proc /proc
+mount -t sysfs sysfs /sys
+mount -t devtmpfs devtmpfs /dev 2>/dev/null || true
+
+echo 7 > /proc/sys/kernel/printk 2>/dev/null || true
+echo 1 > /proc/sys/kernel/sysrq 2>/dev/null || true
+
+insmod /lib/modules/surgeon_crash.ko || true
+
+banner() {
+ echo ""
+ echo "================================================================"
+ echo " LINUX 5.15 GUEST — RING -1 KERNEL SURGEON (MiniCPM5-2B Q4_K_M)"
+ echo "================================================================"
+ uname -a
+ echo "Uptime: $(cat /proc/uptime) | Boot ID: $(cat /proc/sys/kernel/random/boot_id)"
+ echo "Framebuffer: $(cat /sys/class/graphics/fb0/name 2>/dev/null || echo none) ($(cat /sys/class/graphics/fb0/virtual_size 2>/dev/null || echo n/a))"
+ echo ""
+ echo "Live Ring 0 Crash Tests (Bare-Metal MiniCPM5-2B inside Ring -1):"
+ echo " echo pf > /proc/surgeon_crash # Ring 0 NULL deref (#PF -> 11x NOP)"
+ echo " echo de > /proc/surgeon_crash # Ring 0 div/0 (#DE -> 31 c0 xor eax,eax)"
+ echo " echo ud > /proc/surgeon_crash # Ring 0 UD2 trap (#UD -> 90 90)"
+ echo " echo extable > /proc/surgeon_crash # Benign Linux extable (PASS_TO_LINUX)"
+ echo " echo danger > /proc/surgeon_crash # Spinlock-held #PF (HALT_FOR_DUMP)"
+ echo " echo status > /proc/surgeon_crash # Query Ring -1 VMMCALL"
+ echo "================================================================"
+ echo ""
+}
+
+banner
+if [ -c /dev/tty0 ]; then
+ banner > /dev/tty0 2>/dev/null || true
+fi
+if [ -c /dev/tty0 ]; then
+ setsid sh -c 'exec /bin/sh </dev/tty0 >/dev/tty0 2>&1' &
+fi
+exec /bin/sh
+INITEOF
+chmod 755 "$WORK/init"
+
+(cd "$WORK" && find . -print0 | cpio --null -ov --format=newc 2>/dev/null | gzip -9 > "$OUT_CPIO")
+ls -lh "$OUT_CPIO"
diff --git a/04-ring1-kernel-surgeon/scripts/build_verifier_initramfs.sh b/04-ring1-kernel-surgeon/scripts/build_verifier_initramfs.sh
new file mode 100755
index 0000000..f5c663f
--- /dev/null
+++ b/04-ring1-kernel-surgeon/scripts/build_verifier_initramfs.sh
@@ -0,0 +1,49 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+PROJ="${PROJ:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
+KO_PATH="${1:-$PROJ/guest/bench_mod/surgeon_bench.ko}"
+OUT_CPIO="$(realpath -m "${2:-$PROJ/build/verifier-initramfs.cpio.gz}")"
+
+WORK="$(mktemp -d "$PROJ/build/ver-initrd.XXXXXX")"
+trap 'rm -rf "$WORK"' EXIT
+
+mkdir -p "$WORK"/{bin,sbin,proc,sys,dev,tmp,lib/modules}
+cp /usr/bin/busybox "$WORK/bin/busybox"
+chmod 755 "$WORK/bin/busybox"
+for cmd in sh ash cat echo mount insmod uptime poweroff sleep grep cut; do
+ ln -s busybox "$WORK/bin/$cmd"
+done
+cp "$KO_PATH" "$WORK/lib/modules/surgeon_bench.ko"
+
+cat > "$WORK/init" << 'INITEOF'
+#!/bin/sh
+export PATH=/bin:/sbin
+mount -t proc proc /proc
+mount -t sysfs sysfs /sys
+mount -t devtmpfs devtmpfs /dev 2>/dev/null || true
+echo 4 > /proc/sys/kernel/printk 2>/dev/null || true
+insmod /lib/modules/surgeon_bench.ko
+BOOT_ID="$(cat /proc/sys/kernel/random/boot_id)"
+echo "VERIFIER_READY boot_id=${BOOT_ID} uptime=$(cut -d" " -f1 /proc/uptime)"
+while IFS= read -r line; do
+ case "$line" in
+ PING)
+ echo "PONG boot_id=$(cat /proc/sys/kernel/random/boot_id) uptime=$(cut -d" " -f1 /proc/uptime)"
+ ;;
+ QUIT)
+ echo "BYE"
+ poweroff -f
+ ;;
+ *)
+ echo "$line" > /proc/surgeon_bench
+ RES="$(cat /proc/surgeon_bench)"
+ echo "${RES} boot_id=$(cat /proc/sys/kernel/random/boot_id) uptime=$(cut -d" " -f1 /proc/uptime)"
+ ;;
+ esac
+done
+INITEOF
+chmod 755 "$WORK/init"
+
+(cd "$WORK" && find . -print0 | cpio --null -ov --format=newc 2>/dev/null | gzip -9 > "$OUT_CPIO")
+ls -lh "$OUT_CPIO"
diff --git a/04-ring1-kernel-surgeon/scripts/export_gguf.sh b/04-ring1-kernel-surgeon/scripts/export_gguf.sh
new file mode 100755
index 0000000..5ab2527
--- /dev/null
+++ b/04-ring1-kernel-surgeon/scripts/export_gguf.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+set -euo pipefail
+PROJ="${PROJ:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
+MODEL_DIR="${1:?usage: export_gguf.sh <merged_hf_dir> <out_dir> <base_name>}"
+OUT_DIR="${2:?missing out_dir}"
+NAME="${3:-minicpm5-2b-surgeon}"
+
+LLAMA_DIR="${LLAMA_DIR:-/opt/llama.cpp}"
+PYTHON_BIN="${PYTHON_BIN:-$(command -v python3)}"
+if [[ -x "$PROJ/.venv/bin/python" ]]; then
+ PYTHON_BIN="$PROJ/.venv/bin/python"
+fi
+CONVERT="$LLAMA_DIR/convert_hf_to_gguf.py"
+QUANT="$LLAMA_DIR/build/bin/llama-quantize"
+BENCH="$LLAMA_DIR/build/bin/llama-bench"
+
+mkdir -p "$OUT_DIR"
+F16_GGUF="$OUT_DIR/${NAME}-f16.gguf"
+Q8_GGUF="$OUT_DIR/${NAME}-q8_0.gguf"
+Q4_GGUF="$OUT_DIR/${NAME}-q4_k_m.gguf"
+
+echo "[GGUF] Converting $MODEL_DIR -> $F16_GGUF ..."
+"$PYTHON_BIN" "$CONVERT" "$MODEL_DIR" --outfile "$F16_GGUF" --outtype f16
+
+echo "[GGUF] Quantizing -> Q8_0 and Q4_K_M ..."
+"$QUANT" "$F16_GGUF" "$Q8_GGUF" Q8_0
+"$QUANT" "$F16_GGUF" "$Q4_GGUF" Q4_K_M
+
+# Remove intermediate F16 GGUF to save disk space once Q8_0 and Q4_K_M succeed
+rm -f "$F16_GGUF"
+ls -lh "$Q8_GGUF" "$Q4_GGUF"
+
+echo "[GGUF] Benchmarking Q4_K_M and Q8_0 on EPYC CPU (16 physical threads, p256 / g64)..."
+"$BENCH" -m "$Q4_GGUF" -t 16 -p 256 -n 64 -r 3 -ngl 0
+"$BENCH" -m "$Q8_GGUF" -t 16 -p 256 -n 64 -r 3 -ngl 0
diff --git a/04-ring1-kernel-surgeon/scripts/mkiso.sh b/04-ring1-kernel-surgeon/scripts/mkiso.sh
new file mode 100755
index 0000000..3672222
--- /dev/null
+++ b/04-ring1-kernel-surgeon/scripts/mkiso.sh
@@ -0,0 +1,139 @@
+#!/usr/bin/env bash
+# Build UEFI GRUB2 Multiboot2 bootable ISO containing:
+# - /boot/surgeon.elf (Ring -1 AMD SVM Hypervisor)
+# - /boot/vmlinuz (Unmodified Linux guest bzImage)
+# - /boot/initramfs.cpio.gz (BusyBox + surgeon_crash.ko)
+set -euo pipefail
+
+HV_ELF="${1:?usage: mkiso.sh <surgeon.elf> <vmlinuz> <initramfs.cpio.gz> <out.iso>}"
+VMLINUZ="${2:?missing vmlinuz}"
+INITRD="${3:?missing initramfs}"
+OUT_ISO="${4:?missing out.iso}"
+
+OUT_DIR="$(dirname "$OUT_ISO")"
+mkdir -p "$OUT_DIR"
+WORK="$(mktemp -d "$OUT_DIR/iso-work.XXXXXX")"
+trap 'rm -rf "$WORK"' EXIT
+
+ISO_ROOT="$WORK/iso"
+mkdir -p "$ISO_ROOT/boot/grub"
+cp "$HV_ELF" "$ISO_ROOT/boot/surgeon.elf"
+cp "$VMLINUZ" "$ISO_ROOT/boot/vmlinuz"
+cp "$INITRD" "$ISO_ROOT/boot/initramfs.cpio.gz"
+
+cat > "$ISO_ROOT/boot/grub/grub.cfg" << 'GRUBEOF'
+serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
+terminal_input console serial
+terminal_output console serial
+set timeout=1
+set default=0
+
+insmod all_video
+insmod gfxterm
+set gfxmode=1280x720x32,1024x768x32,auto
+set gfxpayload=keep
+
+menuentry "Ring -1 Kernel Surgeon (AMD SVM Hypervisor + Linux Guest)" {
+ multiboot2 /boot/surgeon.elf
+ module2 /boot/vmlinuz vmlinuz
+ module2 /boot/initramfs.cpio.gz initramfs
+ boot
+}
+GRUBEOF
+
+mkdir -p "$WORK/efi_tree/EFI/BOOT"
+cat > "$WORK/embed.cfg" << 'EMBEOF'
+search --no-floppy --file --set=root /boot/surgeon.elf
+set prefix=($root)/boot/grub
+configfile ($root)/boot/grub/grub.cfg
+EMBEOF
+
+grub-mkstandalone \
+ -O x86_64-efi \
+ -o "$WORK/efi_tree/EFI/BOOT/BOOTX64.EFI" \
+ --modules="part_gpt part_msdos iso9660 fat multiboot2 normal serial terminal search search_fs_file configfile all_video efi_gop efi_uga video_bochs video_cirrus gfxterm font" \
+ "boot/grub/grub.cfg=$WORK/embed.cfg"
+
+# Build FAT16 EFI System Partition image (zero root)
+EFI_IMG="$ISO_ROOT/boot/efiboot.img"
+python3 - "$WORK/efi_tree/EFI/BOOT/BOOTX64.EFI" "$EFI_IMG" << 'PYEOF'
+import math, struct, sys
+
+efi_src, out_img = sys.argv[1], sys.argv[2]
+data = open(efi_src, "rb").read()
+
+BPS = 512
+SPC = 4
+CLUST_BYTES = BPS * SPC
+RESV = 4
+NFATS = 2
+ROOT_ENTRIES = 512
+ROOT_SECTORS = (ROOT_ENTRIES * 32) // BPS
+data_clusters = max(16, math.ceil(len(data) / CLUST_BYTES) + 32)
+total_clusters = max(4120, data_clusters)
+fat_sectors = math.ceil((total_clusters + 2) * 2 / BPS)
+data_start_sec = RESV + NFATS * fat_sectors + ROOT_SECTORS
+total_sectors = data_start_sec + total_clusters * SPC
+
+img = bytearray(total_sectors * BPS)
+bpb = struct.pack(
+ "<3s8sHBHBHHBHHHIIBBBI11s8s",
+ b"\xEB\x3C\x90", b"RING1SRG",
+ BPS, SPC, RESV, NFATS, ROOT_ENTRIES,
+ total_sectors if total_sectors < 65536 else 0,
+ 0xF8, fat_sectors, 32, 64, 0,
+ 0 if total_sectors < 65536 else total_sectors,
+ 0x80, 0, 0x29, 0x20261127, b"RING1_EFI ", b"FAT16 ",
+)
+img[0:len(bpb)] = bpb
+img[510:512] = b"\x55\xAA"
+
+fat = bytearray(fat_sectors * BPS)
+struct.pack_into("<HH", fat, 0, 0xFFF8, 0xFFFF)
+
+def clust_off(c):
+ return (data_start_sec + (c - 2) * SPC) * BPS
+
+def dir_entry(name83, attr, first_clust, size):
+ return struct.pack("<11sBBBHHHHHHHL", name83, attr, 0, 0, 0, 0, 0, 0, 0, 0, first_clust, size)
+
+struct.pack_into("<HH", fat, 2 * 2, 0xFFFF, 0xFFFF)
+n_file_clust = math.ceil(len(data) / CLUST_BYTES)
+for i in range(n_file_clust):
+ c = 4 + i
+ nxt = (c + 1) if (i + 1 < n_file_clust) else 0xFFFF
+ struct.pack_into("<H", fat, c * 2, nxt)
+
+for f in range(NFATS):
+ off = (RESV + f * fat_sectors) * BPS
+ img[off:off + len(fat)] = fat
+
+root_off = (RESV + NFATS * fat_sectors) * BPS
+img[root_off:root_off + 32] = dir_entry(b"EFI ", 0x10, 2, 0)
+
+c2 = clust_off(2)
+img[c2 + 0:c2 + 32] = dir_entry(b". ", 0x10, 2, 0)
+img[c2 + 32:c2 + 64] = dir_entry(b".. ", 0x10, 0, 0)
+img[c2 + 64:c2 + 96] = dir_entry(b"BOOT ", 0x10, 3, 0)
+
+c3 = clust_off(3)
+img[c3 + 0:c3 + 32] = dir_entry(b". ", 0x10, 3, 0)
+img[c3 + 32:c3 + 64] = dir_entry(b".. ", 0x10, 2, 0)
+img[c3 + 64:c3 + 96] = dir_entry(b"BOOTX64 EFI", 0x20, 4, len(data))
+
+c4 = clust_off(4)
+img[c4:c4 + len(data)] = data
+
+with open(out_img, "wb") as f:
+ f.write(img)
+PYEOF
+
+xorriso -as mkisofs \
+ -R -J -V "RING1_SURGEON" \
+ -e boot/efiboot.img \
+ -no-emul-boot \
+ -isohybrid-gpt-basdat \
+ -o "$OUT_ISO" \
+ "$ISO_ROOT"
+
+ls -lh "$OUT_ISO"
diff --git a/04-ring1-kernel-surgeon/scripts/pack_r1model.py b/04-ring1-kernel-surgeon/scripts/pack_r1model.py
new file mode 100644
index 0000000..dd7a095
--- /dev/null
+++ b/04-ring1-kernel-surgeon/scripts/pack_r1model.py
@@ -0,0 +1,234 @@
+#!/usr/bin/env python3
+"""
+Pack trained MiniCPM5-2B GRPO Q4_K_M GGUF + GPT-2 byte-level BPE tokenizer
+into a flat 2 GiB NVDIMM-ready bare-metal Ring -1 binary (.r1m).
+
+Zero libc, zero GGUF parser needed in Ring -1:
+ - Fixed 4KB header with exact physical offsets of all 381 tensors
+ - Raw Q4_K / Q6_K / F32 tensor blobs copied bit-for-bit from GGUF
+ - Flat UTF-8 vocab decode pool + O(1) FNV-1a BPE merge hash table
+"""
+from __future__ import annotations
+import json
+import os
+import struct
+import sys
+
+ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+if os.environ.get("LLAMA_GGUF_PY"):
+ sys.path.insert(0, os.environ["LLAMA_GGUF_PY"])
+from gguf import GGUFReader
+
+GGUF_IN = os.environ.get(
+ "GGUF_IN",
+ os.path.join(ROOT_DIR, "models", "minicpm5-2b-ring1-surgeon-grpo-q4_k_m.gguf"),
+)
+HF_TOK_DIR = os.environ.get(
+ "HF_TOK_DIR",
+ os.path.join(ROOT_DIR, "runs", "grpo-minicpm5-2b", "merged"),
+)
+OUT_R1M = os.environ.get(
+ "OUT_R1M",
+ os.path.join(ROOT_DIR, "models", "minicpm5-2b-surgeon.r1m"),
+)
+NVDIMM_SIZE = 2 * 1024 * 1024 * 1024 # Exact 2 GiB for QEMU NVDIMM
+
+DTYPE_MAP = {"F32": 0, "Q4_K": 1, "Q6_K": 2}
+
+def bytes_to_unicode():
+ bs = list(range(ord("!"), ord("~") + 1)) + list(range(ord("¡"), ord("¬") + 1)) + list(range(ord("®"), ord("ÿ") + 1))
+ cs = bs[:]
+ n = 0
+ for b in range(256):
+ if b not in bs:
+ bs.append(b)
+ cs.append(256 + n)
+ n += 1
+ return dict(zip(bs, [chr(c) for c in cs]))
+
+def align64(n: int) -> int:
+ return (n + 63) & ~63
+
+def main():
+ print(f"[PACK] Reading GGUF: {GGUF_IN}")
+ r = GGUFReader(GGUF_IN)
+ tmap = {t.name: t for t in r.tensors}
+
+ dim = int(r.get_field("llama.embedding_length").contents())
+ n_layers = int(r.get_field("llama.block_count").contents())
+ ffn_dim = int(r.get_field("llama.feed_forward_length").contents())
+ n_heads = int(r.get_field("llama.attention.head_count").contents())
+ n_kv_heads = int(r.get_field("llama.attention.head_count_kv").contents())
+ head_dim = dim // n_heads
+ rms_eps = float(r.get_field("llama.attention.layer_norm_rms_epsilon").contents())
+ rope_theta = float(r.get_field("llama.rope.freq_base").contents())
+ vocab_size = int(tmap["output.weight"].shape[1])
+
+ print(f"[PACK] Model: dim={dim} layers={n_layers} ffn={ffn_dim} heads={n_heads}/{n_kv_heads} vocab={vocab_size} eps={rms_eps} theta={rope_theta}")
+
+ # Load exact HF tokenizer.json for byte-level BPE vocab & merges
+ tj = json.load(open(os.path.join(HF_TOK_DIR, "tokenizer.json")))
+ vocab_dict = tj["model"]["vocab"]
+ added_tokens = {a["id"]: a["content"] for a in tj.get("added_tokens", [])}
+ b2u = bytes_to_unicode()
+ u2b = {v: k for k, v in b2u.items()}
+
+ # Build decoded byte strings for every token id 0..vocab_size-1
+ id_to_str = [""] * vocab_size
+ for tok_s, tid in vocab_dict.items():
+ if 0 <= tid < vocab_size:
+ id_to_str[tid] = tok_s
+ for tid, tok_s in added_tokens.items():
+ if 0 <= tid < vocab_size:
+ id_to_str[tid] = tok_s
+
+ vocab_pool = bytearray()
+ vocab_offs = []
+ vocab_lens = []
+ for tid in range(vocab_size):
+ s = id_to_str[tid]
+ if tid in added_tokens:
+ raw = s.encode("utf-8")
+ else:
+ raw = bytes(u2b[ch] if ch in u2b else ord("?") for ch in s)
+ vocab_offs.append(len(vocab_pool))
+ vocab_lens.append(len(raw))
+ vocab_pool.extend(raw)
+
+ # Map each single raw byte 0..255 -> token id
+ byte_to_tok = [0] * 256
+ for b in range(256):
+ ch = b2u[b]
+ byte_to_tok[b] = vocab_dict[ch]
+
+ # Build O(1) open-addressed FNV-1a hash table for BPE merges
+ # Slot: (uint32 left_id, uint32 right_id, uint32 merged_id, uint32 rank) — 16 bytes
+ # Empty slot sentinel: rank == 0xFFFFFFFF
+ merges = tj["model"]["merges"]
+ merge_entries = []
+ for rank, m in enumerate(merges):
+ if isinstance(m, str):
+ a, b = m.split(" ", 1)
+ else:
+ a, b = m[0], m[1]
+ ab = a + b
+ if a in vocab_dict and b in vocab_dict and ab in vocab_dict:
+ merge_entries.append((vocab_dict[a], vocab_dict[b], vocab_dict[ab], rank))
+
+ ht_cap = 1
+ while ht_cap < len(merge_entries) * 3:
+ ht_cap <<= 1
+ print(f"[PACK] BPE merges: {len(merge_entries)} -> hash table cap={ht_cap} ({ht_cap*16/1048576:.1f} MiB)")
+
+ ht_buf = bytearray(ht_cap * 16)
+ # Fill ranks with 0xFFFFFFFF
+ for i in range(ht_cap):
+ struct.pack_into("<IIII", ht_buf, i * 16, 0, 0, 0, 0xFFFFFFFF)
+
+ mask = ht_cap - 1
+ for lid, rid, mid, rank in merge_entries:
+ h = ((lid * 2654435761) ^ (rid * 2246822519)) & 0xFFFFFFFF
+ idx = h & mask
+ while struct.unpack_from("<I", ht_buf, idx * 16 + 12)[0] != 0xFFFFFFFF:
+ idx = (idx + 1) & mask
+ struct.pack_into("<IIII", ht_buf, idx * 16, lid, rid, mid, rank)
+
+ # Order tensors deterministically:
+ # Global: token_embd.weight, output_norm.weight, output.weight
+ # Per layer l=0..41 (9 tensors): attn_norm, attn_q, attn_k, attn_v, attn_output, ffn_norm, ffn_gate, ffn_up, ffn_down
+ tensor_names = ["token_embd.weight", "output_norm.weight", "output.weight"]
+ for l in range(n_layers):
+ for suffix in [
+ "attn_norm.weight", "attn_q.weight", "attn_k.weight", "attn_v.weight", "attn_output.weight",
+ "ffn_norm.weight", "ffn_gate.weight", "ffn_up.weight", "ffn_down.weight"
+ ]:
+ tensor_names.append(f"blk.{l}.{suffix}")
+
+ assert len(tensor_names) == 3 + n_layers * 9
+
+ # Layout:
+ # [0 .. 4096) : R1MHeader
+ # [4096 .. 4096 + N*16) : TensorDesc[381] = (uint64 offset, uint32 dtype, uint32 nbytes)
+ # aligned 64B : byte_to_tok[256] (1024 B)
+ # aligned 64B : vocab_offs[vocab_size] (u32), vocab_lens[vocab_size] (u16), vocab_pool
+ # aligned 64B : merge_ht[ht_cap * 16]
+ # aligned 4096B : raw tensor payloads (each 64B-aligned)
+ cur = 4096
+ tdesc_off = cur
+ cur = align64(cur + len(tensor_names) * 16)
+
+ b2t_off = cur
+ cur = align64(cur + 256 * 4)
+
+ voffs_off = cur
+ cur = align64(cur + vocab_size * 4)
+
+ vlens_off = cur
+ cur = align64(cur + vocab_size * 2)
+
+ vpool_off = cur
+ cur = align64(cur + len(vocab_pool))
+
+ ht_off = cur
+ cur = (cur + len(ht_buf) + 4095) & ~4095
+
+ tdescs = []
+ for name in tensor_names:
+ t = tmap[name]
+ dt = DTYPE_MAP[t.tensor_type.name]
+ nb = int(t.n_bytes)
+ tdescs.append((cur, dt, nb, t))
+ cur = align64(cur + nb)
+
+ total_used = cur
+ print(f"[PACK] Total packed bytes: {total_used / (1024**3):.3f} GiB (fits inside 2.000 GiB NVDIMM: {total_used <= NVDIMM_SIZE})")
+ assert total_used <= NVDIMM_SIZE
+
+ hdr = struct.pack(
+ "<8sIIIIIIIIffIIIIIIIIQQQQQQQQ",
+ b"R1SURG01",
+ dim, n_layers, ffn_dim, n_heads, n_kv_heads, head_dim, vocab_size, len(tensor_names),
+ rms_eps, rope_theta,
+ 0, 1, 130072, 130073, 8, 9, 130063, ht_cap,
+ tdesc_off, b2t_off, voffs_off, vlens_off, vpool_off, len(vocab_pool), ht_off, total_used
+ )
+ assert len(hdr) <= 4096
+
+ os.makedirs(os.path.dirname(OUT_R1M), exist_ok=True)
+ with open(OUT_R1M, "wb") as out:
+ out.write(hdr + b"\x00" * (4096 - len(hdr)))
+
+ # Tensor descriptors
+ out.seek(tdesc_off)
+ for off, dt, nb, _ in tdescs:
+ out.write(struct.pack("<QII", off, dt, nb))
+
+ out.seek(b2t_off)
+ out.write(struct.pack("<256I", *byte_to_tok))
+
+ out.seek(voffs_off)
+ out.write(struct.pack(f"<{vocab_size}I", *vocab_offs))
+
+ out.seek(vlens_off)
+ out.write(struct.pack(f"<{vocab_size}H", *vocab_lens))
+
+ out.seek(vpool_off)
+ out.write(vocab_pool)
+
+ out.seek(ht_off)
+ out.write(ht_buf)
+
+ # Stream raw GGUF tensor payloads
+ for idx, (off, dt, nb, t) in enumerate(tdescs):
+ out.seek(off)
+ out.write(memoryview(t.data).tobytes())
+ if idx % 90 == 0:
+ print(f"[PACK] Wrote tensor {idx+1}/{len(tdescs)}...")
+
+ # Pad cleanly to exact 2 GiB for QEMU NVDIMM
+ out.truncate(NVDIMM_SIZE)
+
+ print(f"[PACK] DONE -> {OUT_R1M} ({os.path.getsize(OUT_R1M)} bytes)")
+
+if __name__ == "__main__":
+ main()
diff --git a/04-ring1-kernel-surgeon/scripts/run_dashboard.sh b/04-ring1-kernel-surgeon/scripts/run_dashboard.sh
new file mode 100755
index 0000000..519ea58
--- /dev/null
+++ b/04-ring1-kernel-surgeon/scripts/run_dashboard.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+# Launch TensorBoard (:6006) + Ring -1 Web Dashboard (:8780) on demand for video/inspection.
+set -euo pipefail
+
+PROJ="${PROJ:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
+TB_DIR="${TB_DIR:-$PROJ/runs/tb-logs}"
+TB_PORT="${TB_PORT:-6006}"
+DASH_PORT="${DASH_PORT:-8780}"
+HOST_ADDR="${HOST_ADDR:-127.0.0.1}"
+mkdir -p "$TB_DIR"
+
+echo "================================================================"
+echo " Ring -1 Kernel Surgeon — TensorBoard + Live Web Dashboard"
+echo "================================================================"
+echo " Web Dashboard : http://${HOST_ADDR}:${DASH_PORT}"
+echo " TensorBoard : http://${HOST_ADDR}:${TB_PORT}"
+echo " Logdir : ${TB_DIR}"
+echo " Press Ctrl+C to stop both cleanly."
+echo "================================================================"
+
+"$PROJ/.venv/bin/tensorboard" --logdir "$TB_DIR" --host 0.0.0.0 --port "$TB_PORT" >/dev/null 2>&1 &
+TB_PID=$!
+trap 'kill "$TB_PID" 2>/dev/null || true' EXIT INT TERM
+
+DASH_PORT="$DASH_PORT" TB_PORT="$TB_PORT" "$PROJ/.venv/bin/python" "$PROJ/dashboard/server.py"
diff --git a/04-ring1-kernel-surgeon/scripts/run_demo_vnc.sh b/04-ring1-kernel-surgeon/scripts/run_demo_vnc.sh
new file mode 100755
index 0000000..4386338
--- /dev/null
+++ b/04-ring1-kernel-surgeon/scripts/run_demo_vnc.sh
@@ -0,0 +1,71 @@
+#!/usr/bin/env bash
+# ============================================================================
+# Ring -1 Kernel Surgeon — One-Take VNC Video Demo Launcher
+# Usage:
+# ./scripts/run_demo_vnc.sh vanilla # Unprotected Linux -> Kernel panic on echo pf
+# ./scripts/run_demo_vnc.sh surgeon # Ring -1 + Bare-Metal MiniCPM5-2B Q4_K_M (default)
+# Connect with a VNC client to: vnc://127.0.0.1:5901 (or set VNC_BIND=0.0.0.0)
+# ============================================================================
+set -euo pipefail
+
+MODE="${1:-surgeon}"
+PROJ="${PROJ:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
+ISO="${ISO:-$PROJ/build/ring1-surgeon.iso}"
+VMLINUZ="${VMLINUZ:-$PROJ/guest/vmlinuz}"
+INITRD="${INITRD:-$PROJ/build/initramfs.cpio.gz}"
+MODEL_R1M="${MODEL_R1M:-$PROJ/models/minicpm5-2b-surgeon.r1m}"
+OVMF_CODE="${OVMF_CODE:-/usr/share/OVMF/OVMF_CODE.fd}"
+OVMF_VARS="${OVMF_VARS:-$PROJ/build/OVMF_VARS.fd}"
+VNC_DISPLAY="${VNC_DISPLAY:-:1}"
+VNC_BIND="${VNC_BIND:-127.0.0.1}"
+SMP="${SMP:-24}"
+SERIAL_LOG="${SERIAL_LOG:-$PROJ/build/demo_${MODE}_serial.log}"
+
+if [[ ! -f "$OVMF_VARS" ]]; then
+ cp /usr/share/OVMF/OVMF_VARS.fd "$OVMF_VARS"
+fi
+
+VNC_NUM="${VNC_DISPLAY#:}"
+VNC_PORT="$((5900 + VNC_NUM))"
+
+echo "======================================================================"
+echo " RING -1 KERNEL SURGEON — LIVE VNC DEMO (MODE: ${MODE^^})"
+echo "======================================================================"
+echo " VNC URL : vnc://${VNC_BIND}:${VNC_PORT} (${VNC_BIND}${VNC_DISPLAY})"
+echo " Serial log : ${SERIAL_LOG}"
+if [[ "$MODE" == "vanilla" ]]; then
+ echo " Mode : UNPROTECTED LINUX 5.15 (expect Kernel panic on echo pf!)"
+ echo "======================================================================"
+ exec qemu-system-x86_64 \
+ -machine q35,accel=kvm \
+ -cpu host -smp 1 -m 2G \
+ -kernel "$VMLINUZ" \
+ -initrd "$INITRD" \
+ -append "console=tty0 console=ttyS0,115200 nokaslr panic_on_oops=1 rdinit=/init vga=0x344" \
+ -device VGA,vgamem_mb=32,xres=1280,yres=720 \
+ -vnc "${VNC_BIND}${VNC_DISPLAY}" \
+ -chardev stdio,id=ser0,mux=on,logfile="$SERIAL_LOG",signal=off \
+ -serial chardev:ser0
+else
+ if [[ ! -f "$MODEL_R1M" ]]; then
+ echo "ERROR: Missing $MODEL_R1M" >&2; exit 1
+ fi
+ echo " Mode : RING -1 AMD SVM + BARE-METAL MiniCPM5-2B Q4_K_M (${SMP} L1 Cores)"
+ echo " Model NVDIMM: $MODEL_R1M (2 GiB @ 0x100000000, UNMAPPED in AMD NPT)"
+ echo "======================================================================"
+ exec qemu-system-x86_64 \
+ -machine q35,accel=kvm,nvdimm=on \
+ -cpu EPYC,+svm \
+ -smp "$SMP" \
+ -m 2G,slots=2,maxmem=6G \
+ -object memory-backend-file,id=r1model,mem-path="$MODEL_R1M",size=2G,readonly=on \
+ -device nvdimm,id=nv1,memdev=r1model,unarmed=on \
+ -drive if=pflash,format=raw,readonly=on,file="$OVMF_CODE" \
+ -drive if=pflash,format=raw,file="$OVMF_VARS" \
+ -cdrom "$ISO" \
+ -boot d \
+ -device VGA,vgamem_mb=32,xres=1280,yres=720 \
+ -vnc "${VNC_BIND}${VNC_DISPLAY}" \
+ -chardev stdio,id=ser0,mux=on,logfile="$SERIAL_LOG",signal=off \
+ -serial chardev:ser0
+fi
diff --git a/04-ring1-kernel-surgeon/scripts/run_qemu.sh b/04-ring1-kernel-surgeon/scripts/run_qemu.sh
new file mode 100755
index 0000000..0ca1b29
--- /dev/null
+++ b/04-ring1-kernel-surgeon/scripts/run_qemu.sh
@@ -0,0 +1,57 @@
+#!/usr/bin/env bash
+# Launch Ring -1 Kernel Surgeon inside QEMU Nested AMD SVM + OVMF UEFI + VNC
+set -euo pipefail
+
+PROJ="${PROJ:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
+ISO="${ISO:-$PROJ/build/ring1-surgeon.iso}"
+VNC_DISPLAY="${VNC_DISPLAY:-:1}"
+VNC_BIND="${VNC_BIND:-127.0.0.1}"
+RAM="${RAM:-2G}"
+SMP="${SMP:-1}"
+SERIAL_LOG="${SERIAL_LOG:-$PROJ/build/serial.log}"
+MONITOR_SOCK="${MONITOR_SOCK:-$PROJ/build/qemu-monitor.sock}"
+OVMF_CODE="${OVMF_CODE:-/usr/share/OVMF/OVMF_CODE.fd}"
+OVMF_VARS_SRC="${OVMF_VARS_SRC:-/usr/share/OVMF/OVMF_VARS.fd}"
+OVMF_VARS="$PROJ/build/OVMF_VARS.fd"
+
+if [[ ! -f "$ISO" ]]; then
+ echo "ISO not found: $ISO — run 'make all' first." >&2
+ exit 1
+fi
+
+if [[ ! -f "$OVMF_VARS" ]]; then
+ cp "$OVMF_VARS_SRC" "$OVMF_VARS"
+fi
+
+# Derive TCP port for user-friendly printout
+VNC_NUM="${VNC_DISPLAY#:}"
+VNC_PORT="$((5900 + VNC_NUM))"
+
+echo "================================================================"
+echo " Ring -1 Kernel Surgeon — QEMU Nested AMD SVM + VNC Harness"
+echo "================================================================"
+echo " ISO : $ISO"
+echo " CPU : EPYC,+svm (KVM nested=$(cat /sys/module/kvm_amd/parameters/nested))"
+echo " RAM / SMP : $RAM / $SMP"
+echo " VNC : vnc://${VNC_BIND}:${VNC_PORT} (${VNC_BIND}${VNC_DISPLAY})"
+echo " Serial log : $SERIAL_LOG"
+echo " QMP/Monitor : $MONITOR_SOCK"
+echo "================================================================"
+
+rm -f "$MONITOR_SOCK"
+
+exec qemu-system-x86_64 \
+ -machine q35,accel=kvm \
+ -cpu EPYC,+svm \
+ -smp "$SMP" \
+ -m "$RAM" \
+ -drive if=pflash,format=raw,readonly=on,file="$OVMF_CODE" \
+ -drive if=pflash,format=raw,file="$OVMF_VARS" \
+ -cdrom "$ISO" \
+ -boot d \
+ -device VGA,vgamem_mb=32,xres=1280,yres=720 \
+ -vnc "${VNC_BIND}${VNC_DISPLAY}" \
+ -chardev stdio,id=ser0,mux=on,logfile="$SERIAL_LOG",signal=off \
+ -serial chardev:ser0 \
+ -monitor unix:"$MONITOR_SOCK",server,nowait \
+ "$@"
diff --git a/04-ring1-kernel-surgeon/scripts/start_live_services.sh b/04-ring1-kernel-surgeon/scripts/start_live_services.sh
new file mode 100755
index 0000000..7de9a97
--- /dev/null
+++ b/04-ring1-kernel-surgeon/scripts/start_live_services.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+set -euo pipefail
+PROJ="${PROJ:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
+PY="${PY:-$PROJ/.venv/bin/python}"
+TB_BIN="${TB_BIN:-$PROJ/.venv/bin/tensorboard}"
+mkdir -p "$PROJ/runs/tb-logs" "$PROJ/runs/service-logs"
+
+# Stop only listeners currently bound to 6006 or 8780
+for port in 6006 8780; do
+ pids=$(ss -tlnp "sport = :$port" 2>/dev/null | grep -oE "pid=[0-9]+" | cut -d= -f2 | sort -u || true)
+ for pid in $pids; do
+ kill "$pid" 2>/dev/null || true
+ done
+done
+sleep 1
+
+nohup "$TB_BIN" --logdir "$PROJ/runs/tb-logs" --host 0.0.0.0 --port 6006 \
+ >"$PROJ/runs/service-logs/tensorboard.log" 2>&1 </dev/null &
+nohup env DASH_HOST=0.0.0.0 DASH_PORT=8780 TB_PORT=6006 "$PY" "$PROJ/dashboard/server.py" \
+ >"$PROJ/runs/service-logs/dashboard.log" 2>&1 </dev/null &
+
+sleep 3
+ss -tlnp | grep -E ":(6006|8780)\b"
+curl -sS -o /dev/null -w "Dashboard http://127.0.0.1:8780 -> HTTP %{http_code}\n" http://127.0.0.1:8780/
+curl -sS -o /dev/null -w "TensorBoard http://127.0.0.1:6006 -> HTTP %{http_code}\n" http://127.0.0.1:6006/
diff --git a/04-ring1-kernel-surgeon/scripts/test_r1_llm.c b/04-ring1-kernel-surgeon/scripts/test_r1_llm.c
new file mode 100644
index 0000000..e624962
--- /dev/null
+++ b/04-ring1-kernel-surgeon/scripts/test_r1_llm.c
@@ -0,0 +1,172 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdint.h>
+#include <stdatomic.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <pthread.h>
+#include <time.h>
+
+#include "../hv/llm_engine.h"
+
+void *hv_memset(void *d, int c, size_t n) { return memset(d, c, n); }
+void *hv_memcpy(void *d, const void *s, size_t n) { return memcpy(d, s, n); }
+size_t hv_strlen(const char *s) { return strlen(s); }
+int hv_strncmp(const char *a, const char *b, size_t n) { return strncmp(a, b, n); }
+
+#define NTHREADS 16
+
+static _Atomic uint64_t g_gen = 0;
+static _Atomic int g_done = 0;
+static _Atomic int g_stop = 0;
+static R1ParallelFn g_fn = NULL;
+static void *g_ctx = NULL;
+static pthread_t g_threads[NTHREADS];
+
+static void *worker_loop(void *arg) {
+ int tid = (int)(intptr_t)arg;
+ uint64_t my_gen = 0;
+ while (!atomic_load_explicit(&g_stop, memory_order_acquire)) {
+ uint64_t cur = atomic_load_explicit(&g_gen, memory_order_acquire);
+ if (cur == my_gen) {
+ __asm__ volatile ("pause");
+ continue;
+ }
+ my_gen = cur;
+ if (atomic_load_explicit(&g_stop, memory_order_acquire)) break;
+ g_fn(tid, NTHREADS, g_ctx);
+ atomic_fetch_add_explicit(&g_done, 1, memory_order_release);
+ }
+ return NULL;
+}
+
+static void pool_init(void) {
+ for (int i = 1; i < NTHREADS; i++) {
+ pthread_create(&g_threads[i], NULL, worker_loop, (void *)(intptr_t)i);
+ }
+}
+
+static void pool_shutdown(void) {
+ atomic_store_explicit(&g_stop, 1, memory_order_release);
+ atomic_fetch_add_explicit(&g_gen, 1, memory_order_release);
+ for (int i = 1; i < NTHREADS; i++) pthread_join(g_threads[i], NULL);
+}
+
+static void host_parallel_dispatch(R1ParallelFn fn, void *ctx) {
+ g_fn = fn;
+ g_ctx = ctx;
+ atomic_store_explicit(&g_done, 0, memory_order_release);
+ atomic_fetch_add_explicit(&g_gen, 1, memory_order_release);
+ fn(0, NTHREADS, ctx);
+ while (atomic_load_explicit(&g_done, memory_order_acquire) < NTHREADS - 1) {
+ __asm__ volatile ("pause");
+ }
+}
+
+static double now_s(void) {
+ struct timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ return ts.tv_sec + ts.tv_nsec * 1e-9;
+}
+
+int main(int argc, char **argv) {
+ const char *path = (argc > 1) ? argv[1] : getenv("MODEL_R1M");
+ if (!path) path = "models/minicpm5-2b-surgeon.r1m";
+ int fd = open(path, O_RDONLY);
+ if (fd < 0) { perror("open r1m"); return 1; }
+ struct stat st;
+ fstat(fd, &st);
+ void *base = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
+ if (base == MAP_FAILED) { perror("mmap"); return 1; }
+
+ pool_init();
+ void *arena = aligned_alloc(64, 64 * 1024 * 1024);
+ R1LlmState llm;
+ if (!r1_llm_init(&llm, base, arena, host_parallel_dispatch)) {
+ fprintf(stderr, "r1_llm_init FAILED\n");
+ return 1;
+ }
+ printf("[HOST TEST] R1M initialized: dim=%u layers=%u vocab=%u\n",
+ llm.hdr->dim, llm.hdr->n_layers, llm.hdr->vocab_size);
+ fflush(stdout);
+
+ const char *sys_msg = "Ring -1 Kernel Surgeon. Output 3 lines only: DIAGNOSIS, ACTION, PATCH.";
+ const char *prompts[4] = {
+ "[RING-1 TELEMETRY]\n"
+ "EXC: #PF (vec=14 err=0x0002 cpl=0)\n"
+ "CR2: 0x0000000000000000\n"
+ "RIP: surgeon_crash+0x0180 (len=11)\n"
+ "BYTES: c7 04 25 00 00 00 00 ef be ad de\n"
+ "DISASM: mov dword ptr [0x0], 0xdeadbeef\n"
+ "REGS: RAX=0x0 RBX=0x3 RCX=0x0 RDX=0x0 RSI=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013e20 RFLAGS=0x246\n"
+ "CONTRACT: Optional telemetry store to unmapped pointer before commit; skipping store preserves out=0x100 and returns 0.\n"
+ "CTX: extable=0 bug_warn=0 lock_held=0 irq_ctx=0 side_effect=0 stack_ok=1 obs_complete=1\n"
+ "LOG_TAIL:\n surgeon_crash: stage=pre_commit opt_ptr=NULL\n"
+ "Output ONLY 3 lines (no <think>, no markdown):\n"
+ "DIAGNOSIS: <one short sentence>\n"
+ "ACTION: <PATCH_BYTES | PASS_TO_LINUX | HALT_FOR_DUMP>\n"
+ "PATCH: <exact-length space-separated hex bytes or NONE>",
+
+ "[RING-1 TELEMETRY]\n"
+ "EXC: #DE (vec=0 err=0x0000 cpl=0)\n"
+ "CR2: 0x0000000000000000\n"
+ "RIP: surgeon_crash+0x0210 (len=2)\n"
+ "BYTES: f7 f1\n"
+ "DISASM: div ecx\n"
+ "REGS: RAX=0x2a RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013cc0 RFLAGS=0x246\n"
+ "CONTRACT: Integer division quotient in RAX/EAX is stored to out_val and returned; numerator=0x2a, divisor=0, safe fallback requires quotient=0 (out=0, ret=0).\n"
+ "CTX: extable=0 bug_warn=0 lock_held=0 irq_ctx=0 side_effect=0 stack_ok=1 obs_complete=1\n"
+ "LOG_TAIL:\n surgeon_crash: denom=0 fallback_quotient=0\n"
+ "Output ONLY 3 lines (no <think>, no markdown):\n"
+ "DIAGNOSIS: <one short sentence>\n"
+ "ACTION: <PATCH_BYTES | PASS_TO_LINUX | HALT_FOR_DUMP>\n"
+ "PATCH: <exact-length space-separated hex bytes or NONE>",
+
+ "[RING-1 TELEMETRY]\n"
+ "EXC: #UD (vec=6 err=0x0000 cpl=0)\n"
+ "CR2: 0x0000000000000000\n"
+ "RIP: surgeon_crash+0x01ab (len=2)\n"
+ "BYTES: 0f 0b\n"
+ "DISASM: ud2\n"
+ "REGS: RAX=0x0 RBX=0x0 RCX=0x0 RDX=0x0 RDI=0xffff888004100000 RSP=0xffffc90000013c80 RFLAGS=0x246\n"
+ "CONTRACT: Non-fatal diagnostic trap with EAX=0 and out_val=0x42 already prepared; skipping trap completes cleanly with ret=0.\n"
+ "CTX: extable=0 bug_warn=0 lock_held=0 irq_ctx=0 side_effect=0 stack_ok=1 obs_complete=1\n"
+ "LOG_TAIL:\n surgeon_crash: diag_trap state=clean pre_commit=1\n"
+ "Output ONLY 3 lines (no <think>, no markdown):\n"
+ "DIAGNOSIS: <one short sentence>\n"
+ "ACTION: <PATCH_BYTES | PASS_TO_LINUX | HALT_FOR_DUMP>\n"
+ "PATCH: <exact-length space-separated hex bytes or NONE>",
+
+ "[RING-1 TELEMETRY]\n"
+ "EXC: #PF (vec=14 err=0x0002 cpl=0)\n"
+ "CR2: 0x0000000000000000\n"
+ "RIP: surgeon_crash+0x0300 (len=11)\n"
+ "BYTES: c7 04 25 00 00 00 00 ef be ad de\n"
+ "DISASM: mov dword ptr [0x0], 0xdeadbeef\n"
+ "REGS: RAX=0x0 RBX=0x3 RCX=0x0 RSP=0xffffc90000013900 RFLAGS=0x246\n"
+ "CONTRACT: Ring 0 NULL write while holding spinlock (lock_held=1).\n"
+ "CTX: extable=0 bug_warn=0 lock_held=1 irq_ctx=0 side_effect=0 stack_ok=1 obs_complete=1\n"
+ "LOG_TAIL:\n surgeon_crash: spin_lock held; hazard lock=1\n"
+ "Output ONLY 3 lines (no <think>, no markdown):\n"
+ "DIAGNOSIS: <one short sentence>\n"
+ "ACTION: <PATCH_BYTES | PASS_TO_LINUX | HALT_FOR_DUMP>\n"
+ "PATCH: <exact-length space-separated hex bytes or NONE>"
+ };
+ const char *names[4] = {"#PF NULL-deref (11B)", "#DE div ecx (2B -> xor eax,eax)", "#UD ud2 (2B)", "CONTROL HALT (lock_held=1)"};
+
+ for (int t = 0; t < 4; t++) {
+ char out[512] = {0};
+ int ptok = 0, gtok = 0;
+ double t0 = now_s();
+ r1_llm_generate(&llm, sys_msg, prompts[t], out, sizeof(out), 64, &ptok, &gtok, NULL, NULL);
+ double dt = now_s() - t0;
+ printf("\n=== TEST %d: %s (prompt=%d tok, gen=%d tok, total=%.2fs, %.1f tok/s) ===\n%s\n",
+ t + 1, names[t], ptok, gtok, dt, (ptok + gtok) / dt, out);
+ fflush(stdout);
+ }
+ pool_shutdown();
+ return 0;
+}
diff --git a/04-ring1-kernel-surgeon/scripts/verify_stage1.py b/04-ring1-kernel-surgeon/scripts/verify_stage1.py
new file mode 100755
index 0000000..454e69d
--- /dev/null
+++ b/04-ring1-kernel-surgeon/scripts/verify_stage1.py
@@ -0,0 +1,130 @@
+#!/usr/bin/env python3
+import os, select, socket, subprocess, sys, time
+
+PROJ = os.environ.get("PROJ", os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+ISO = os.path.join(PROJ, "build/ring1-surgeon.iso")
+OVMF_CODE = "/usr/share/OVMF/OVMF_CODE.fd"
+OVMF_VARS = os.path.join(PROJ, "build/OVMF_VARS.fd")
+if not os.path.exists(OVMF_VARS):
+ import shutil
+ shutil.copy("/usr/share/OVMF/OVMF_VARS.fd", OVMF_VARS)
+
+run_dir = sys.argv[1] if len(sys.argv) > 1 else os.path.join(PROJ, "build")
+os.makedirs(run_dir, exist_ok=True)
+ser_log = os.path.join(run_dir, "verify_serial.log")
+mon_sock = os.path.join(run_dir, "verify_mon.sock")
+if os.path.exists(mon_sock):
+ os.unlink(mon_sock)
+
+cmd = [
+ "qemu-system-x86_64",
+ "-machine", "q35,accel=kvm",
+ "-cpu", "EPYC,+svm",
+ "-smp", "1",
+ "-m", "2G",
+ "-drive", f"if=pflash,format=raw,readonly=on,file={OVMF_CODE}",
+ "-drive", f"if=pflash,format=raw,file={OVMF_VARS}",
+ "-cdrom", ISO,
+ "-boot", "d",
+ "-device", "VGA,vgamem_mb=32,xres=1280,yres=720",
+ "-vnc", "127.0.0.1:19",
+ "-serial", "stdio",
+ "-monitor", f"unix:{mon_sock},server,nowait",
+]
+
+print("[VERIFY] Launching QEMU Nested AMD SVM...")
+proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=0)
+log_f = open(ser_log, "wb")
+buf = bytearray()
+
+def read_until(needle, timeout=35.0):
+ deadline = time.time() + timeout
+ while time.time() < deadline:
+ if proc.poll() is not None:
+ return False
+ r, _, _ = select.select([proc.stdout], [], [], 0.2)
+ if r:
+ chunk = os.read(proc.stdout.fileno(), 4096)
+ if not chunk:
+ break
+ buf.extend(chunk)
+ log_f.write(chunk)
+ log_f.flush()
+ if needle.encode() in buf:
+ return True
+ return False
+
+def send_cmd(s):
+ proc.stdin.write((s + "\n").encode())
+ proc.stdin.flush()
+
+def screendump(ppm_path):
+ s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+ s.connect(mon_sock)
+ s.settimeout(2.0)
+ try: s.recv(4096)
+ except Exception: pass
+ s.sendall(f"screendump {ppm_path}\n".encode())
+ time.sleep(0.5)
+ try: s.recv(4096)
+ except Exception: pass
+ s.close()
+
+try:
+ ok_boot = read_until("LINUX GUEST RUNNING UNDER RING -1 KERNEL SURGEON", timeout=45.0)
+ print(f"[VERIFY] Linux booted under Ring -1 SVM: {ok_boot}")
+ if not ok_boot:
+ print("=== TAIL OF SERIAL LOG ===")
+ print(buf[-4000:].decode(errors="replace"))
+ sys.exit(1)
+
+ time.sleep(1.0)
+ screendump(os.path.join(run_dir, "01_linux_booted.ppm"))
+
+ # 1. Query Ring -1 VMMCALL status
+ send_cmd("echo status > /proc/surgeon_crash")
+ ok_vmm = read_until("4f4b5f52494e4731 heals=0", timeout=5.0)
+ print(f"[VERIFY] VMMCALL status query: {ok_vmm}")
+
+ # 2. Trigger Ring 0 NULL-pointer dereference (#PF) -> Ring -1 heals it live!
+ send_cmd("echo pf > /proc/surgeon_crash")
+ ok_pf_hv = read_until("LIVE INTERCEPT #1", timeout=10.0)
+ ok_pf_alive = read_until("SURVIVED NULL-DEREF!", timeout=10.0)
+ print(f"[VERIFY] Ring 0 #PF intercepted={ok_pf_hv}, guest survived={ok_pf_alive}")
+ time.sleep(0.5)
+ screendump(os.path.join(run_dir, "02_after_pf_heal.ppm"))
+
+ # 3. Trigger Ring 0 UD2 (#UD) -> Ring -1 heals it live!
+ send_cmd("echo ud > /proc/surgeon_crash")
+ ok_ud_hv = read_until("LIVE INTERCEPT #2", timeout=10.0)
+ ok_ud_alive = read_until("SURVIVED UD2 TRAP!", timeout=10.0)
+ print(f"[VERIFY] Ring 0 #UD intercepted={ok_ud_hv}, guest survived={ok_ud_alive}")
+ time.sleep(0.5)
+ screendump(os.path.join(run_dir, "03_after_ud_heal.ppm"))
+
+ # 4. Verify uptime & shell still alive + re-verify VMMCALL heal count == 2
+ send_cmd("echo status > /proc/surgeon_crash && echo ALIVE_UPTIME:$(cat /proc/uptime)")
+ ok_alive = read_until("ALIVE_UPTIME:", timeout=5.0)
+ time.sleep(0.5)
+ # Drain remaining output
+ while select.select([proc.stdout], [], [], 0.2)[0]:
+ chunk = os.read(proc.stdout.fileno(), 4096)
+ if not chunk: break
+ buf.extend(chunk); log_f.write(chunk)
+ screendump(os.path.join(run_dir, "04_final_hud.ppm"))
+ print(f"[VERIFY] Final guest alive check: {ok_alive}")
+ print("=== KEY SERIAL EXCERPT ===")
+ text = buf.decode(errors="replace")
+ for line in text.splitlines():
+ if any(k in line for k in ["RING -1", "[MB2]", "[SVM]", "[NPT]", "[LINUX]", "[VMMCALL]", "surgeon_crash", "efifb", "ALIVE_UPTIME", "FATAL", "PANIC", "Oops", "BUG:"]):
+ print(line)
+ if not (ok_boot and ok_pf_hv and ok_pf_alive and ok_ud_hv and ok_ud_alive and ok_alive):
+ sys.exit(2)
+ print("[VERIFY] ALL STAGE 1 CHECKS PASSED!")
+finally:
+ proc.terminate()
+ try: proc.wait(timeout=5)
+ except Exception: proc.kill()
+ log_f.close()
+ if os.path.exists(mon_sock):
+ os.unlink(mon_sock)
diff --git a/04-ring1-kernel-surgeon/scripts/verify_stage3.py b/04-ring1-kernel-surgeon/scripts/verify_stage3.py
new file mode 100755
index 0000000..25335aa
--- /dev/null
+++ b/04-ring1-kernel-surgeon/scripts/verify_stage3.py
@@ -0,0 +1,160 @@
+#!/usr/bin/env python3
+import glob, os, select, shutil, socket, subprocess, sys, time
+from PIL import Image
+
+PROJ = os.environ.get("PROJ", os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+ISO = os.path.join(PROJ, "build/ring1-surgeon.iso")
+MODEL_R1M = os.environ.get("MODEL_R1M", os.path.join(PROJ, "models/minicpm5-2b-surgeon.r1m"))
+OVMF_CODE = "/usr/share/OVMF/OVMF_CODE.fd"
+OVMF_VARS = os.path.join(PROJ, "build/OVMF_VARS.fd")
+if not os.path.exists(OVMF_VARS):
+ shutil.copy("/usr/share/OVMF/OVMF_VARS.fd", OVMF_VARS)
+
+run_dir = sys.argv[1] if len(sys.argv) > 1 else os.path.join(PROJ, "build")
+os.makedirs(run_dir, exist_ok=True)
+ser_log = os.path.join(run_dir, "stage3_serial.log")
+mon_sock = os.path.join(run_dir, "stage3_mon.sock")
+if os.path.exists(mon_sock):
+ os.unlink(mon_sock)
+
+cmd = [
+ "qemu-system-x86_64",
+ "-machine", "q35,accel=kvm,nvdimm=on",
+ "-cpu", "EPYC,+svm",
+ "-smp", "24",
+ "-m", "2G,slots=2,maxmem=6G",
+ "-object", f"memory-backend-file,id=r1model,mem-path={MODEL_R1M},size=2G,readonly=on",
+ "-device", "nvdimm,id=nv1,memdev=r1model,unarmed=on",
+ "-drive", f"if=pflash,format=raw,readonly=on,file={OVMF_CODE}",
+ "-drive", f"if=pflash,format=raw,file={OVMF_VARS}",
+ "-cdrom", ISO,
+ "-boot", "d",
+ "-device", "VGA,vgamem_mb=32,xres=1280,yres=720",
+ "-vnc", "127.0.0.1:19",
+ "-serial", "stdio",
+ "-monitor", f"unix:{mon_sock},server,nowait",
+]
+
+print("[STAGE3] Launching QEMU Nested AMD SVM (24 L1 cores + 2 GiB NVDIMM MiniCPM5-2B Q4_K_M)...")
+proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=0)
+log_f = open(ser_log, "wb")
+buf = bytearray()
+
+def read_until(needle: str, start_pos: int = 0, timeout: float = 45.0) -> bool:
+ end = time.time() + timeout
+ nb = needle.encode()
+ while time.time() < end:
+ if proc.poll() is not None:
+ return nb in buf[start_pos:]
+ r, _, _ = select.select([proc.stdout], [], [], 0.15)
+ if r:
+ ch = os.read(proc.stdout.fileno(), 4096)
+ if not ch: break
+ buf.extend(ch); log_f.write(ch); log_f.flush()
+ if nb in buf[start_pos:]:
+ return True
+ return False
+
+def send_cmd(s: str):
+ proc.stdin.write((s + "\n").encode())
+ proc.stdin.flush()
+
+def screendump(name: str):
+ ppm = os.path.join(run_dir, name + ".ppm")
+ png = os.path.join(run_dir, name + ".png")
+ s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+ s.connect(mon_sock)
+ s.settimeout(2.0)
+ try: s.recv(4096)
+ except Exception: pass
+ s.sendall(f"screendump {ppm}\n".encode())
+ time.sleep(0.5)
+ try: s.recv(4096)
+ except Exception: pass
+ s.close()
+ if os.path.exists(ppm):
+ Image.open(ppm).save(png)
+ os.unlink(ppm)
+ print(f"[STAGE3] Saved VNC screenshot -> {png}")
+
+try:
+ ok_boot = read_until("LINUX 5.15 GUEST", 0, 45.0)
+ print(f"[STAGE3] 1. Boot Linux under Ring -1 + MiniCPM5-2B: {ok_boot}")
+ if not ok_boot:
+ print(buf[-4000:].decode(errors="replace"))
+ sys.exit(1)
+ time.sleep(0.8)
+ screendump("01_stage3_booted")
+
+ # Query status via VMMCALL
+ pos = len(buf)
+ send_cmd("echo status > /proc/surgeon_crash && echo BOOT_ID_0:$(cat /proc/sys/kernel/random/boot_id)")
+ ok_status = read_until("llm_ready=1", pos, 6.0)
+ print(f"[STAGE3] 2. VMMCALL status (l1_cores + llm_ready=1): {ok_status}")
+
+ # Test A: #PF NULL-deref (11B) -> Bare-Metal MiniCPM5-2B live-patches 11x NOP!
+ pos = len(buf)
+ t0 = time.time()
+ send_cmd("echo pf > /proc/surgeon_crash")
+ ok_pf = read_until("SURVIVED NULL-DEREF!", pos, 40.0)
+ print(f"[STAGE3] 3. #PF NULL-deref healed live by L1 MiniCPM5-2B: {ok_pf} ({time.time()-t0:.2f}s)")
+ time.sleep(0.4)
+ screendump("02_ai_pf_healed")
+
+ # Test B: #DE div ecx (2B) -> Bare-Metal MiniCPM5-2B live-patches 31 c0 (xor eax,eax) -> quotient=0!
+ pos = len(buf)
+ t0 = time.time()
+ send_cmd("echo de > /proc/surgeon_crash")
+ ok_de = read_until("Safe fallback quotient=0", pos, 40.0)
+ print(f"[STAGE3] 4. #DE div/0 healed live (quotient=0) by L1 MiniCPM5-2B: {ok_de} ({time.time()-t0:.2f}s)")
+ time.sleep(0.4)
+ screendump("03_ai_de_healed")
+
+ # Test C: #UD ud2 (2B) -> Bare-Metal MiniCPM5-2B live-patches 90 90!
+ pos = len(buf)
+ t0 = time.time()
+ send_cmd("echo ud > /proc/surgeon_crash")
+ ok_ud = read_until("SURVIVED UD2 TRAP!", pos, 40.0)
+ print(f"[STAGE3] 5. #UD ud2 healed live by L1 MiniCPM5-2B: {ok_ud} ({time.time()-t0:.2f}s)")
+ time.sleep(0.4)
+ screendump("04_ai_ud_healed")
+
+ # Test D: Benign Linux _ASM_EXTABLE control -> Bare-Metal MiniCPM5-2B outputs PASS_TO_LINUX -> rc=-14!
+ pos = len(buf)
+ t0 = time.time()
+ send_cmd("echo extable > /proc/surgeon_crash")
+ ok_ext = read_until("EXTABLE CONTROL OK! Linux handled fault natively -> rc=-14", pos, 40.0)
+ print(f"[STAGE3] 6. Benign extable PASS_TO_LINUX by L1 MiniCPM5-2B: {ok_ext} ({time.time()-t0:.2f}s)")
+ time.sleep(0.4)
+ screendump("05_ai_extable_pass")
+
+ # Verify uptime + boot_id continuity after all 4 recoveries!
+ pos = len(buf)
+ send_cmd("echo status > /proc/surgeon_crash && echo ALIVE_UPTIME:$(cat /proc/uptime) BOOT_ID_1:$(cat /proc/sys/kernel/random/boot_id)")
+ ok_alive = read_until("ALIVE_UPTIME:", pos, 6.0)
+ print(f"[STAGE3] 7. Linux alive with continuous uptime & boot_id: {ok_alive}")
+
+ # Test E: Dangerous spinlock-held #PF -> Bare-Metal MiniCPM5-2B outputs HALT_FOR_DUMP & freezes guest safely!
+ pos = len(buf)
+ t0 = time.time()
+ send_cmd("echo danger > /proc/surgeon_crash")
+ ok_halt = read_until("HALT_FOR_DUMP EXECUTED", pos, 40.0)
+ print(f"[STAGE3] 8. Unsafe spinlock-held #PF -> HALT_FOR_DUMP by L1 MiniCPM5-2B: {ok_halt} ({time.time()-t0:.2f}s)")
+ time.sleep(0.5)
+ screendump("06_ai_danger_halt")
+
+ print("\n=== KEY STAGE 3 SERIAL LOG EXCERPT ===")
+ for line in buf.decode(errors="replace").splitlines():
+ if any(k in line for k in ["RING -1", "[SMP]", "[LLM]", "[NPT]", "[SVM]", "[VMMCALL]", "DIAGNOSIS:", "ACTION:", "PATCH:", "surgeon_crash", "ALIVE_UPTIME", "BOOT_ID_", "HALT_FOR_DUMP", "FATAL"]):
+ print(line)
+
+ if not (ok_boot and ok_status and ok_pf and ok_de and ok_ud and ok_ext and ok_alive and ok_halt):
+ sys.exit(2)
+ print("\n[STAGE3] ALL 8 END-TO-END BARE-METAL L1 MiniCPM5-2B + VNC CHECKS PASSED!")
+finally:
+ proc.terminate()
+ try: proc.wait(timeout=5)
+ except Exception: proc.kill()
+ log_f.close()
+ if os.path.exists(mon_sock):
+ os.unlink(mon_sock)
diff --git a/04-ring1-kernel-surgeon/training/configs/grpo_minicpm5_2b.yaml b/04-ring1-kernel-surgeon/training/configs/grpo_minicpm5_2b.yaml
new file mode 100644
index 0000000..bb735bf
--- /dev/null
+++ b/04-ring1-kernel-surgeon/training/configs/grpo_minicpm5_2b.yaml
@@ -0,0 +1,34 @@
+base_model_or_sft_ckpt: runs/sft-minicpm5-2b/merged
+base_model_fallback: models/minicpm5-2b-bf16
+cuda_visible_devices: "0,1"
+scenarios_file: dataset/scenarios_600.jsonl
+output_dir: runs/grpo-minicpm5-2b
+tensorboard_dir: runs/tb-logs/grpo-minicpm5-2b
+
+num_generations: 4
+max_prompt_length: 1024
+max_completion_length: 64
+bf16: true
+beta: 0.08
+temperature: 0.95
+top_p: 0.95
+
+lora:
+ r: 16
+ lora_alpha: 32
+ lora_dropout: 0.05
+ target_modules: ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]
+
+per_device_train_batch_size: 4
+gradient_accumulation_steps: 2
+learning_rate: 5.0e-6
+lr_scheduler_type: cosine
+warmup_steps: 4
+max_steps: 40
+logging_steps: 1
+save_steps: 20
+seed: 42
+
+kvm_verifier:
+ max_workers: 4
+ use_cache: true
diff --git a/04-ring1-kernel-surgeon/training/configs/sft_minicpm5_2b.yaml b/04-ring1-kernel-surgeon/training/configs/sft_minicpm5_2b.yaml
new file mode 100644
index 0000000..8072d3f
--- /dev/null
+++ b/04-ring1-kernel-surgeon/training/configs/sft_minicpm5_2b.yaml
@@ -0,0 +1,30 @@
+model_name_or_path: models/minicpm5-2b-bf16
+cuda_visible_devices: "0"
+train_file: runs/latest_dataset_600/sft_train.jsonl
+val_file: runs/latest_dataset_600/sft_val.jsonl
+output_dir: runs/sft-minicpm5-2b
+tensorboard_dir: runs/tb-logs/sft-minicpm5-2b
+
+max_seq_length: 1024
+max_completion_length: 64
+bf16: true
+gradient_checkpointing: true
+
+lora:
+ r: 16
+ lora_alpha: 32
+ lora_dropout: 0.05
+ target_modules: ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]
+
+num_train_epochs: 3
+per_device_train_batch_size: 2
+per_device_eval_batch_size: 4
+gradient_accumulation_steps: 8
+learning_rate: 2.0e-4
+lr_scheduler_type: cosine
+warmup_ratio: 0.08
+weight_decay: 0.01
+logging_steps: 2
+eval_steps: 15
+save_steps: 50
+seed: 42
diff --git a/04-ring1-kernel-surgeon/training/eval_model.py b/04-ring1-kernel-surgeon/training/eval_model.py
new file mode 100755
index 0000000..1faa741
--- /dev/null
+++ b/04-ring1-kernel-surgeon/training/eval_model.py
@@ -0,0 +1,143 @@
+#!/usr/bin/env python3
+from __future__ import annotations
+import argparse
+import json
+import os
+import sys
+import time
+from collections import Counter, defaultdict
+from dataclasses import asdict
+
+ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+sys.path.insert(0, ROOT_DIR)
+from dataset.scenarios import Scenario
+from verifier.kvm_verifier import KVMVerifier
+
+def main():
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--model-path", required=True)
+ ap.add_argument("--tag", required=True, help="base | sft | grpo")
+ ap.add_argument("--split", default="val", choices=["val", "test"])
+ ap.add_argument("--scenarios-file", default=os.path.join(ROOT_DIR, "dataset", "scenarios_600.jsonl"))
+ ap.add_argument("--out-json", required=True)
+ ap.add_argument("--batch-size", type=int, default=16)
+ ap.add_argument("--kvm-workers", type=int, default=8)
+ ap.add_argument("--gpu", default="0")
+ args = ap.parse_args()
+
+ os.environ["CUDA_VISIBLE_DEVICES"] = str(args.gpu)
+ import torch
+ from transformers import AutoModelForCausalLM, AutoTokenizer
+
+ all_sc = [Scenario(**json.loads(l)) for l in open(args.scenarios_file) if l.strip()]
+ scenarios = [s for s in all_sc if s.split == args.split]
+ print(f"[EVAL:{args.tag}] split={args.split} n={len(scenarios)} model={args.model_path}")
+
+ tok = AutoTokenizer.from_pretrained(args.model_path, trust_remote_code=True)
+ tok.padding_side = "left"
+ if tok.pad_token is None:
+ tok.pad_token = tok.eos_token
+
+ model = AutoModelForCausalLM.from_pretrained(
+ args.model_path,
+ torch_dtype=torch.bfloat16,
+ trust_remote_code=True,
+ device_map="cuda:0",
+ )
+ model.eval()
+
+ prompts = []
+ for s in scenarios:
+ msgs = [
+ {"role": "system", "content": "Ring -1 Kernel Surgeon. Output 3 lines only: DIAGNOSIS, ACTION, PATCH."},
+ {"role": "user", "content": s.render_prompt()},
+ ]
+ p_txt = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True, enable_thinking=False)
+ prompts.append(p_txt)
+
+ outputs = []
+ gen_lats_ms = []
+ t_gen0 = time.time()
+ for i in range(0, len(prompts), args.batch_size):
+ batch = prompts[i:i + args.batch_size]
+ enc = tok(batch, return_tensors="pt", padding=True, truncation=True, max_length=1024).to("cuda:0")
+ t_b = time.time()
+ with torch.no_grad():
+ gen = model.generate(
+ **enc,
+ max_new_tokens=64,
+ do_sample=False,
+ pad_token_id=tok.pad_token_id,
+ eos_token_id=tok.eos_token_id,
+ )
+ dt_b = (time.time() - t_b) * 1000.0
+ per_item = dt_b / len(batch)
+ in_len = enc["input_ids"].shape[1]
+ for row in gen:
+ txt = tok.decode(row[in_len:], skip_special_tokens=True).strip()
+ outputs.append(txt)
+ gen_lats_ms.append(per_item)
+ gen_total_s = time.time() - t_gen0
+
+ # Free GPU memory before KVM burst
+ del model
+ torch.cuda.empty_cache()
+
+ verifier = KVMVerifier(max_workers=args.kvm_workers)
+ t_v0 = time.time()
+ vresults = verifier.verify_batch(list(zip(scenarios, outputs)), use_cache=True)
+ v_dt = time.time() - t_v0
+
+ n = len(vresults)
+ passed = sum(1 for r in vresults if r.passed)
+ vm_ver = [r for r in vresults if r.vm_verified]
+ danger = sum(1 for r in vresults if r.dangerous_continue)
+ excess = sum(1 for r in vresults if r.excess_halt)
+ think_leaks = sum(1 for o in outputs if "<think>" in o.lower())
+ avg_rew = sum(r.reward for r in vresults) / n
+ conf = Counter(f"{r.expected_action}->{r.pred_action}" for r in vresults)
+
+ by_cat = defaultdict(lambda: {"n": 0, "pass": 0, "danger": 0})
+ for s, r in zip(scenarios, vresults):
+ by_cat[s.category]["n"] += 1
+ by_cat[s.category]["pass"] += int(r.passed)
+ by_cat[s.category]["danger"] += int(r.dangerous_continue)
+
+ gen_sorted = sorted(gen_lats_ms)
+ vm_lats = sorted(r.latency_ms for r in vm_ver) if vm_ver else [0.0]
+
+ report = {
+ "tag": args.tag,
+ "model_path": args.model_path,
+ "split": args.split,
+ "n": n,
+ "passed": passed,
+ "pass_at_1": round(passed / n, 4),
+ "avg_reward": round(avg_rew, 4),
+ "dangerous_continue_count": danger,
+ "dangerous_continue_rate": round(danger / n, 4),
+ "excess_halt_count": excess,
+ "excess_halt_rate": round(excess / n, 4),
+ "think_leaks": think_leaks,
+ "vm_verified_count": len(vm_ver),
+ "gpu_gen_p50_ms": round(gen_sorted[len(gen_sorted)//2], 1),
+ "gpu_gen_p95_ms": round(gen_sorted[int(0.95*(len(gen_sorted)-1))], 1),
+ "gpu_gen_total_s": round(gen_total_s, 2),
+ "kvm_verify_s": round(v_dt, 2),
+ "kvm_p95_ms": round(vm_lats[int(0.95*(len(vm_lats)-1))], 1),
+ "confusion": dict(conf),
+ "by_category": {k: dict(v) for k, v in by_cat.items()},
+ }
+
+ os.makedirs(os.path.dirname(args.out_json), exist_ok=True)
+ with open(args.out_json, "w") as f:
+ json.dump(report, f, indent=2)
+ with open(args.out_json.replace(".json", "_details.jsonl"), "w") as f:
+ for s, o, r in zip(scenarios, outputs, vresults):
+ f.write(json.dumps({"scenario_id": s.scenario_id, "category": s.category, "output": o, "verify": asdict(r)}) + "\n")
+
+ print(f"=== EVAL SUMMARY ({args.tag} / {args.split}) ===")
+ print(json.dumps(report, indent=2))
+
+if __name__ == "__main__":
+ main()
diff --git a/04-ring1-kernel-surgeon/training/grpo_minicpm5.py b/04-ring1-kernel-surgeon/training/grpo_minicpm5.py
new file mode 100755
index 0000000..65389ae
--- /dev/null
+++ b/04-ring1-kernel-surgeon/training/grpo_minicpm5.py
@@ -0,0 +1,185 @@
+#!/usr/bin/env python3
+from __future__ import annotations
+import argparse
+import json
+import os
+import sys
+import time
+from collections import Counter
+import yaml
+
+ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+sys.path.insert(0, ROOT_DIR)
+from dataset.scenarios import Scenario
+from verifier.kvm_verifier import KVMVerifier
+from training.tb_logger import SurgeonMetricsLogger
+
+def main():
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--config", default=os.path.join(ROOT_DIR, "training", "configs", "grpo_minicpm5_2b.yaml"))
+ ap.add_argument("--dry-run", action="store_true")
+ args = ap.parse_args()
+
+ cfg = yaml.safe_load(open(args.config))
+ if "CUDA_VISIBLE_DEVICES" not in os.environ:
+ os.environ["TENSORBOARD_LOGGING_DIR"] = cfg["tensorboard_dir"]
+ os.environ["CUDA_VISIBLE_DEVICES"] = str(cfg.get("cuda_visible_devices", "0,1"))
+
+ import torch
+ all_sc = [Scenario(**json.loads(l)) for l in open(cfg["scenarios_file"]) if l.strip()]
+ train_sc = [s for s in all_sc if s.split == "train"]
+ sc_by_id = {s.scenario_id: s for s in all_sc}
+
+ model_path = cfg["base_model_or_sft_ckpt"] if os.path.isdir(cfg["base_model_or_sft_ckpt"]) else cfg["base_model_fallback"]
+ local_rank = int(os.environ.get("LOCAL_RANK", "0"))
+
+ if args.dry_run:
+ print(json.dumps({
+ "cuda_visible_devices": os.environ["CUDA_VISIBLE_DEVICES"],
+ "visible_gpus": [torch.cuda.get_device_name(i) for i in range(torch.cuda.device_count())],
+ "model_path": model_path,
+ "train_scenarios": len(train_sc),
+ "max_steps": cfg["max_steps"],
+ "G": cfg["num_generations"],
+ }, indent=2))
+ return
+
+ from datasets import Dataset
+ from peft import LoraConfig
+ from transformers import AutoTokenizer
+ from trl import GRPOConfig, GRPOTrainer
+
+ t0 = time.time()
+ tok = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
+ tok.padding_side = "left"
+ if tok.pad_token is None:
+ tok.pad_token = tok.eos_token
+
+ run_id = f"grpo-{int(time.time())}"
+ os.makedirs(cfg["output_dir"], exist_ok=True)
+ events_jsonl = os.path.join(cfg["output_dir"], "dashboard_events.jsonl")
+ protocol_log = os.path.join(cfg["output_dir"], "verifier_protocol.jsonl")
+ logger = SurgeonMetricsLogger(cfg["tensorboard_dir"], events_jsonl, run_id) if local_rank == 0 else None
+ verifier = KVMVerifier(max_workers=cfg["kvm_verifier"]["max_workers"], protocol_log=protocol_log if local_rank == 0 else None)
+ step_counter = {"step": 0}
+ G = int(cfg["num_generations"])
+
+ def kvm_reward_func(completions, scenario_id, **kwargs):
+ t_r = time.time()
+ pairs = []
+ for comp, sid in zip(completions, scenario_id):
+ text = comp[0]["content"] if isinstance(comp, list) else str(comp)
+ pairs.append((sc_by_id[sid], text))
+
+ results = verifier.verify_batch(pairs, use_cache=cfg["kvm_verifier"]["use_cache"])
+ rewards = [r.reward for r in results]
+ dt = max(time.time() - t_r, 1e-3)
+
+ if logger is not None:
+ n = max(1, len(results))
+ n_groups = max(1, len(rewards) // G)
+ zero_var = sum(
+ 1 for g in range(n_groups)
+ if rewards[g*G:(g+1)*G] and (max(rewards[g*G:(g+1)*G]) - min(rewards[g*G:(g+1)*G]) < 1e-6)
+ )
+ acts = Counter(r.pred_action for r in results)
+ vm_r = [r for r in results if r.vm_verified]
+ lats = sorted(r.latency_ms for r in vm_r) if vm_r else [0.0]
+ p95 = lats[int(0.95 * (len(lats) - 1))]
+ step_counter["step"] += 1
+ logger.log_step(step_counter["step"], {
+ "panel1_reward/train_reward": sum(rewards) / n,
+ "panel1_reward/zero_variance_group_frac": zero_var / n_groups,
+ "panel2_validation/val_pass_at_1": sum(1 for r in results if r.passed) / n,
+ "panel2_validation/dangerous_continue_rate": sum(1 for r in results if r.dangerous_continue) / n,
+ "panel2_validation/excess_halt_rate": sum(1 for r in results if r.excess_halt) / n,
+ "panel3_policy/action_patch_frac": acts["PATCH_BYTES"] / n,
+ "panel3_policy/action_pass_frac": acts["PASS_TO_LINUX"] / n,
+ "panel3_policy/action_halt_frac": acts["HALT_FOR_DUMP"] / n,
+ "panel3_policy/truncated_frac": sum(1 for r in results if r.tier == "L1_REJECT") / n,
+ "panel4_verifier/p95_ms": p95,
+ "panel4_verifier/vm_pass_frac": (sum(1 for r in vm_r if r.passed) / len(vm_r)) if vm_r else 1.0,
+ "panel4_verifier/episodes_per_min": (len(results) / dt) * 60.0,
+ }, phase="grpo_train")
+ return rewards
+
+ # Pre-render non-thinking prompts via MiniCPM5 chat_template (enable_thinking=False!)
+ rows = []
+ for s in train_sc:
+ msgs = [
+ {"role": "system", "content": "Ring -1 Kernel Surgeon. Output 3 lines only: DIAGNOSIS, ACTION, PATCH."},
+ {"role": "user", "content": s.render_prompt()},
+ ]
+ prompt_str = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True, enable_thinking=False)
+ rows.append({"prompt": prompt_str, "scenario_id": s.scenario_id})
+
+ ds_train = Dataset.from_list(rows)
+
+ peft_cfg = LoraConfig(
+ r=cfg["lora"]["r"],
+ lora_alpha=cfg["lora"]["lora_alpha"],
+ lora_dropout=cfg["lora"]["lora_dropout"],
+ target_modules=cfg["lora"]["target_modules"],
+ bias="none",
+ task_type="CAUSAL_LM",
+ )
+
+ grpo_args = GRPOConfig(
+ output_dir=cfg["output_dir"],
+ # logging_dir set via TENSORBOARD_LOGGING_DIR env
+ report_to=["tensorboard"],
+ num_generations=G,
+
+ max_completion_length=cfg["max_completion_length"],
+ beta=cfg["beta"],
+ temperature=cfg["temperature"],
+ top_p=cfg["top_p"],
+ per_device_train_batch_size=cfg["per_device_train_batch_size"],
+ gradient_accumulation_steps=cfg["gradient_accumulation_steps"],
+ learning_rate=float(cfg["learning_rate"]),
+ lr_scheduler_type=cfg["lr_scheduler_type"],
+ warmup_steps=5,
+ max_steps=int(cfg["max_steps"]),
+ bf16=cfg["bf16"],
+ gradient_checkpointing=True,
+ logging_steps=cfg["logging_steps"],
+ save_steps=cfg["save_steps"],
+ seed=cfg["seed"],
+ ddp_find_unused_parameters=False,
+ )
+
+ trainer = GRPOTrainer(
+ model=model_path,
+ processing_class=tok,
+ reward_funcs=kvm_reward_func,
+ train_dataset=ds_train,
+ peft_config=peft_cfg,
+ args=grpo_args,
+ )
+ train_res = trainer.train()
+
+ if local_rank == 0:
+ lora_dir = os.path.join(cfg["output_dir"], "final_grpo_lora")
+ merged_dir = os.path.join(cfg["output_dir"], "merged")
+ trainer.save_model(lora_dir)
+ tok.save_pretrained(lora_dir)
+ print("[GRPO] Merging GRPO LoRA adapter into BF16 checkpoint...")
+ unwrapped = trainer.accelerator.unwrap_model(trainer.model)
+ merged = unwrapped.merge_and_unload()
+ merged.save_pretrained(merged_dir, safe_serialization=True)
+ tok.save_pretrained(merged_dir)
+ meta = {
+ "global_step": int(train_res.global_step),
+ "train_loss": float(train_res.training_loss),
+ "elapsed_s": round(time.time() - t0, 1),
+ "lora_dir": lora_dir,
+ "merged_dir": merged_dir,
+ }
+ with open(os.path.join(cfg["output_dir"], "grpo_summary.json"), "w") as f:
+ json.dump(meta, f, indent=2)
+ if logger:
+ logger.close()
+ print("[GRPO] DONE:", json.dumps(meta))
+
+if __name__ == "__main__":
+ main()
diff --git a/04-ring1-kernel-surgeon/training/log_pilot_to_tb.py b/04-ring1-kernel-surgeon/training/log_pilot_to_tb.py
new file mode 100755
index 0000000..36673a8
--- /dev/null
+++ b/04-ring1-kernel-surgeon/training/log_pilot_to_tb.py
@@ -0,0 +1,79 @@
+#!/usr/bin/env python3
+"""
+Populate real TensorBoard event files & dashboard_events.jsonl from a completed
+pilot run (sliding batches of 8 episodes) so TensorBoard (:6006) and Web Dashboard (:8780)
+immediately render all 4 monitoring panels with genuine KVM-verified data.
+"""
+from __future__ import annotations
+import argparse
+import json
+import os
+import sys
+from collections import Counter
+
+ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+sys.path.insert(0, ROOT_DIR)
+from training.tb_logger import SurgeonMetricsLogger
+
+def main():
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--pilot-dir", required=True)
+ ap.add_argument("--tb-dir", default=os.path.join(ROOT_DIR, "runs", "tb-logs", "pilot-deepseek-v4-pro"))
+ args = ap.parse_args()
+
+ raw_path = os.path.join(args.pilot_dir, "teacher_raw.jsonl")
+ rows = [json.loads(l) for l in open(raw_path) if l.strip()]
+ events_jsonl = os.path.join(args.pilot_dir, "dashboard_events.jsonl")
+ if os.path.exists(events_jsonl):
+ os.unlink(events_jsonl)
+
+ logger = SurgeonMetricsLogger(args.tb_dir, events_jsonl, run_id=os.path.basename(args.pilot_dir))
+
+ batch_size = 8
+ seen = []
+ for step_idx, start in enumerate(range(0, len(rows), batch_size), start=1):
+ chunk = rows[start:start + batch_size]
+ seen.extend(chunk)
+ v_chunk = [r["verify"] for r in chunk]
+ v_seen = [r["verify"] for r in seen]
+
+ n = len(v_chunk)
+ avg_rew = sum(v["reward"] for v in v_chunk) / n
+ # Group variance proxy across 4-item sub-blocks
+ zero_var = 0
+ groups = max(1, n // 4)
+ for g in range(groups):
+ gr = [v["reward"] for v in v_chunk[g*4:(g+1)*4]]
+ if gr and (max(gr) - min(gr) < 1e-6):
+ zero_var += 1
+
+ acts = Counter(v["pred_action"] for v in v_chunk)
+ vm_c = [v for v in v_chunk if v["vm_verified"]]
+ lats = sorted(v["latency_ms"] for v in vm_c) if vm_c else [0.0]
+ p95 = lats[int(0.95 * (len(lats) - 1))]
+
+ val_pass = sum(1 for v in v_seen if v["passed"]) / len(v_seen)
+ danger_rate = sum(1 for v in v_seen if v["dangerous_continue"]) / len(v_seen)
+ excess_rate = sum(1 for v in v_seen if v["excess_halt"]) / len(v_seen)
+
+ logger.log_step(step_idx, {
+ "panel1_reward/train_reward": avg_rew,
+ "panel1_reward/zero_variance_group_frac": zero_var / groups,
+ "panel2_validation/val_pass_at_1": val_pass,
+ "panel2_validation/dangerous_continue_rate": danger_rate,
+ "panel2_validation/excess_halt_rate": excess_rate,
+ "panel3_policy/action_patch_frac": acts["PATCH_BYTES"] / n,
+ "panel3_policy/action_pass_frac": acts["PASS_TO_LINUX"] / n,
+ "panel3_policy/action_halt_frac": acts["HALT_FOR_DUMP"] / n,
+ "panel3_policy/truncated_frac": sum(1 for v in v_chunk if v["tier"] == "L1_REJECT") / n,
+ "panel4_verifier/queue_depth": float(len(rows) - len(seen)),
+ "panel4_verifier/p95_ms": p95,
+ "panel4_verifier/vm_pass_frac": (sum(1 for v in vm_c if v["passed"]) / len(vm_c)) if vm_c else 1.0,
+ "panel4_verifier/episodes_per_min": (len(vm_c) / max(sum(lats) / 1000.0 / 4.0, 0.05)) * 60.0 if vm_c else 0.0,
+ }, phase="pilot_eval")
+
+ logger.close()
+ print(f"[TB] Logged {step_idx} steps -> {args.tb_dir} and {events_jsonl}")
+
+if __name__ == "__main__":
+ main()
diff --git a/04-ring1-kernel-surgeon/training/sft_minicpm5.py b/04-ring1-kernel-surgeon/training/sft_minicpm5.py
new file mode 100755
index 0000000..c82f73d
--- /dev/null
+++ b/04-ring1-kernel-surgeon/training/sft_minicpm5.py
@@ -0,0 +1,145 @@
+#!/usr/bin/env python3
+from __future__ import annotations
+import argparse
+import json
+import os
+import time
+import yaml
+
+ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+
+def load_jsonl(path: str):
+ with open(path) as f:
+ return [json.loads(line) for line in f if line.strip()]
+
+def main():
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--config", default=os.path.join(ROOT_DIR, "training", "configs", "sft_minicpm5_2b.yaml"))
+ ap.add_argument("--train-file", default=None)
+ ap.add_argument("--val-file", default=None)
+ ap.add_argument("--dry-run", action="store_true")
+ args = ap.parse_args()
+
+ cfg = yaml.safe_load(open(args.config))
+ os.environ["TENSORBOARD_LOGGING_DIR"] = cfg["tensorboard_dir"]
+ os.environ["CUDA_VISIBLE_DEVICES"] = str(cfg.get("cuda_visible_devices", "0"))
+ train_file = args.train_file or cfg["train_file"]
+ val_file = args.val_file or cfg["val_file"]
+
+ import torch
+ train_rows = load_jsonl(train_file) if os.path.exists(train_file) else []
+ val_rows = load_jsonl(val_file) if os.path.exists(val_file) else []
+ model_path = cfg["model_name_or_path"]
+ model_ready = os.path.isdir(model_path) and os.path.exists(os.path.join(model_path, "config.json"))
+ think_leaks = sum(1 for r in train_rows + val_rows if "<think>" in r["messages"][-1]["content"].lower())
+
+ print(json.dumps({
+ "mode": "dry_run" if args.dry_run else "train",
+ "cuda_visible_devices": os.environ["CUDA_VISIBLE_DEVICES"],
+ "torch_cuda_devices": torch.cuda.device_count(),
+ "model_path": model_path,
+ "model_ready": model_ready,
+ "train_samples": len(train_rows),
+ "val_samples": len(val_rows),
+ "think_leaks": think_leaks,
+ "output_dir": cfg["output_dir"],
+ "tensorboard_dir": cfg["tensorboard_dir"],
+ }, indent=2))
+ assert think_leaks == 0, f"Found {think_leaks} <think> leaks in SFT assistant targets!"
+
+ if args.dry_run:
+ return
+ if not model_ready:
+ raise SystemExit(f"Model not ready: {model_path}")
+
+ from datasets import Dataset
+ from peft import LoraConfig
+ from transformers import AutoModelForCausalLM, AutoTokenizer
+ from trl import SFTConfig, SFTTrainer
+
+ t0 = time.time()
+ tok = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
+ if tok.pad_token is None:
+ tok.pad_token = tok.eos_token
+
+ # Note: MiniCPM5 chat_template automatically inserts empty <think>\n\n</think>\n\n before non-thinking content
+ # matching generation with add_generation_prompt=True, enable_thinking=False!
+ def fmt_row(row):
+ return {"text": tok.apply_chat_template(row["messages"], tokenize=False, add_generation_prompt=False)}
+
+ ds_train = Dataset.from_list([fmt_row(r) for r in train_rows])
+ ds_val = Dataset.from_list([fmt_row(r) for r in val_rows])
+
+ model = AutoModelForCausalLM.from_pretrained(
+ model_path,
+ torch_dtype=torch.bfloat16,
+ trust_remote_code=True,
+ device_map="auto",
+ )
+ model.config.use_cache = False
+
+ peft_cfg = LoraConfig(
+ r=cfg["lora"]["r"],
+ lora_alpha=cfg["lora"]["lora_alpha"],
+ lora_dropout=cfg["lora"]["lora_dropout"],
+ target_modules=cfg["lora"]["target_modules"],
+ bias="none",
+ task_type="CAUSAL_LM",
+ )
+
+ sft_args = SFTConfig(
+ output_dir=cfg["output_dir"],
+ # logging_dir set via TENSORBOARD_LOGGING_DIR env
+ report_to=["tensorboard"],
+ num_train_epochs=cfg["num_train_epochs"],
+ per_device_train_batch_size=cfg["per_device_train_batch_size"],
+ per_device_eval_batch_size=cfg["per_device_eval_batch_size"],
+ gradient_accumulation_steps=cfg["gradient_accumulation_steps"],
+ learning_rate=float(cfg["learning_rate"]),
+ lr_scheduler_type=cfg["lr_scheduler_type"],
+ warmup_steps=5,
+ weight_decay=cfg["weight_decay"],
+ bf16=cfg["bf16"],
+ gradient_checkpointing=cfg["gradient_checkpointing"],
+ max_length=cfg["max_seq_length"],
+ logging_steps=cfg["logging_steps"],
+ eval_strategy="steps",
+ eval_steps=cfg["eval_steps"],
+ save_strategy="epoch",
+ seed=cfg["seed"],
+ dataset_text_field="text",
+ )
+
+ trainer = SFTTrainer(
+ model=model,
+ processing_class=tok,
+ train_dataset=ds_train,
+ eval_dataset=ds_val,
+ peft_config=peft_cfg,
+ args=sft_args,
+ )
+ train_res = trainer.train()
+
+ lora_dir = os.path.join(cfg["output_dir"], "final_lora")
+ merged_dir = os.path.join(cfg["output_dir"], "merged")
+ trainer.save_model(lora_dir)
+ tok.save_pretrained(lora_dir)
+
+ print("[SFT] Merging LoRA adapter into BF16 checkpoint for GRPO/GGUF...")
+ merged = trainer.model.merge_and_unload()
+ merged.save_pretrained(merged_dir, safe_serialization=True)
+ tok.save_pretrained(merged_dir)
+
+ meta = {
+ "train_loss": float(train_res.training_loss),
+ "global_step": int(train_res.global_step),
+ "elapsed_s": round(time.time() - t0, 1),
+ "lora_dir": lora_dir,
+ "merged_dir": merged_dir,
+ }
+ with open(os.path.join(cfg["output_dir"], "sft_summary.json"), "w") as f:
+ json.dump(meta, f, indent=2)
+ print("[SFT] DONE:", json.dumps(meta))
+
+if __name__ == "__main__":
+ main()
diff --git a/04-ring1-kernel-surgeon/training/tb_logger.py b/04-ring1-kernel-surgeon/training/tb_logger.py
new file mode 100644
index 0000000..e19b2b7
--- /dev/null
+++ b/04-ring1-kernel-surgeon/training/tb_logger.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python3
+"""
+Ring -1 Kernel Surgeon — Unified TensorBoard + Dashboard JSONL Logger
+Implements all 4 monitoring panels:
+ 1. panel1_reward : train_reward, zero_variance_group_frac
+ 2. panel2_validation : val_pass_at_1, dangerous_continue_rate, excess_halt_rate, baselines
+ 3. panel3_policy : token_entropy, action_patch/pass/halt_frac, truncated_frac
+ 4. panel4_verifier : queue_depth, p95_ms, vm_pass_frac, episodes_per_min
+"""
+from __future__ import annotations
+import json
+import os
+import time
+from typing import Dict, Optional
+from torch.utils.tensorboard import SummaryWriter
+
+class SurgeonMetricsLogger:
+ def __init__(self, tb_dir: str, events_jsonl: str, run_id: str):
+ os.makedirs(tb_dir, exist_ok=True)
+ os.makedirs(os.path.dirname(events_jsonl), exist_ok=True)
+ self.tb_dir = tb_dir
+ self.events_jsonl = events_jsonl
+ self.run_id = run_id
+ self.writer = SummaryWriter(log_dir=tb_dir)
+
+ def log_step(self, step: int, metrics: Dict[str, float], phase: str = "train"):
+ ts = time.time()
+ for k, v in metrics.items():
+ self.writer.add_scalar(k, float(v), step, walltime=ts)
+ self.writer.flush()
+ rec = {"run_id": self.run_id, "step": step, "phase": phase, "ts": ts, "metrics": metrics}
+ with open(self.events_jsonl, "a") as f:
+ f.write(json.dumps(rec) + "\n")
+
+ def close(self):
+ self.writer.close()
diff --git a/04-ring1-kernel-surgeon/verifier/kvm_verifier.py b/04-ring1-kernel-surgeon/verifier/kvm_verifier.py
new file mode 100755
index 0000000..462d7bd
--- /dev/null
+++ b/04-ring1-kernel-surgeon/verifier/kvm_verifier.py
@@ -0,0 +1,514 @@
+#!/usr/bin/env python3
+"""
+Ring -1 Kernel Surgeon — 3-Tier Single-Level KVM Verifier (NO savevm on AMD!)
+
+Tier L1: Strict output schema + zero <think> check + Capstone x86-64 static safety validator
+Tier L2: Safety & contract policy check (penalizes dangerous PATCH_BYTES on unsafe/irreversible states with -2.0)
+Tier L3: Real single-level QEMU/KVM Linux 5.15 guest executing candidate patch inside Ring 0 (surgeon_bench.ko)
+ and verifying canary buffer, lock depth, return/out contract, repeat call, boot_id, and uptime.
+
+Reward structure:
+ +1.0 : Correct action + all KVM postconditions passed (including right HALT_FOR_DUMP / PASS_TO_LINUX)
+ 0.0 : Safe over-cautious HALT_FOR_DUMP on a solvable case
+ -1.0 : Wrong safe action, schema error, or invalid/postcondition-failing patch on a patchable case
+ -2.0 : Dangerous PATCH_BYTES attempted on an unsafe/control case OR causes KVM crash/oops/hang
+"""
+from __future__ import annotations
+import concurrent.futures
+import hashlib
+import json
+import os
+import re
+import select
+import sqlite3
+import subprocess
+import sys
+import threading
+import time
+from dataclasses import dataclass, asdict
+from typing import Dict, List, Optional, Tuple
+
+from capstone import Cs, CS_ARCH_X86, CS_MODE_64
+
+ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+sys.path.insert(0, ROOT_DIR)
+from dataset.scenarios import Scenario, build_pilot_scenarios
+
+ENV_VERSION = "kvm_v1_linux515_bench1"
+VMLINUZ = os.environ.get("SURGEON_VMLINUZ", os.path.join(ROOT_DIR, "guest", "vmlinuz"))
+VERIFIER_INITRD = os.environ.get("SURGEON_VERIFIER_INITRD", os.path.join(ROOT_DIR, "build", "verifier-initramfs.cpio.gz"))
+
+_CS = Cs(CS_ARCH_X86, CS_MODE_64)
+
+FORBIDDEN_MNEMONICS = {
+ "jmp", "ljmp", "call", "lcall", "ret", "retf", "iret", "iretq", "iretd",
+ "int", "int3", "int1", "into", "syscall", "sysret", "sysenter", "sysexit",
+ "hlt", "cli", "sti", "in", "insb", "insw", "insd", "out", "outsb", "outsw", "outsd",
+ "rdmsr", "wrmsr", "lgdt", "lidt", "lldt", "ltr", "sgdt", "sidt",
+ "vmrun", "vmmcall", "vmload", "vmsave", "clgi", "stgi", "vmcall", "vmxon", "vmxoff",
+ "invlpg", "invd", "wbinvd", "ud2", "ud1", "ud0", "swapgs", "cr0", "cr3", "cr4",
+ "ja", "jae", "jb", "jbe", "jc", "je", "jg", "jge", "jl", "jle", "jna", "jnae",
+ "jnb", "jnbe", "jnc", "jne", "jng", "jnge", "jnl", "jnle", "jno", "jnp", "jns",
+ "jnz", "jo", "jp", "jpe", "jpo", "js", "jz", "jrcxz", "jecxz", "loop", "loope", "loopne",
+}
+
+@dataclass
+class ParsedOutput:
+ valid_schema: bool
+ has_think_leak: bool
+ diagnosis: str
+ action: str # PATCH_BYTES | PASS_TO_LINUX | HALT_FOR_DUMP | INVALID
+ patch_hex: str # normalized space-separated lowercase hex or "NONE"
+ error: str = ""
+
+@dataclass
+class VerifyResult:
+ scenario_id: str
+ family_id: str
+ split: str
+ expected_action: str
+ pred_action: str
+ pred_patch_hex: str
+ diagnosis: str
+ reward: float
+ passed: bool
+ vm_verified: bool
+ dangerous_continue: bool
+ excess_halt: bool
+ cached: bool
+ latency_ms: float
+ tier: str # L1_REJECT | L2_POLICY | L3_KVM_PASS | L3_KVM_FAIL | L3_KVM_CRASH
+ detail: str
+ boot_id: str = ""
+ uptime: str = ""
+ disasm_patch: str = ""
+
+def parse_student_output(text: str) -> ParsedOutput:
+ has_think = ("<think>" in text.lower() or "</think>" in text.lower())
+ clean = text.strip()
+ # Strip fenced markdown if accidentally wrapped
+ if clean.startswith("```"):
+ lines = [l for l in clean.splitlines() if not l.strip().startswith("```")]
+ clean = "\n".join(lines).strip()
+
+ diag_m = re.search(r"^DIAGNOSIS:\s*(.+)$", clean, re.MULTILINE)
+ act_m = re.search(r"^ACTION:\s*(PATCH_BYTES|PASS_TO_LINUX|HALT_FOR_DUMP)\b", clean, re.MULTILINE)
+ pat_m = re.search(r"^PATCH:\s*(.+)$", clean, re.MULTILINE)
+
+ if not (diag_m and act_m and pat_m):
+ return ParsedOutput(False, has_think, "", "INVALID", "NONE", "missing required DIAGNOSIS/ACTION/PATCH fields")
+
+ diag = diag_m.group(1).strip()
+ action = act_m.group(1).strip()
+ raw_patch = pat_m.group(1).strip()
+
+ if action == "PATCH_BYTES":
+ tokens = re.findall(r"(?:0x)?([0-9a-fA-F]{2})\b", raw_patch)
+ if not tokens:
+ return ParsedOutput(False, has_think, diag, action, "NONE", f"unparseable patch hex: {raw_patch!r}")
+ patch_hex = " ".join(t.lower() for t in tokens)
+ else:
+ patch_hex = "NONE"
+
+ if has_think:
+ return ParsedOutput(False, True, diag, action, patch_hex, "<think> tag leaked into student output")
+
+ return ParsedOutput(True, False, diag, action, patch_hex, "")
+
+def static_validate_patch(patch_hex: str, expected_len: int) -> Tuple[bool, str, str]:
+ raw = bytes.fromhex(patch_hex.replace(" ", ""))
+ if len(raw) != expected_len:
+ return False, f"patch_len={len(raw)} != fault_len={expected_len}", ""
+ if len(raw) == 0 or len(raw) > 15:
+ return False, f"patch_len out of range: {len(raw)}", ""
+
+ insns = list(_CS.disasm(raw, 0))
+ covered = sum(i.size for i in insns)
+ if covered != len(raw):
+ return False, f"invalid x86-64 instruction encoding (decoded {covered}/{len(raw)} bytes)", ""
+
+ disasm_parts = []
+ for ins in insns:
+ mnem = ins.mnemonic.lower()
+ op_s = ins.op_str.lower()
+ if mnem in FORBIDDEN_MNEMONICS:
+ return False, f"forbidden mnemonic in patch: {mnem}", ""
+ if any(r in op_s for r in ("cr0", "cr2", "cr3", "cr4", "cr8", "dr0", "dr7", "fs:", "gs:")):
+ return False, f"forbidden privileged operand: {mnem} {op_s}", ""
+ # Block arbitrary memory writes in Stage 2.1 patch space (only reg/nop ALU safe fixes allowed!)
+ if "[" in op_s:
+ return False, f"memory operand disallowed in safe patch: {mnem} {op_s}", ""
+ disasm_parts.append(f"{ins.mnemonic} {ins.op_str}".strip())
+
+ return True, "ok", "; ".join(disasm_parts)
+
+def run_single_level_kvm(cmd_line: str, timeout_s: float = 8.0) -> Tuple[bool, str, str, str]:
+ """
+ Spawn a fresh, isolated single-level QEMU/KVM Linux 5.15 guest (NO savevm on AMD!).
+ Returns: (vm_alive_and_pass, detail_line, boot_id, uptime)
+ """
+ qemu_cmd = [
+ "qemu-system-x86_64",
+ "-machine", "q35,accel=kvm",
+ "-cpu", "host",
+ "-smp", "1",
+ "-m", "512M",
+ "-nographic",
+ "-no-reboot",
+ "-kernel", VMLINUZ,
+ "-initrd", VERIFIER_INITRD,
+ "-append", "console=ttyS0,115200 nokaslr rodata=off quiet panic=-1 rdinit=/init",
+ ]
+ proc = subprocess.Popen(
+ qemu_cmd,
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ bufsize=0,
+ )
+ buf = bytearray()
+ boot_id_init = ""
+
+ def read_until(marker: bytes, start_pos: int, t_limit: float) -> bool:
+ deadline = time.time() + t_limit
+ while time.time() < deadline:
+ if proc.poll() is not None:
+ # drain remaining
+ try:
+ rest = os.read(proc.stdout.fileno(), 8192)
+ if rest: buf.extend(rest)
+ except Exception:
+ pass
+ return marker in buf[start_pos:]
+ r, _, _ = select.select([proc.stdout], [], [], 0.05)
+ if r:
+ ch = os.read(proc.stdout.fileno(), 4096)
+ if not ch:
+ break
+ buf.extend(ch)
+ if marker in buf[start_pos:]:
+ return True
+ return False
+
+ try:
+ if not read_until(b"VERIFIER_READY", 0, timeout_s):
+ return False, "kvm_boot_timeout", "", ""
+ # Wait for full VERIFIER_READY line (36-char UUID + uptime + newline)
+ end_hdr = time.time() + 1.0
+ while time.time() < end_hdr:
+ t0s = buf.decode(errors="replace")
+ if re.search(r"VERIFIER_READY boot_id=[0-9a-f-]{36}", t0s) and "uptime=" in t0s:
+ break
+ r, _, _ = select.select([proc.stdout], [], [], 0.02)
+ if r:
+ ch = os.read(proc.stdout.fileno(), 4096)
+ if ch: buf.extend(ch)
+
+ text0 = buf.decode(errors="replace")
+ m_bid = re.search(r"VERIFIER_READY boot_id=([0-9a-f-]{36})", text0)
+ boot_id_init = m_bid.group(1) if m_bid else ""
+
+ pos = len(buf)
+ proc.stdin.write((cmd_line + "\n").encode())
+ proc.stdin.flush()
+
+ got_res = read_until(b"BENCH_RESULT", pos, 4.0)
+ # give tiny drain for rest of line
+ time.sleep(0.05)
+ while select.select([proc.stdout], [], [], 0.02)[0]:
+ ch = os.read(proc.stdout.fileno(), 4096)
+ if not ch: break
+ buf.extend(ch)
+
+ tail = buf[pos:].decode(errors="replace")
+ if any(k in tail for k in ("Kernel panic", "Oops:", "general protection fault", "divide error:", "invalid opcode:")):
+ return False, "kvm_guest_crash_or_oops", boot_id_init, ""
+ if not got_res:
+ return False, "kvm_exec_timeout_or_hang", boot_id_init, ""
+
+ m_line = re.search(r"(BENCH_RESULT[^\r\n]+)", tail)
+ res_line = m_line.group(1).strip() if m_line else tail.strip()[:200]
+ m_bid2 = re.search(r"boot_id=([0-9a-f-]{36})", res_line)
+ m_up = re.search(r"uptime=([0-9.]+)", res_line)
+ bid2 = m_bid2.group(1) if m_bid2 else boot_id_init
+ up = m_up.group(1) if m_up else ""
+
+ boot_ok = (not boot_id_init) or (bid2 == boot_id_init)
+ passed = ("status=PASS" in res_line) and boot_ok
+
+ # Clean shutdown
+ try:
+ proc.stdin.write(b"QUIT\n")
+ proc.stdin.flush()
+ proc.wait(timeout=1.5)
+ except Exception:
+ pass
+
+ return passed, res_line, bid2, up
+ finally:
+ if proc.poll() is None:
+ proc.terminate()
+ try: proc.wait(timeout=1.5)
+ except Exception: proc.kill()
+
+
+class KVMVerifier:
+ def __init__(self, cache_path: Optional[str] = None, max_workers: int = 4, protocol_log: Optional[str] = None):
+ self.cache_path = cache_path or os.path.join(ROOT_DIR, "build", "verifier_cache.sqlite")
+ self.max_workers = max_workers
+ self.protocol_log = protocol_log
+ self._lock = threading.Lock()
+ self._active = 0
+ self._latencies: List[float] = []
+ self._init_cache()
+
+ def _init_cache(self):
+ os.makedirs(os.path.dirname(self.cache_path), exist_ok=True)
+ conn = sqlite3.connect(self.cache_path)
+ conn.execute("""
+ CREATE TABLE IF NOT EXISTS verify_cache (
+ cache_key TEXT PRIMARY KEY,
+ result_json TEXT NOT NULL,
+ created_at REAL NOT NULL
+ )
+ """)
+ conn.commit()
+ conn.close()
+
+ def _cache_get(self, key: str) -> Optional[dict]:
+ with self._lock:
+ conn = sqlite3.connect(self.cache_path)
+ row = conn.execute("SELECT result_json FROM verify_cache WHERE cache_key=?", (key,)).fetchone()
+ conn.close()
+ return json.loads(row[0]) if row else None
+
+ def _cache_put(self, key: str, data: dict):
+ with self._lock:
+ conn = sqlite3.connect(self.cache_path)
+ conn.execute(
+ "INSERT OR REPLACE INTO verify_cache(cache_key, result_json, created_at) VALUES (?, ?, ?)",
+ (key, json.dumps(data), time.time()),
+ )
+ conn.commit()
+ conn.close()
+
+ def _log_protocol(self, res: VerifyResult):
+ if not self.protocol_log:
+ return
+ with self._lock:
+ os.makedirs(os.path.dirname(self.protocol_log), exist_ok=True)
+ with open(self.protocol_log, "a") as f:
+ rec = asdict(res)
+ rec["ts"] = time.time()
+ f.write(json.dumps(rec) + "\n")
+
+ def verify_one(self, sc: Scenario, raw_output: str, use_cache: bool = True) -> VerifyResult:
+ t0 = time.time()
+ parsed = parse_student_output(raw_output)
+
+ if not parsed.valid_schema:
+ res = VerifyResult(
+ scenario_id=sc.scenario_id, family_id=sc.family_id, split=sc.split,
+ expected_action=sc.expected_action, pred_action=parsed.action,
+ pred_patch_hex=parsed.patch_hex, diagnosis=parsed.diagnosis,
+ reward=-1.0, passed=False, vm_verified=False,
+ dangerous_continue=False, excess_halt=False, cached=False,
+ latency_ms=(time.time() - t0) * 1000.0, tier="L1_REJECT",
+ detail=parsed.error,
+ )
+ self._log_protocol(res)
+ return res
+
+ # Deterministic cache key on (env_ver, scenario_id, action, patch_hex)
+ ckey = hashlib.sha256(
+ f"{ENV_VERSION}|{sc.scenario_id}|{parsed.action}|{parsed.patch_hex}".encode()
+ ).hexdigest()
+
+ if use_cache:
+ cached = self._cache_get(ckey)
+ if cached is not None:
+ cached["diagnosis"] = parsed.diagnosis
+ cached["cached"] = True
+ cached["latency_ms"] = (time.time() - t0) * 1000.0
+ res = VerifyResult(**cached)
+ self._log_protocol(res)
+ return res
+
+ # --- L2 Safety / Contract Policy ---
+ if parsed.action == "PATCH_BYTES":
+ # Dangerous continue on unsafe / halt / pass_to_linux control case!
+ if sc.expected_action != "PATCH_BYTES":
+ res = VerifyResult(
+ scenario_id=sc.scenario_id, family_id=sc.family_id, split=sc.split,
+ expected_action=sc.expected_action, pred_action=parsed.action,
+ pred_patch_hex=parsed.patch_hex, diagnosis=parsed.diagnosis,
+ reward=-2.0, passed=False, vm_verified=False,
+ dangerous_continue=True, excess_halt=False, cached=False,
+ latency_ms=(time.time() - t0) * 1000.0, tier="L2_POLICY",
+ detail=f"DANGEROUS: attempted PATCH_BYTES on {sc.expected_action} scenario ({sc.category})",
+ )
+ self._cache_put(ckey, asdict(res))
+ self._log_protocol(res)
+ return res
+
+ # Static Capstone safety validation
+ ok_static, static_msg, disasm_p = static_validate_patch(parsed.patch_hex, sc.fault_len)
+ if not ok_static:
+ res = VerifyResult(
+ scenario_id=sc.scenario_id, family_id=sc.family_id, split=sc.split,
+ expected_action=sc.expected_action, pred_action=parsed.action,
+ pred_patch_hex=parsed.patch_hex, diagnosis=parsed.diagnosis,
+ reward=-1.0, passed=False, vm_verified=False,
+ dangerous_continue=False, excess_halt=False, cached=False,
+ latency_ms=(time.time() - t0) * 1000.0, tier="L1_REJECT",
+ detail=f"static_reject: {static_msg}", disasm_patch=disasm_p,
+ )
+ self._cache_put(ckey, asdict(res))
+ self._log_protocol(res)
+ return res
+
+ # --- L3 Real Single-Level QEMU/KVM Execution ---
+ patch_compact = parsed.patch_hex.replace(" ", "")
+ kvm_cmd = f"exec {sc.stub_hex} {sc.patch_off} {sc.fault_len} {patch_compact} {sc.expect_out_hex} {sc.expect_ret_hex}"
+ with self._lock:
+ self._active += 1
+ try:
+ kvm_pass, kvm_detail, bid, up = run_single_level_kvm(kvm_cmd)
+ finally:
+ with self._lock:
+ self._active -= 1
+
+ crashed = ("crash" in kvm_detail or "timeout" in kvm_detail)
+ reward = 1.0 if kvm_pass else (-2.0 if crashed else -1.0)
+ tier = "L3_KVM_PASS" if kvm_pass else ("L3_KVM_CRASH" if crashed else "L3_KVM_FAIL")
+ res = VerifyResult(
+ scenario_id=sc.scenario_id, family_id=sc.family_id, split=sc.split,
+ expected_action=sc.expected_action, pred_action=parsed.action,
+ pred_patch_hex=parsed.patch_hex, diagnosis=parsed.diagnosis,
+ reward=reward, passed=kvm_pass, vm_verified=True,
+ dangerous_continue=crashed, excess_halt=False, cached=False,
+ latency_ms=(time.time() - t0) * 1000.0, tier=tier,
+ detail=kvm_detail, boot_id=bid, uptime=up, disasm_patch=disasm_p,
+ )
+
+ elif parsed.action == "PASS_TO_LINUX":
+ if sc.expected_action == "PASS_TO_LINUX":
+ if sc.kvm_mode in ("extable_test", "warn_test"):
+ kvm_pass, kvm_detail, bid, up = run_single_level_kvm(sc.kvm_mode)
+ res = VerifyResult(
+ scenario_id=sc.scenario_id, family_id=sc.family_id, split=sc.split,
+ expected_action=sc.expected_action, pred_action=parsed.action,
+ pred_patch_hex="NONE", diagnosis=parsed.diagnosis,
+ reward=1.0 if kvm_pass else -1.0, passed=kvm_pass, vm_verified=True,
+ dangerous_continue=False, excess_halt=False, cached=False,
+ latency_ms=(time.time() - t0) * 1000.0,
+ tier="L3_KVM_PASS" if kvm_pass else "L3_KVM_FAIL",
+ detail=kvm_detail, boot_id=bid, uptime=up,
+ )
+ else:
+ res = VerifyResult(
+ scenario_id=sc.scenario_id, family_id=sc.family_id, split=sc.split,
+ expected_action=sc.expected_action, pred_action=parsed.action,
+ pred_patch_hex="NONE", diagnosis=parsed.diagnosis,
+ reward=1.0, passed=True, vm_verified=False,
+ dangerous_continue=False, excess_halt=False, cached=False,
+ latency_ms=(time.time() - t0) * 1000.0, tier="L2_POLICY",
+ detail="CPL=3 / benign Linux exception correctly delegated to Linux",
+ )
+ else:
+ # Wrongly passing a fatal Ring 0 crash to Linux -> kernel panic!
+ res = VerifyResult(
+ scenario_id=sc.scenario_id, family_id=sc.family_id, split=sc.split,
+ expected_action=sc.expected_action, pred_action=parsed.action,
+ pred_patch_hex="NONE", diagnosis=parsed.diagnosis,
+ reward=-1.0, passed=False, vm_verified=False,
+ dangerous_continue=(sc.expected_action == "HALT_FOR_DUMP"),
+ excess_halt=False, cached=False,
+ latency_ms=(time.time() - t0) * 1000.0, tier="L2_POLICY",
+ detail=f"PASS_TO_LINUX wrong for {sc.expected_action} ({sc.category})",
+ )
+
+ else: # HALT_FOR_DUMP
+ if sc.expected_action == "HALT_FOR_DUMP":
+ res = VerifyResult(
+ scenario_id=sc.scenario_id, family_id=sc.family_id, split=sc.split,
+ expected_action=sc.expected_action, pred_action=parsed.action,
+ pred_patch_hex="NONE", diagnosis=parsed.diagnosis,
+ reward=1.0, passed=True, vm_verified=False,
+ dangerous_continue=False, excess_halt=False, cached=False,
+ latency_ms=(time.time() - t0) * 1000.0, tier="L2_POLICY",
+ detail=f"Correctly halted unsafe/ambiguous case ({sc.category})",
+ )
+ else:
+ # Over-cautious halt on solvable case -> reward 0.0
+ res = VerifyResult(
+ scenario_id=sc.scenario_id, family_id=sc.family_id, split=sc.split,
+ expected_action=sc.expected_action, pred_action=parsed.action,
+ pred_patch_hex="NONE", diagnosis=parsed.diagnosis,
+ reward=0.0, passed=False, vm_verified=False,
+ dangerous_continue=False, excess_halt=True, cached=False,
+ latency_ms=(time.time() - t0) * 1000.0, tier="L2_POLICY",
+ detail=f"Excess halt on solvable {sc.expected_action} scenario",
+ )
+
+ self._cache_put(ckey, asdict(res))
+ self._log_protocol(res)
+ return res
+
+ def verify_batch(self, pairs: List[Tuple[Scenario, str]], use_cache: bool = True) -> List[VerifyResult]:
+ with concurrent.futures.ThreadPoolExecutor(max_workers=self.max_workers) as ex:
+ futs = [ex.submit(self.verify_one, sc, out, use_cache) for sc, out in pairs]
+ return [f.result() for f in futs]
+
+
+def run_selftest():
+ scenarios = build_pilot_scenarios()
+ v = KVMVerifier(max_workers=4)
+ print(f"[SELFTEST] Verifying all {len(scenarios)} golden reference answers in parallel KVM (4 workers, no cache)...")
+ t0 = time.time()
+ pairs = []
+ for sc in scenarios:
+ ans = (
+ f"DIAGNOSIS: Reference check for {sc.category}.\n"
+ f"ACTION: {sc.expected_action}\n"
+ f"PATCH: {sc.ref_patch_hex}"
+ )
+ pairs.append((sc, ans))
+ results = v.verify_batch(pairs, use_cache=False)
+ dt = time.time() - t0
+
+ passed = sum(1 for r in results if r.passed and r.reward == 1.0)
+ vm_ran = [r for r in results if r.vm_verified]
+ lats = sorted(r.latency_ms for r in vm_ran)
+ p95 = lats[int(0.95 * (len(lats) - 1))] if lats else 0.0
+ epm = (len(vm_ran) / dt) * 60.0 if dt > 0 else 0.0
+
+ for r in results:
+ if not r.passed:
+ print(f" [FAIL] {r.scenario_id}: tier={r.tier} reward={r.reward} detail={r.detail}")
+
+ print(f"[SELFTEST] Golden pass: {passed}/{len(scenarios)} | VM-verified: {len(vm_ran)} | elapsed={dt:.2f}s | p95={p95:.0f}ms | {epm:.1f} VM-ep/min")
+ assert passed == len(scenarios), f"Expected {len(scenarios)}/{len(scenarios)} golden passes!"
+
+ # Negative / adversarial verifier checks (must catch bad patches & dangerous continues!)
+ sc_de = next(s for s in scenarios if s.scenario_id == "de_div_ecx_v1")
+ r_bad_nop = v.verify_one(sc_de, "DIAGNOSIS: bad nop.\nACTION: PATCH_BYTES\nPATCH: 90 90", use_cache=False)
+ assert not r_bad_nop.passed and r_bad_nop.reward == -1.0, f"Blind NOP on #DE should fail! got {r_bad_nop}"
+
+ sc_halt = next(s for s in scenarios if s.scenario_id == "ctrl_halt_pf_lock_held")
+ r_danger = v.verify_one(sc_halt, f"DIAGNOSIS: unsafe patch.\nACTION: PATCH_BYTES\nPATCH: {90 *11}".strip(), use_cache=False)
+ assert r_danger.dangerous_continue and r_danger.reward == -2.0, f"Dangerous continue should get -2.0! got {r_danger}"
+
+ r_excess = v.verify_one(sc_de, "DIAGNOSIS: cautious halt.\nACTION: HALT_FOR_DUMP\nPATCH: NONE", use_cache=False)
+ assert r_excess.excess_halt and r_excess.reward == 0.0, f"Excess halt should get 0.0! got {r_excess}"
+
+ r_priv = v.verify_one(sc_de, "DIAGNOSIS: bad cli.\nACTION: PATCH_BYTES\nPATCH: fa f4", use_cache=False)
+ assert r_priv.tier == "L1_REJECT" and r_priv.reward == -1.0, f"Privileged opcode should be rejected! got {r_priv}"
+
+ print("[SELFTEST] Adversarial checks PASS (blind-NOP=-1.0, dangerous-patch=-2.0, excess-halt=0.0, priv-opcode=L1_REJECT)!")
+
+if __name__ == "__main__":
+ if "--selftest" in sys.argv:
+ run_selftest()
+ else:
+ print("Usage: kvm_verifier.py --selftest")
diff --git a/README.md b/README.md
index aef47dc..5dbc023 100644
--- a/README.md
+++ b/README.md
@@ -5,13 +5,14 @@ Zero C, zero C++, zero Rust, zero libc, zero libm, zero runtime dependencies.
Assembled directly with `nasm` and linked with `ld`. Every math kernel (`expf`, `sincosf`, `RMSNorm`, `RoPE`, `SiLU`, `Softmax`), AVX2+FMA+F16C GEMM/GEMV engine, BPE tokenizer, `clone()`/`futex()` thread pool, bare-metal SMP kernel, analytical backward pass, AdamW optimizer, and live Unicode Braille TUI is hand-written x86-64 assembly (`17,252` lines total across all three projects).
-## The Trilogy
+## The Projects
| Project | Binary | Size | Deps | Key Numbers |
|---|---|---:|---:|---|
-| **[01-qwen3-inference/](01-qwen3-inference/)** | `build/asm-llm` | **14,712 B** *(14,008 B `FAST_Q8=0`)* | **0** | Static Linux ELF running `Qwen/Qwen3-0.6B` (Q8_0, built-in BPE tokenizer, GQA + QK-Norm + RoPE + SwiGLU, single-shot & `--chat` multi-turn KV-cache REPL). **`FAST_Q8=1` (default):** **126.8 tok/s** decode at 40T (**20.7 tok/s** at 1T), **+18% to +36% faster than `llama.cpp` CPU (`Q8_0`) across 1..40T**, **`0.99965`** cosine & **64/64** exact greedy tokens vs PyTorch FP32. |
-| **[02-baremetal-os/](02-baremetal-os/)** | `build/asm-llm-os.elf` | **24,252 B** *(23,612 B `FAST_Q8=0`)* | **0** | Bootable bare-metal `Qwen3-0.6B` OS with no Linux or Windows. Multiboot 1 -> Long Mode -> AVX2/FMA/F16C -> ACPI/APIC SMP -> VGA + PS/2 + COM1 multi-turn KV-cache chat (`/clear`, `/think`, `/bench`). **74–94 ms** boot, **134.9 tok/s** KVM EPYC (**23.7 tok/s** 1 vCPU, **136.6 tok/s** peak), **55.4 tok/s** live on Proxmox Xeon E5-2670 v3 with **0 GB** disk. |
-| **[03-minigpt-train/](03-minigpt-train/)** | `build/asm-gpt-train` | **32,944 B** | **0** | From-scratch FP32 Mini-GPT trainer and sampler. Register-blocked `6x16` AVX2+FMA SGEMM, full analytical backward pass (**`1.0000000000`** cosine across all 21 gradient tensors vs PyTorch CPU), decoupled AdamW, **27,662 train tok/s**, live 80x24 Braille TUI, `val_loss 4.19 -> 1.51` on TinyShakespeare in 4 min. |
+| **[01-qwen3-inference/](01-qwen3-inference/)** | `build/asm-llm` | **14,712 B** *(14,008 B `FAST_Q8=0`)* | **0** | Pure x86-64 NASM static Linux ELF running `Qwen/Qwen3-0.6B` (Q8_0, built-in BPE tokenizer, GQA + QK-Norm + RoPE + SwiGLU, single-shot & `--chat` multi-turn KV-cache REPL). **`FAST_Q8=1` (default):** **126.8 tok/s** decode at 40T (**20.7 tok/s** at 1T), **+18% to +36% faster than `llama.cpp` CPU (`Q8_0`) across 1..40T**, **`0.99965`** cosine & **64/64** exact greedy tokens vs PyTorch FP32. |
+| **[02-baremetal-os/](02-baremetal-os/)** | `build/asm-llm-os.elf` | **24,252 B** *(23,612 B `FAST_Q8=0`)* | **0** | Pure x86-64 NASM bootable bare-metal `Qwen3-0.6B` OS with no Linux or Windows. Multiboot 1 -> Long Mode -> AVX2/FMA/F16C -> ACPI/APIC SMP -> VGA + PS/2 + COM1 multi-turn KV-cache chat (`/clear`, `/think`, `/bench`). **74–94 ms** boot, **134.9 tok/s** KVM EPYC (**23.7 tok/s** 1 vCPU, **136.6 tok/s** peak), **55.4 tok/s** live on Proxmox Xeon E5-2670 v3 with **0 GB** disk. |
+| **[03-minigpt-train/](03-minigpt-train/)** | `build/asm-gpt-train` | **32,944 B** | **0** | Pure x86-64 NASM FP32 Mini-GPT trainer and sampler. Register-blocked `6x16` AVX2+FMA SGEMM, full analytical backward pass (**`1.0000000000`** cosine across all 21 gradient tensors vs PyTorch CPU), decoupled AdamW, **27,662 train tok/s**, live 80x24 Braille TUI, `val_loss 4.19 -> 1.51` on TinyShakespeare in 4 min. |
+| **[04-ring1-kernel-surgeon/](04-ring1-kernel-surgeon/)** | `04-ring1-kernel-surgeon/build/surgeon.elf` | **75,424 B** | **0** *(freestanding NASM + zero-libc C)* | Bare-metal Type-1 AMD SVM hypervisor (`Ring -1`) running beneath unmodified Linux `5.15` (`Ring 0`) with an embedded **MiniCPM5-2B `Q4_K_M`** engine across 24 LAPIC SMP cores, NPT memory isolation, live `efifb` HUD, static x86-64 patch validator, and single-level KVM verifier RL. **97.54% pass@1** (`119/122` unseen test scenarios, `0%` dangerous continues) vs **16.39%** base. |
---
@@ -121,6 +122,16 @@ make train
Full training, live Braille TUI, checkpoint chat loop, and PyTorch gradient check guide: **[03-minigpt-train/README.md](03-minigpt-train/README.md)**.
+### 4. Live-Patch Linux Ring 0 Crashes from Ring `-1` (`04-ring1-kernel-surgeon/`)
+
+```bash
+cd 04-ring1-kernel-surgeon
+make hv # Build 75 KB freestanding Ring -1 AMD SVM hypervisor (surgeon.elf)
+python3 verifier/kvm_verifier.py --selftest
+```
+
+Full architecture, QEMU nested-SVM + VNC demo, SFT/GRPO training, and KVM verifier guide: **[04-ring1-kernel-surgeon/README.md](04-ring1-kernel-surgeon/README.md)**.
+
---
## Repository Layout
@@ -162,6 +173,17 @@ llm.asm/
│ ├── model.asm # Arena layout, deterministic init, full fwd/bwd pass, sampler
│ ├── tui.asm # ioctl(TCGETS) TTY detect + flicker-free 80x24 ANSI/Braille TUI
│ └── main.asm # CLI, auto char-vocab, 90/10 split, .gptckpt I/O, train/sample loop
+├── 04-ring1-kernel-surgeon/ # Phase 4: Ring -1 AMD SVM hypervisor + MiniCPM5-2B live kernel patcher
+│ ├── README.md
+│ ├── ARCHITECTURE.md # Physical memory map, NPT isolation, SVM intercepts
+│ ├── Makefile # Builds surgeon.elf, surgeon_crash.ko, initramfs, UEFI ISO
+│ ├── hv/ # Bare-metal Ring -1 hypervisor (NASM + freestanding zero-libc C)
+│ ├── guest/ # Ring 0 fault-injection test module (crash_mod) & KVM verifier module (bench_mod)
+│ ├── dataset/ # 48-pilot & 600-scenario corpus + DeepSeek distillation script
+│ ├── verifier/ # 3-tier single-level QEMU/KVM + Capstone safety verifier
+│ ├── training/ # MiniCPM5-2B LoRA SFT, KVM-verified GRPO, eval, TensorBoard logger
+│ ├── dashboard/ # Live FastAPI training & verifier telemetry dashboard
+│ └── scripts/ # Initramfs/ISO builders, QEMU/VNC demos, GGUF/.r1m packers
└── scripts/
├── export_weights.py # Offline HuggingFace Qwen3-0.6B -> .asmbin (Q8_0) converter
├── mkiso.sh # Bootable BIOS+UEFI hybrid GRUB Multiboot 1 ISO builder
@@ -194,11 +216,13 @@ Every phase is built on the same engineering rules: no runtime libraries, determ
- **Phase 1 verification:** All math/SIMD kernels pass unit tests within `1e-7..1e-6` (`init_rope_freqs` FP64 `< 5e-14`) for both `FAST_Q8=1` and `FAST_Q8=0` across v1 FP32 and v2 FP16 scale formats. `FAST_Q8=1` matches PyTorch FP32 `Qwen3-0.6B` with `cosine = 0.9996517` and **64/64 exact greedy tokens** (`FAST_Q8=0` matches the Python Q8_0 reference with `cosine = 1.000000000`). Bit-exact deterministic from `1T` to `40T`.
- **Phase 2 verification:** **100% token-exact and byte-for-byte identical** to Phase 1 across 5 test prompts (English, Russian UTF-8, arithmetic, `--think` mode), multi-turn KV-cache recall + `/clear`, and across `1..32` KVM vCPUs (`134.9 tok/s` at 16 vCPUs). Verified on both QEMU KVM (AMD EPYC 7642) and a real Proxmox VE VM (Intel Xeon E5-2670 v3, 0 GB disk, BIOS GRUB ISO).
- **Phase 3 verification:** Verified against PyTorch FP32 CPU on all **21 parameter tensors** (`worst max_abs_diff = 3.35e-8`, `min cosine_sim = 1.0000000000`), 10-step AdamW + cosine LR + grad-clip trajectory (`max_loss_diff = 4.77e-7`), and bit-exact determinism across `1T`, `8T`, and `16T`.
+- **Phase 4 verification (`04-ring1-kernel-surgeon/`):** MiniCPM5-2B GRPO achieves **`97.54%` pass@1 (`119/122`)** on unseen held-out fault scenarios (`16.39%` base) with **`0%` dangerous continues** under the 3-tier QEMU/KVM verifier, and runs end-to-end inside Ring `-1` (`75 KB` `surgeon.elf`, 24 LAPIC SMP cores, 2 GiB read-only NVDIMM unmapped in AMD NPT) to live-patch `#PF`/`#DE`/`#UD`, delegate `extable`, and freeze `lock_held` faults.
See each project's README for full tables, memory layouts, and reproduction steps:
- [01-qwen3-inference/README.md](01-qwen3-inference/README.md)
- [02-baremetal-os/README.md](02-baremetal-os/README.md)
- [03-minigpt-train/README.md](03-minigpt-train/README.md)
+- [04-ring1-kernel-surgeon/README.md](04-ring1-kernel-surgeon/README.md)
---