[PR #6] [MERGED] Fix diagnostic probing after failed PCI configuration reads #113

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/6
Author: @embersas
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @impacifist

Base: main ← Head: codex/diagnostic-probe-hardening


📝 Commits (1)

  • 4b5c2d0 Fix: stop dependent probe captures after a failed config read

📊 Changes

4 files changed (+277 additions, -6 deletions)

View changed files

📝 internal-boot/boot/diagnostic.c (+9 -2)
📝 internal-boot/boot/probe.c (+15 -4)
📝 internal-boot/boot/test-diagnostic.ps1 (+8 -0)
➕ internal-boot/boot/test_probe.c (+245 -0)

📄 Description

A failed 64-dword PCI configuration read in GuProbeGpu currently leaves cfg[4] eligible to gate BAR0 register/PROM probing, even though the buffer contents are untrusted. With an error-returning read that leaves nonzero data behind, the diagnostic still performs 16 register reads and a full 1 MiB PROM capture and can report capture-complete=1.

This records the failure, skips dependent capture for that device, and returns the first configuration-read error. The graph capture logs probe status and preserves incomplete results. Host tests exercise the real probe and graph capture for both reviewed hardware profiles, with successful-read controls and configuration/read/allocation/log-write failures. The existing Windows diagnostic test runner includes the new tests.

Validation against e3f03cd and proposed head 4b5c2d0:

  • The same regression test fails on the original source for both profiles; the fixed source passes 41 checks per profile. Failed config reads now trigger zero register/PROM reads; successful captures retain the existing full capture.
  • Both fixed profile tests pass with Clang 18.1.3 undefined-behaviour sanitisation enabled.
  • Existing Python tools (14 tests), package helper (44 checks), handoff (39 checks), graph diagnostics (35 checks) and automatic policy checks pass. The pre-existing installer integration fixture still fails because it lacks HardwareProfile; it is unchanged here.
  • Cross-compiled the five diagnostic translation units with the production Windows EFI target flags, linked both profile images with LLD 22.1.2, and passed the repository's verify_pe.py checks. Partition identifiers were synthetic build fixtures; no image was installed or executed.
  • git diff --check passes.

Host simulation and build validation only. The Windows-native PowerShell diagnostic test runner itself was not executed; the equivalent C tests ran in WSL. No hardware compatibility, boot recovery, stability or performance claim is made. This addresses the diagnostic probe introduced in #5 without changing hardware profiles or unlock guards.


🔄 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/6 **Author:** [@embersas](https://github.com/embersas) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@impacifist](https://github.com/impacifist) **Base:** `main` ← **Head:** `codex/diagnostic-probe-hardening` --- ### 📝 Commits (1) - [`4b5c2d0`](https://github.com/windows-GPU-UNLOCK/Windows-GPU-UNLOCK/commit/4b5c2d03c00aa62d9a4821762bdc2885c00fe1df) Fix: stop dependent probe captures after a failed config read ### 📊 Changes **4 files changed** (+277 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `internal-boot/boot/diagnostic.c` (+9 -2) 📝 `internal-boot/boot/probe.c` (+15 -4) 📝 `internal-boot/boot/test-diagnostic.ps1` (+8 -0) ➕ `internal-boot/boot/test_probe.c` (+245 -0) </details> ### 📄 Description A failed 64-dword PCI configuration read in `GuProbeGpu` currently leaves `cfg[4]` eligible to gate BAR0 register/PROM probing, even though the buffer contents are untrusted. With an error-returning read that leaves nonzero data behind, the diagnostic still performs 16 register reads and a full 1 MiB PROM capture and can report `capture-complete=1`. This records the failure, skips dependent capture for that device, and returns the first configuration-read error. The graph capture logs probe status and preserves incomplete results. Host tests exercise the real probe and graph capture for both reviewed hardware profiles, with successful-read controls and configuration/read/allocation/log-write failures. The existing Windows diagnostic test runner includes the new tests. Validation against `e3f03cd` and proposed head `4b5c2d0`: - The same regression test fails on the original source for both profiles; the fixed source passes 41 checks per profile. Failed config reads now trigger zero register/PROM reads; successful captures retain the existing full capture. - Both fixed profile tests pass with Clang 18.1.3 undefined-behaviour sanitisation enabled. - Existing Python tools (14 tests), package helper (44 checks), handoff (39 checks), graph diagnostics (35 checks) and automatic policy checks pass. The pre-existing installer integration fixture still fails because it lacks `HardwareProfile`; it is unchanged here. - Cross-compiled the five diagnostic translation units with the production Windows EFI target flags, linked both profile images with LLD 22.1.2, and passed the repository's `verify_pe.py` checks. Partition identifiers were synthetic build fixtures; no image was installed or executed. - `git diff --check` passes. Host simulation and build validation only. The Windows-native PowerShell diagnostic test runner itself was not executed; the equivalent C tests ran in WSL. No hardware compatibility, boot recovery, stability or performance claim is made. This addresses the diagnostic probe introduced in #5 without changing hardware profiles or unlock guards. --- <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#113
No description provided.