v2.1.12-rc5(pre-release)——交接盲区观测三件套:\tx-agitate-only 全搅动零写对照、\tx-ebs-watch EBS 包装观测、CHAIN-BOUNDARY 链载边界落盘
这是 pre-release;Latest 仍为 v2.1.11。 资产:BOOTX64.EFI.2.1.12-rc5(TX 构建事务版)、BOOTX64.EFI.readonly.2.1.12-rc5(只读负控版,同样携带本版全部观测器)、nv-uefi-unlocker-v2.1.12-rc5.zip(不含 ssdiag——杀软误报隔离政策,ssdiag 一律单独下载)、ssdiag-x86_64-windows-0.8.5.exe(独立资产,与 rc4 相同未变)。校验和以 SHA256SUMS.2.1.12-rc5 为准。rc4 的全部修复与行为(\tx-no-flr.txt、stop-on-failure、BME 释放定序等)全部继承,不带 marker 的 rc5 与 rc4 行为一致(除下述 CHAIN-BOUNDARY 日志行)。
背景:为什么是这三件
软锁家族(#242 Lenovo AD104M / #278 BIOSTAR TU106 / #279 MSI X399 AD104)签名一致:事务读回全绿、零写轮能引导、事务轮在交接阶段软挂。外部交叉评审(Claude + ChatGPT 两份独立分析)点破两个结构性缺口,本版直接补上:
- 对照组混杂:此前所有"零写"对照(readonly、abort、
\tx-dry-run.txt)都跳过了整个手术流程(GOP 断连、独占 claim、COMMAND 写、DMA 分配、桥 BME、GOP 重建、reconnect)——"零写活/事务死"分不开"解锁态有毒"还是"loader 的 UEFI 手术伤"。补上全搅动零写对照后才真正二选一。 - 观测盲区:rc4 在
LoadImage之前就 close 日志——LoadImage 返回状态与 StartImage 进入记录从未落盘;EBS 是否被调用、是否返回、MapKey 是否被弄脏,从未被运行时观测过(此前只有静态逆向)。
1. \tx-agitate-only.txt:全手术、零 GPU 写的负控对照
卷根放一个零字节 marker 即激活(代替该卡的事务)。跑的与真事务完全同序同量:PM preflight → detach(GOP 断连+mirror mute)→ EXCLUSIVE claim + COMMAND IO|MEM|BME → 布局寄存器只读 → 五个 DMA 缓冲 + radix 块同尺寸分配 → 桥 BME + DMA 路径日志 → HANDOFF-PCI dump → native-GOP 重建(默认路径,tx-reconnect-legacy.txt/tu10x-no-reconnect.txt 等价生效)→ restore_vga → mirror unmute → DMA 全释放 + 桥 BME 恢复 → HANDOFF-OUT 读回。
零写契约:BAR0 一个字节都不写(无 falcon reset / FWSEC / booter / 选择器 / canary / FLR——错误路径也不做应急 FLR,否则契约自毁);config space 手术照跑(那正是手术的一部分)。只读读回照常(读不是写)。
判读:此 marker 下仍挂死 → 解锁写入不是必要条件,嫌疑转向 loader 的 UEFI 手术本身(跨三台主板的公共因子);干净引导 → 解锁留下的活态 GPU 状态成为剩余主嫌,与 EBS-watch 的读数合流定位。
2. \tx-ebs-watch.txt:ExitBootServices 包装观测(+事件组检查点)
安装点在链载之前(也覆盖 readonly 构建与 \tx-exit-fw.txt 路径)。机理:就地 patch gBS->ExitBootServices 与 gBS->GetMemoryMap(保留原指针、重算表头 CRC32),再注册 BeforeEBS/EBS 两个事件组回调,形成四个观测点:
ENTER wrapper 进调用(OS loader/GRUB 调了 EBS;带 MapKey+GetMemoryMap 计数)
BEFORE BeforeEBS 通知组命中(扇出第一阶段;boot services 仍活)
NOTIFY EBS 通知组命中(扇出中点;内存图已终结——此回调零分配零文件零控制台)
RETURN 真 CoreExitBootServices 返回(ok=表已清零/服务已死;err=服务仍活,loader 会重试)
读出通道(按挂死后可回收性排序):\ebs-watch.log(每行 write+Flush+Close+reopen 提交,预算限次)→ 帧缓冲三行色块(蓝=BEFORE / 黄=NOTIFY / 绿=RETURN-ok,纯线性写,post-EBS 仍合法)→ POST 0x80 码(0xC0 install / 0xC1 BEFORE / 0xC2 NOTIFY / 0xD0 RETURN-ok / 0xD1 RETURN-err / 0xE0|n=第 n 次 ENTER)→ 0xE9 debugcon + UART 0x3F8(115200 8N1,无口机器无害)。蓝行修正(开发者台面实测发现,见下):至少一台 AMI 固件(Z170 代)根本不发 BeforeEBS 事件组——蓝行可缺失且非诊断信号;黄/绿不受影响。
自扰预算(评审修正点):EBS 窗口内的任何文件写都可能分配从而 stale 调用方的 MapKey——观测器自己可能制造最多一次 INVALID_PARAMETER 重试(enter 行+before 行同属第一次调用,n≥2 的 enter 行被预算封死;错误返回行在"loader 会重读内存图"之后,安全)。所以:日志里出现一次 EBS-RETURN status=0x8000000000000002 后接成功重试 = 我们自己的记账写入;反复出现才是"内存图被残余事件持续弄脏"的真签名(Claude 假说的直接判据)。台面实测中预算内自扰一次也没发生(edk2 的 pool 按类型持页,小分配不动内存图)。
读数判读表:无 ENTER=EBS 从未被调用(挂点在 bootmgr/winload 早期);ENTER 无 NOTIFY=挂进扇出第一阶段/timer-kill/TerminateMemoryMap(AMI 上 BEFORE 检查点缺位,此段合并);NOTIFY 无 RETURN=挂进扇出后半(MemoryProtection/中断关停);RETURN ok=扇出无嫌疑,嫌疑后移到 OS loader 后续阶段。挂死机器断电后 \ebs-watch.log + 屏幕色块照片即为完整证据。
3. \tx-ebs-selftest.txt:不引导 OS 的仪器自检(自动携带 ebs-watch)
链载点改为 loader 自己调 GetMemoryMap+ExitBootServices(最多 3 次、每次新 MapKey,loader 形状的舞步),成功即停机(此后只有裸通道活着;断电收尾)。失败则记日志继续正常链载。用于任何机器——包括 QEMU/OVMF——在不动 Windows 的情况下验证仪器全链。OVMF 实测序列(本版发版证据,docs/evidence/ebswatch-qemu-smoke/):attempt1 = ENTER→BEFORE→INVALID_PARAMETER(预算内的记账写入自扰)→ attempt2 = ENTER→NOTIFY→RETURN ok→PARKING。QEMU 首轮还抓出并修复了仪器自身两处 bug(reopen 自删已写内容、gmm 缓冲在取 key 后释放导致 key 过期)——后者恰是该仪器要抓的 bug 类,自证有效。
4. CHAIN-BOUNDARY:链载边界行落盘(无 marker,随版生效)
\ebs-watch.log 之外的普通改进:rc4 的 logging::finish() 跑在 LoadImage 之前——LoadImage 的返回状态与 StartImage 进入记录从未进过持久日志(#279 只能看到最后一条 CHAIN: LoadImage)。现在:LoadImage 失败/成功状态、StartImage enter 边界行先落盘再关日志(Close=即便 Flush 是 no-op 的固件也提交 dirent)。此后挂死机器的 loader.log 最后一条是"StartImage enter"(控制权已交出)而不是更早的含糊行。
开发者台面实测通过(2070 + Z170 + QTJ1,GSP 模式)
rc5 在开发者健康台面(RTX 2070 TU106 1f07 + Z170 AMI 固件 + QTJ1 魔改 CPU)轮 1 实机通过:armed 正常事务全绿(FWSEC WPR2 3ms、选择器 0x88888888/0x8 读回、canary intact、HANDOFF-OUT tu10x:unlock=true)→ 正常进 Windows → 系统内解锁正常。\tx-ebs-watch.txt 同轮验证:健康基线 = 单次 EBS-ENTER n=1 → 黄(NOTIFY)→ 绿(RETURN ok),零 INVALID_PARAMETER——这就是"交接不挂"的机器该有的形态,报告者日志逐 checkpoint 对表用。真机发现两条:①该 AMI 固件不发 BeforeEBS 事件组(蓝行缺失≠诊断,见上);②预算内自扰真机未发生。证据:docs/evidence/ebswatch-bench-tu106/。
配套更新
- sim:
FakeGpu新增主机写台账(含被 PLM 静默丢弃的尝试写);t_agitate_only_zero_write_control/t_agitate_only_alloc_fail_unwinds_no_writes场景(零写契约+失败路径不写不 FLR);sim/src/ebswatch_gate.rs文本级镜像(写预算+CRC-32,CRC-32 标准校验向量 0xCBF43926 钉死)。全部 149+ 新场景绿。 \tx-no-flr.txt判读更新:#242 报告者八臂 no-FLR 后仍挂死 + 风扇时序重读(GRUB 阶段即拉满=GPU 态异常的后果而非 EC bug)——该 marker 维持诊断定位,不推为默认。- ssdiag 0.8.5(独立附件,不入 zip;sha256
db64a2dfcf69a9c11858c6daad91ba7db752e1fe34ceafa15d63503fad31c350;与 rc4 完全相同未重建)。谱系备忘(ssdiag 版本号历史上有分支漂移,0.8.5 为正集):0.8.5 = tpc 面语义勘误(STATUS 位置 1 = TPC 被熔断,五 die SM 数核算定谳);0.8.4 = ex-L2_DEF_SCAN面按 #237 五轮破案改名FBPA_TRIM(DEF 猎场退回 OBJFUSE +0x248);0.8.3 起 = 0.8.2 的 VBS secure-PCI tier-2 门三连(0x1EA / SDEV+VBS / 注册表缺失 fail-closed,#244)+ RTD3 策略行 + #237 拆解面全量(0.7.9 起)+ LTS_L2SLICE 平面 BAR0 修正 + per-FBP L2 packing 恒等式 + IFF_RECORD 0x820050 行域解码与 MAGIC_D_BITS 双位(ga100-ff-tools 交叉面)+ 毒值 bit6 修复。py twin(tools/diag-unlock.py)全量同步。
版本下限提醒
\tx-agitate-only.txt、\tx-ebs-watch.txt、\tx-ebs-selftest.txt、CHAIN-BOUNDARY 行均只进 v2.1.12-rc5;请勿用 rc4 或更早版本复测这些行为。rc4 的 \tx-no-flr.txt / stop-on-failure 在 rc5 继承,语义不变。
English: what changed since v2.1.12-rc4
Assets: BOOTX64.EFI.2.1.12-rc5 (TX transaction build), BOOTX64.EFI.readonly.2.1.12-rc5 (read-only negative control — carries the same observers), nv-uefi-unlocker-v2.1.12-rc5.zip (no ssdiag inside — antivirus false-positive isolation policy, always download ssdiag separately), ssdiag-x86_64-windows-0.8.5.exe (standalone, byte-identical to rc4). Checksums: SHA256SUMS.2.1.12-rc5. Everything rc4 shipped carries forward (\tx-no-flr.txt, stop-on-failure, the BME release ordering); rc5 without markers behaves identically to rc4 (except the CHAIN-BOUNDARY log lines below).
Why these three: the soft-lock family (#242 Lenovo AD104M / #278 BIOSTAR TU106 / #279 MSI X399 AD104) shares one signature — transaction readbacks fully green, zero-write rounds boot, transaction rounds freeze in the handoff. Two independent external reviews (Claude + ChatGPT) pointed out two structural gaps, both closed here:
- Control-group confound: every "zero-write" control so far (readonly / abort /
\tx-dry-run.txt) skipped the ENTIRE surgical flow — GOP disconnect, exclusive claim, COMMAND writes, DMA allocations, bridge BME, GOP rebuild, reconnect — so "zero-write boots / transaction freezes" could not separate "the unlocked GPU state poisons the handoff" from "the loader's UEFI surgery poisons it". The full-surgery zero-write control is what makes that a real either/or. - Observation blind spot: rc4 closed the log BEFORE
LoadImage— LoadImage's return status and the StartImage-enter record never reached the durable log; and whether ExitBootServices is entered at all, whether it returns, and whether the MapKey is being dirtied were never observed at runtime (only reconstructed statically).
1. \tx-agitate-only.txt — the full-surgery ZERO-GPU-write negative control
One zero-byte marker on the stick root (replaces the transaction for that card). Runs the transaction's exact stages in the exact order: PM preflight → detach (GOP disconnect + mirror mute) → EXCLUSIVE claim + COMMAND IO|MEM|BME → read-only layout-register reads → the five DMA buffers + the radix block at the same sizes → bridge BME + DMA-path logs → HANDOFF-PCI dump → native-GOP rebuild (default path; tx-reconnect-legacy.txt / tu10x-no-reconnect.txt honored as usual) → restore_vga → mirror unmute → full DMA release + bridge BME restore → HANDOFF-OUT readback.
Zero-write contract: not one byte written to BAR0 — no falcon reset, no FWSEC, no booter, no selectors, no canary, no FLR (and NO emergency FLR on the error path either, which would violate the control's own contract); config-space surgery still runs — that IS the surgery. Read-only readbacks continue as usual (reads are not writes).
Reading: a freeze under this marker means the unlock writes are not the necessary condition and the suspect shifts to the loader's UEFI surgery itself (the one factor common to all three unrelated boards); a clean boot leaves the live unlocked GPU state as the remaining suspect, to be merged with the EBS-watch readings.
2. \tx-ebs-watch.txt — ExitBootServices observation (+ event-group checkpoints)
Installed before the chain (also covers the readonly build and the \tx-exit-fw.txt path). Mechanism: gBS->ExitBootServices and gBS->GetMemoryMap are patched in place (originals kept, the table header CRC32 recomputed) and the BeforeEBS / EBS event groups are armed — four checkpoints:
ENTER wrapper entered (the OS loader / GRUB called EBS; carries MapKey + GetMemoryMap counters)
BEFORE BeforeEBS group hit (fanout stage 1; boot services still alive)
NOTIFY EBS group hit (mid-fanout; memory map TERMINATED — this callback does zero allocation, zero file, zero console)
RETURN the real CoreExitBootServices returned (ok = table zeroed / services dead; err = services still alive, the caller retries)
Readout channels (ordered by post-hang recoverability): \ebs-watch.log on the stick (every line committed via write+Flush+Close+reopen, budgeted) → three framebuffer color rows (blue=BEFORE / yellow=NOTIFY / green=RETURN-ok — raw linear writes, legal after EBS) → POST 0x80 codes (0xC0 install / 0xC1 BEFORE / 0xC2 NOTIFY / 0xD0 RETURN-ok / 0xD1 RETURN-err / 0xE0|n = n-th ENTER) → debugcon 0xE9 + UART 0x3F8 (115200 8N1, harmless where absent). Blue-row correction (found on the developer bench, see below): at least one AMI firmware (Z170 generation) does not emit the BeforeEBS event group at all — the blue row can be absent on a fully healthy boot and is not diagnostic; yellow/green are unaffected.
Self-perturbation budget (the reviews' correction, honored): any file write inside the EBS window may allocate and stale the caller's MapKey — the watcher itself can manufacture at most one INVALID_PARAMETER retry (the enter line and the before line both belong to the first call; enter lines for n≥2 are budgeted out; error-return lines are safe because the caller re-reads the map after them). So: one EBS-RETURN status=0x8000000000000002 followed by a successful retry = our own bookkeeping write; repeated occurrences are the real "memory map kept dirty by residual events" signature (the direct test of the cross-review hypothesis). On the bench the budgeted perturbation never occurred (edk2 pools keep one page per type — small allocations do not change the memory map).
Reading table: no ENTER = EBS never called (hang is in early bootmgr/winload); ENTER without NOTIFY = hang in fanout stage 1 / timer-kill / TerminateMemoryMap (on AMI the BEFORE checkpoint is absent, so this range merges); NOTIFY without RETURN = hang in the late fanout (MemoryProtection / interrupt shutdown); RETURN ok = the fanout is exonerated, move downstream. A hung machine, powered off, leaves \ebs-watch.log + a photo of the color rows as complete evidence.
3. \tx-ebs-selftest.txt — instrument self-test without booting an OS (implies ebs-watch)
The chain point becomes the loader calling GetMemoryMap + ExitBootServices ITSELF (up to 3 attempts, a fresh MapKey each — the loader-shaped dance); on success it PARKS (only the raw channels stay alive; end the session with a power cycle). On failure it logs and continues into the normal chain. Works on any machine — including QEMU/OVMF — to validate the whole instrument without touching Windows. OVMF capture (release evidence, docs/evidence/ebswatch-qemu-smoke/): attempt1 = ENTER→BEFORE→INVALID_PARAMETER (the budgeted bookkeeping-write self-perturbation) → attempt2 = ENTER→NOTIFY→RETURN ok→PARKING. The first QEMU round also caught and fixed two instrument bugs pre-release (the commit chain's reopen self-deleting the committed content; the gmm descriptor buffer freed between GetMemoryMap and ExitBootServices staling the key — exactly the bug class the instrument exists to expose; self-validating).
4. CHAIN-BOUNDARY — chain-boundary lines reach the durable log (no marker, ships active)
A plain improvement beyond \ebs-watch.log: rc4's logging::finish() ran BEFORE LoadImage — LoadImage's return status and the StartImage-enter record never reached the persistent log (#279's last line was the ambiguous CHAIN: LoadImage). Now the LoadImage failure/success status and the StartImage enter boundary line are written to the file BEFORE the log closes (Close commits the dirent even on firmware where Flush is a no-op). A frozen machine's loader.log now ends at "StartImage enter" (control handed away) instead of an ambiguous earlier line.
Developer bench validation (2070 + Z170 + QTJ1, GSP mode)
rc5 passed round 1 on the developer's healthy bench (RTX 2070 TU106 1f07 + Z170 AMI firmware + QTJ1 modded CPU, GSP-mode driver stack): the armed transaction came back fully green (FWSEC WPR2 up in 3 ms, selectors 0x88888888/0x8 read back, canary intact, HANDOFF-OUT tu10x:unlock=true) → clean Windows boot → in-OS unlock intact. \tx-ebs-watch.txt was validated on the same boot: the healthy-pass baseline = a single EBS-ENTER n=1 → yellow (NOTIFY) → green (RETURN ok), zero INVALID_PARAMETER — the shape a machine that hands off cleanly produces; reporter logs can now be compared against it checkpoint by checkpoint. Two real-firmware findings: (1) this AMI build does not emit the BeforeEBS event group (blue-row absence ≠ diagnostic, see above); (2) the budgeted self-perturbation never occurred on real firmware. Evidence: docs/evidence/ebswatch-bench-tu106/.
Companion updates:
- sim:
FakeGpugained a host-write ledger (records even PLM-dropped attempt writes); new scenariost_agitate_only_zero_write_control/t_agitate_only_alloc_fail_unwinds_no_writes(zero-write contract; the failure path writes nothing and FLRs nothing);sim/src/ebswatch_gate.rsis a textually-identical mirror of the write budget + CRC-32 (standard check vector 0xCBF43926 pinned). Full suite green. \tx-no-flr.txtverdict update: #242's reporter still froze after the eight-arm no-FLR matrix, and the fan-timing re-read (fans ramp already at the GRUB stage = a consequence of the abnormal GPU state, not an EC bug) — the marker stays a diagnostic, not a default.- ssdiag 0.8.5 (standalone, not in the zip; sha256
db64a2dfcf69a9c11858c6daad91ba7db752e1fe34ceafa15d63503fad31c350; byte-identical to rc4, not rebuilt). Lineage memo (ssdiag versioning drifted across dev branches in the past — 0.8.5 is the superset): 0.8.5 = tpc-face semantics fix (a set STATUS bit = TPC fused OFF, verified by SM-count arithmetic on five dies); 0.8.4 = the ex-L2_DEF_SCANface renamedFBPA_TRIMper the five-round #237 hunt (DEF hunting grounds retired to OBJFUSE +0x248); 0.8.3 onward carries the 0.8.2 VBS secure-PCI tier-2 gate trilogy (0x1EA ECAM refusal / SDEV+VBS trigger / fail-closed on missing registry values, #244) + the RTD3 policy line + the full #237 disassembly surface (since 0.7.9) + the LTS_L2SLICE flat-BAR0 fix + the per-FBP L2 packing identity + IFF_RECORD 0x820050 row-field decoding and the MAGIC_D_BITS dual bits (ga100-ff-tools cross-reference) + the poison-value bit6 fix. The python twin (tools/diag-unlock.py) is fully synced.
Version floor: \tx-agitate-only.txt, \tx-ebs-watch.txt, \tx-ebs-selftest.txt and the CHAIN-BOUNDARY lines exist only in v2.1.12-rc5 and later; do not re-test them on rc4 or older. The rc4 markers (\tx-no-flr.txt / stop-on-failure) carry forward with unchanged semantics.