[PR #9] [MERGED] Headless USB media; read-only cold pre-check before driver release #116

Closed
opened 2026-10-31 07:01:51 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/windows-GPU-UNLOCK/Windows-GPU-UNLOCK/pull/9
Author: @pavel-shpilev
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @impacifist

Base: main ← Head: feat/headless-usb-cold-precheck


📝 Commits (3)

  • 322dabe Headless USB media; read-only cold pre-check before driver release
  • 8515eea Merge current main before hardening PR 9 cold pre-check
  • 80a9ef3 Validate decoding and BAR resources before cold-state MMIO

📊 Changes

12 files changed (+504 additions, -11 deletions)

View changed files

📝 CHANGES.md (+31 -0)
➕ docs/HEADLESS-USB.en.md (+86 -0)
📝 internal-boot/boot/full-release.c (+69 -9)
📝 internal-boot/boot/full-release.h (+1 -0)
📝 internal-boot/boot/handoff.c (+33 -0)
➕ internal-boot/boot/test-cold-precheck.ps1 (+23 -0)
➕ internal-boot/boot/test_cold_precheck.c (+158 -0)
📝 internal-boot/unlock/app_io.c (+2 -2)
📝 internal-boot/unlock/build.ps1 (+3 -0)
📝 internal-boot/unlock/tests/test_headless.c (+13 -0)
➕ research/headless/build-usb.ps1 (+52 -0)
➕ research/headless/stage-usb.ps1 (+33 -0)

📄 Description

Lets the headless wrapper/child run from an ordinary FAT32 USB stick, and makes that stick safe to leave as a default boot device. Independent of #8.

What changes

  • GU_USB_MEDIA (internal-boot/unlock/build.ps1 -UsbMedia, new research/headless/build-usb.ps1): instead of pinning an internal ESP GUID, wrapper (handoff.c Prepare) and child (app_io.c UsbPath) accept only the USB device they were loaded from. The Windows ESP GUID, the child SHA256 contract and every exact-profile check are unchanged. No partition is created or retyped and no boot entry is registered. research/headless/stage-usb.ps1 copies the package and the five local assets with hash verification and keeps any previous BOOTX64.EFI.
  • Read-only cold pre-check before any driver release (all full-unlock builds): after the Esc window, GuPeekCold reads the nine cold-state registers of the exact RTX at 0000:01:00.0 through the PciIo its firmware driver still owns. The acceptance rules are the same as Cold(), now shared as ColdRead. A non-cold GPU (restart without platform reset, already unlocked, initialized WPR2, wrong memory size) takes the existing skip path to Windows. Before this, that state was only caught by VerifyCold after release: black screen, then stop. VerifyCold itself is unchanged.
  • Fallback to firmware BootOrder (USB builds only): a failure before driver release returns EFI_NOT_STARTED, so the firmware continues with the next option (normally Windows Boot Manager). Failures after release still stop without reset or retry.

Tests (no fixtures needed)

  • internal-boot/boot/test-cold-precheck.ps1 -HardwareProfile <p>: 31 GuPeekCold cases, passing for both b650m-3090fe and b660m-3070ti.
    • Accepted: cold state for any SS1 0..15.
    • Refused: WPR2 up, SS0 0x88888888, 0xbadf.... or running GFW; other memory, chip, subsystem or slot; two targets; no device; read failure.
    • Zero MMIO writes in every case. The 39 full-flow gate tests also run.
  • test_headless.c with -DGU_USB_MEDIA: USB volume accepted; a USB build loaded from an internal partition refuses before any hardware effect.
  • Build: build-usb.ps1 produces packages for b650m-3090fe and b660m-3070ti. handoff.c/full-release.c compile in the headless-internal, automatic-AMD and full-manual configurations.

Hardware

Gigabyte X870 AORUS ELITE WIFI7 + ASUS RTX 3090 Ti (GA102), using a profile from a follow-up PR:

  • First USB run (before this pre-check existed): one clean transaction; BF16 81.0 → 150.2 TFLOPS.
  • With this exact wrapper: two boots, one from a full shutdown and one from a Windows restart. Both passed the pre-check as cold, unlocked cleanly (FINAL status=0 … clean=1, SS0=88888888 SS1=8, one FLR) and started Windows. BF16 measured 150.2 TFLOPS after the restart boot.
  • On this board a Windows restart fully resets the GPU (WPR2 down; entry SS0/SS1 read 0/0). So the pre-check's skip branch and the BootOrder fallback have only run in host tests, not on hardware.
  • Entry selectors differ per power-on (0x40123070/7, 0x40123070/3, 0x44123070/7, 0/0), which entryLatchedSs1Full handles as designed.

Docs: docs/HEADLESS-USB.en.md, CHANGES.md. Korean docs not updated.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/windows-GPU-UNLOCK/Windows-GPU-UNLOCK/pull/9 **Author:** [@pavel-shpilev](https://github.com/pavel-shpilev) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@impacifist](https://github.com/impacifist) **Base:** `main` ← **Head:** `feat/headless-usb-cold-precheck` --- ### 📝 Commits (3) - [`322dabe`](https://github.com/windows-GPU-UNLOCK/Windows-GPU-UNLOCK/commit/322dabe59c6762fb03ca372df39c8645578873a7) Headless USB media; read-only cold pre-check before driver release - [`8515eea`](https://github.com/windows-GPU-UNLOCK/Windows-GPU-UNLOCK/commit/8515eeae738026be00ce4a10d1b7ebaa1bdf8a0b) Merge current main before hardening PR 9 cold pre-check - [`80a9ef3`](https://github.com/windows-GPU-UNLOCK/Windows-GPU-UNLOCK/commit/80a9ef3bbfdcaa125d24f89cba2e5f3f26e79d2f) Validate decoding and BAR resources before cold-state MMIO ### 📊 Changes **12 files changed** (+504 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `CHANGES.md` (+31 -0) ➕ `docs/HEADLESS-USB.en.md` (+86 -0) 📝 `internal-boot/boot/full-release.c` (+69 -9) 📝 `internal-boot/boot/full-release.h` (+1 -0) 📝 `internal-boot/boot/handoff.c` (+33 -0) ➕ `internal-boot/boot/test-cold-precheck.ps1` (+23 -0) ➕ `internal-boot/boot/test_cold_precheck.c` (+158 -0) 📝 `internal-boot/unlock/app_io.c` (+2 -2) 📝 `internal-boot/unlock/build.ps1` (+3 -0) 📝 `internal-boot/unlock/tests/test_headless.c` (+13 -0) ➕ `research/headless/build-usb.ps1` (+52 -0) ➕ `research/headless/stage-usb.ps1` (+33 -0) </details> ### 📄 Description Lets the headless wrapper/child run from an ordinary FAT32 USB stick, and makes that stick safe to leave as a default boot device. Independent of #8. ### What changes - **`GU_USB_MEDIA`** (`internal-boot/unlock/build.ps1 -UsbMedia`, new `research/headless/build-usb.ps1`): instead of pinning an internal ESP GUID, wrapper (`handoff.c` `Prepare`) and child (`app_io.c` `UsbPath`) accept only the **USB** device they were loaded from. The Windows ESP GUID, the child SHA256 contract and every exact-profile check are unchanged. No partition is created or retyped and no boot entry is registered. `research/headless/stage-usb.ps1` copies the package and the five local assets with hash verification and keeps any previous `BOOTX64.EFI`. - **Read-only cold pre-check before any driver release** (all full-unlock builds): after the Esc window, `GuPeekCold` reads the nine cold-state registers of the exact RTX at `0000:01:00.0` through the PciIo its firmware driver still owns. The acceptance rules are the same as `Cold()`, now shared as `ColdRead`. A non-cold GPU (restart without platform reset, already unlocked, initialized WPR2, wrong memory size) takes the existing skip path to Windows. Before this, that state was only caught by `VerifyCold` *after* release: black screen, then stop. `VerifyCold` itself is unchanged. - **Fallback to firmware BootOrder** (USB builds only): a failure before driver release returns `EFI_NOT_STARTED`, so the firmware continues with the next option (normally Windows Boot Manager). Failures after release still stop without reset or retry. ### Tests (no fixtures needed) - `internal-boot/boot/test-cold-precheck.ps1 -HardwareProfile <p>`: 31 `GuPeekCold` cases, passing for both `b650m-3090fe` and `b660m-3070ti`. - Accepted: cold state for any SS1 0..15. - Refused: WPR2 up, SS0 `0x88888888`, `0xbadf....` or running GFW; other memory, chip, subsystem or slot; two targets; no device; read failure. - Zero MMIO writes in every case. The 39 full-flow gate tests also run. - `test_headless.c` with `-DGU_USB_MEDIA`: USB volume accepted; a USB build loaded from an internal partition refuses before any hardware effect. - Build: `build-usb.ps1` produces packages for `b650m-3090fe` and `b660m-3070ti`. `handoff.c`/`full-release.c` compile in the headless-internal, automatic-AMD and full-manual configurations. ### Hardware Gigabyte X870 AORUS ELITE WIFI7 + ASUS RTX 3090 Ti (GA102), using a profile from a follow-up PR: - **First USB run (before this pre-check existed):** one clean transaction; BF16 81.0 → 150.2 TFLOPS. - **With this exact wrapper:** two boots, one from a full shutdown and one from a Windows restart. Both passed the pre-check as cold, unlocked cleanly (`FINAL status=0 … clean=1`, `SS0=88888888 SS1=8`, one FLR) and started Windows. BF16 measured 150.2 TFLOPS after the restart boot. - On this board a Windows restart fully resets the GPU (WPR2 down; entry SS0/SS1 read `0/0`). So the pre-check's **skip branch and the BootOrder fallback have only run in host tests**, not on hardware. - Entry selectors differ per power-on (`0x40123070/7`, `0x40123070/3`, `0x44123070/7`, `0/0`), which `entryLatchedSs1Full` handles as designed. Docs: `docs/HEADLESS-USB.en.md`, `CHANGES.md`. Korean docs not updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 07:01:51 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
windows-GPU-UNLOCK/Windows-GPU-UNLOCK#116
No description provided.