[PR #48] [CLOSED] Probe: capture a card on a non-01 PCI bus; record the PciIo attribute cache #129

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

📋 Pull Request Information

Original PR: https://github.com/windows-GPU-UNLOCK/Windows-GPU-UNLOCK/pull/48
Author: @morovinger
Created: 10/26/2026
Status: ❌ Closed

Base: main ← Head: feat/probe-bus-attributes


📝 Commits (1)

  • f08d07d Probe: capture a card on a non-01 PCI bus; record the PciIo attribute cache

📊 Changes

10 files changed (+131 additions, -8 deletions)

View changed files

📝 CHANGES.md (+16 -0)
📝 benchmark/run-benchmark.ps1 (+6 -3)
📝 docs/NEW-MACHINE.en.md (+5 -1)
📝 internal-boot/boot/probe.c (+17 -1)
📝 internal-boot/boot/test-diagnostic.ps1 (+11 -0)
📝 internal-boot/boot/test_probe_generic.c (+17 -1)
📝 research/profile/build-probe.ps1 (+3 -1)
📝 research/profile/make-profile.py (+14 -0)
📝 research/profile/test_make_profile.py (+10 -0)
📝 research/profile/test_probe_records.py (+32 -1)

📄 Description

Read-only probe changes only: no reviewed profile, release path or unlock code is touched. Split out of a larger local port (MSI B550M + RTX 3090, no iGPU, card on bus 0x2b) so the safe part can be reviewed on its own; the release-path part follows in a separate PR with hardware evidence.

Why

  • Bus. ProbeUnchanged hard-codes bus 1 for the deep read. Many AM4/B550 boards put the CPU x16 slot on another bus (here 0000:2b:00.0; issue #7 reports 0000:2d:00.0 on MSI X570), so the probe can only inventory the card there. See #12, #16, #25, #31, #38, #43.
  • PciIo attributes. full-release.c CapturePermit requires the PciIo attribute cache to equal the raw IO/MEM command bits with no bus mastering. Nothing captures that value today, so a mismatch is first seen at boot, after the console was already detached (black screen, release stops). #7 / #23 report firmware where the two disagree (0x300 attributes with raw IO clear).

Changes

  • GU_PROBE_BUS in probe.c, set by research/profile/build-probe.ps1 -TargetBus (default 1). A non-default value is an #error outside GU_DIAGNOSTIC_ONLY. With the default the deep-read check is unchanged.
  • The checked probe calls io->Attributes(io, EfiPciIoAttributeOperationGet, 0, &value) once, after the PROM allocation and before the final ProbeUnchanged recheck (the rule in the file that every protocol call precedes the recheck), and logs pci-attributes status=0x... value=0x... after the MMIO batch. A missing method is logged as EFI_UNSUPPORTED, not invented.
  • make-profile.py requires exactly one attribute record with status 0 whose IO/MEM/BME bits equal the command register's, otherwise it refuses. Captures from an older probe are refused with a "capture again" message.
  • benchmark/run-benchmark.ps1 -PciBus (default 01) instead of the hard-coded ^0+:01:00\.0$.

Tests (host)

  • test-diagnostic.ps1: every existing probe suite passes; the generic probe suite also runs built with -DGU_PROBE_BUS=0x2bU; a non-default bus is rejected in a non-diagnostic compile. The attributes mock fails on any operation other than Get with a zero mask, and the success path checks the exact log line.
  • test_probe_records.py: synthetic cases for a missing, failed, duplicated or mismatching record, plus accepted values (no capture files needed). test_make_profile.py: four refusal cases on real captures.
  • test-cold-precheck.ps1 (b650m-3090fe, h610m-3060), test-evidence.ps1, benchmark/test-runner.ps1, profile and headless Python suites: pass.

Hardware (read-only)

The bus 0x2b probe built from this branch is byte-identical to the one booted on the machine below (BOOTX64.EFI SHA-256 9ed139491442e871975905bae7fe625585f6a6de60a4c8d570c40b5dfd197106, 21504 bytes). Two cold boots, both complete (capture-complete=1, diagnostic-result status=0), then Windows started:

probe-target seg=0x0000 bus=0x002b dev=0x0000 fun=0x0000
pci-attributes status=0x0000000000000000 value=0x0000000000000300   (command 0x0003: IO|MEM, BME 0)

MSI B550M PRO-VDH WIFI (BIOS 2.O1, AMI), Ryzen 7 5700X (no iGPU), MSI RTX 3090 10de:2204 / 1462:3881. No PROM, driver images or partition identifiers are included.

Notes for review

  • #44 edits the same ProbeUnchanged lines (it latches the discovered BDF for its AD104 path); the conflict is small and either change can be rebased onto the other.
  • Requiring the attribute record makes existing local captures stale on purpose: a profile made without it can still stop mid-release.

🤖 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/48 **Author:** [@morovinger](https://github.com/morovinger) **Created:** 10/26/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/probe-bus-attributes` --- ### 📝 Commits (1) - [`f08d07d`](https://github.com/windows-GPU-UNLOCK/Windows-GPU-UNLOCK/commit/f08d07de4341f2f4681fc032ece0ccd28ff390fb) Probe: capture a card on a non-01 PCI bus; record the PciIo attribute cache ### 📊 Changes **10 files changed** (+131 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `CHANGES.md` (+16 -0) 📝 `benchmark/run-benchmark.ps1` (+6 -3) 📝 `docs/NEW-MACHINE.en.md` (+5 -1) 📝 `internal-boot/boot/probe.c` (+17 -1) 📝 `internal-boot/boot/test-diagnostic.ps1` (+11 -0) 📝 `internal-boot/boot/test_probe_generic.c` (+17 -1) 📝 `research/profile/build-probe.ps1` (+3 -1) 📝 `research/profile/make-profile.py` (+14 -0) 📝 `research/profile/test_make_profile.py` (+10 -0) 📝 `research/profile/test_probe_records.py` (+32 -1) </details> ### 📄 Description Read-only probe changes only: no reviewed profile, release path or unlock code is touched. Split out of a larger local port (MSI B550M + RTX 3090, no iGPU, card on bus `0x2b`) so the safe part can be reviewed on its own; the release-path part follows in a separate PR with hardware evidence. ### Why - **Bus.** `ProbeUnchanged` hard-codes bus `1` for the deep read. Many AM4/B550 boards put the CPU x16 slot on another bus (here `0000:2b:00.0`; issue #7 reports `0000:2d:00.0` on MSI X570), so the probe can only inventory the card there. See #12, #16, #25, #31, #38, #43. - **PciIo attributes.** `full-release.c` `CapturePermit` requires the PciIo attribute cache to equal the raw IO/MEM command bits with no bus mastering. Nothing captures that value today, so a mismatch is first seen at boot, after the console was already detached (black screen, release stops). #7 / #23 report firmware where the two disagree (`0x300` attributes with raw IO clear). ### Changes - `GU_PROBE_BUS` in `probe.c`, set by `research/profile/build-probe.ps1 -TargetBus` (default 1). A non-default value is an `#error` outside `GU_DIAGNOSTIC_ONLY`. With the default the deep-read check is unchanged. - The checked probe calls `io->Attributes(io, EfiPciIoAttributeOperationGet, 0, &value)` once, after the PROM allocation and before the final `ProbeUnchanged` recheck (the rule in the file that every protocol call precedes the recheck), and logs `pci-attributes status=0x... value=0x...` after the MMIO batch. A missing method is logged as `EFI_UNSUPPORTED`, not invented. - `make-profile.py` requires exactly one attribute record with status 0 whose IO/MEM/BME bits equal the command register's, otherwise it refuses. Captures from an older probe are refused with a "capture again" message. - `benchmark/run-benchmark.ps1 -PciBus` (default `01`) instead of the hard-coded `^0+:01:00\.0$`. ### Tests (host) - `test-diagnostic.ps1`: every existing probe suite passes; the generic probe suite also runs built with `-DGU_PROBE_BUS=0x2bU`; a non-default bus is rejected in a non-diagnostic compile. The attributes mock fails on any operation other than Get with a zero mask, and the success path checks the exact log line. - `test_probe_records.py`: synthetic cases for a missing, failed, duplicated or mismatching record, plus accepted values (no capture files needed). `test_make_profile.py`: four refusal cases on real captures. - `test-cold-precheck.ps1` (b650m-3090fe, h610m-3060), `test-evidence.ps1`, `benchmark/test-runner.ps1`, profile and headless Python suites: pass. ### Hardware (read-only) The bus `0x2b` probe built from this branch is byte-identical to the one booted on the machine below (`BOOTX64.EFI` SHA-256 `9ed139491442e871975905bae7fe625585f6a6de60a4c8d570c40b5dfd197106`, 21504 bytes). Two cold boots, both complete (`capture-complete=1`, `diagnostic-result status=0`), then Windows started: ```text probe-target seg=0x0000 bus=0x002b dev=0x0000 fun=0x0000 pci-attributes status=0x0000000000000000 value=0x0000000000000300 (command 0x0003: IO|MEM, BME 0) ``` MSI B550M PRO-VDH WIFI (BIOS 2.O1, AMI), Ryzen 7 5700X (no iGPU), MSI RTX 3090 `10de:2204` / `1462:3881`. No PROM, driver images or partition identifiers are included. ### Notes for review - #44 edits the same `ProbeUnchanged` lines (it latches the discovered BDF for its AD104 path); the conflict is small and either change can be rebased onto the other. - Requiring the attribute record makes existing local captures stale on purpose: a profile made without it can still stop mid-release. 🤖 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:02:01 +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#129
No description provided.