[PR #127] windows: contain failed mandatory post-FLR delays #135

Open
opened 2026-11-07 14:32:46 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/JustAResearcher/gpu-unlock-ada/pull/127
Author: @karl-kaefer
Created: 10/31/2026
Status: 🔄 Open

Base: main ← Head: fix/windows-reset-delay


📝 Commits (1)

  • db2e1a2 windows: contain failed mandatory post-FLR delays

📊 Changes

7 files changed (+262 additions, -14 deletions)

View changed files

📝 windows/ad104-msi/README.md (+12 -2)
➕ windows/ad104-msi/Test-ResetDelay.ps1 (+21 -0)
📝 windows/ad104-msi/compat.c (+3 -1)
📝 windows/ad104-msi/msi_release.c (+1 -1)
📝 windows/ad104-msi/port.c (+27 -10)
📝 windows/ad104-msi/port.h (+3 -0)
➕ windows/ad104-msi/tests/test_reset_delay.c (+195 -0)

📄 Description

The Windows UEFI port ignores BootServices->Stall status and advances its elapsed-time counter even when the delay fails. After an FLR request, that can allow PCI access before the required 100 ms quiet period has been established.

Check delay completion and advance time only on exact EFI_SUCCESS. Keep an unverified-reset-delay latch across the mandatory wait, including when the reset write reports failure after a possible effect. If that wait fails or its callback is missing, block target PCI/MMIO access, DMA allocation/freeing, flush and ownership checks, retain uncertain DMA, and refuse the Windows handoff. Ordinary poll-delay failures also fault the transaction instead of fabricating elapsed time.

The change is confined to windows/ad104-msi; it adds no ASUS profile, firmware payload, device admission, boot installer or binary. It extracts one reusable hardening change from the local work reported in #126. The hardware report does not validate this public MSI patch or its injected failure paths.

Validation:

  • Public synthetic suite: 621 checks across 16 delay scenarios, including errors, warnings, missing callbacks, reset-write failure after effect, quiet-period access checks and retained DMA.
  • Existing application-flow suite: 271 checks across 15 scenarios.
  • The same new regression fails against unmodified upstream port.c at the fabricated-time assertion.
  • Freestanding Windows port archive builds successfully.

Run the public tests with windows/ad104-msi/Test-ResetDelay.ps1 -Gcc <gcc-path>. They need no firmware, PROM, driver image, Windows image or GPU access. The full private-input firmware suite and a fresh hardware boot were not run for this patch.


🔄 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/JustAResearcher/gpu-unlock-ada/pull/127 **Author:** [@karl-kaefer](https://github.com/karl-kaefer) **Created:** 10/31/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/windows-reset-delay` --- ### 📝 Commits (1) - [`db2e1a2`](https://github.com/JustAResearcher/gpu-unlock-ada/commit/db2e1a20d20a9496b8ae56a4077b9afccad15904) windows: contain failed mandatory post-FLR delays ### 📊 Changes **7 files changed** (+262 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `windows/ad104-msi/README.md` (+12 -2) ➕ `windows/ad104-msi/Test-ResetDelay.ps1` (+21 -0) 📝 `windows/ad104-msi/compat.c` (+3 -1) 📝 `windows/ad104-msi/msi_release.c` (+1 -1) 📝 `windows/ad104-msi/port.c` (+27 -10) 📝 `windows/ad104-msi/port.h` (+3 -0) ➕ `windows/ad104-msi/tests/test_reset_delay.c` (+195 -0) </details> ### 📄 Description The Windows UEFI port ignores `BootServices->Stall` status and advances its elapsed-time counter even when the delay fails. After an FLR request, that can allow PCI access before the required 100 ms quiet period has been established. Check delay completion and advance time only on exact `EFI_SUCCESS`. Keep an unverified-reset-delay latch across the mandatory wait, including when the reset write reports failure after a possible effect. If that wait fails or its callback is missing, block target PCI/MMIO access, DMA allocation/freeing, flush and ownership checks, retain uncertain DMA, and refuse the Windows handoff. Ordinary poll-delay failures also fault the transaction instead of fabricating elapsed time. The change is confined to `windows/ad104-msi`; it adds no ASUS profile, firmware payload, device admission, boot installer or binary. It extracts one reusable hardening change from the local work reported in #126. The hardware report does not validate this public MSI patch or its injected failure paths. Validation: - Public synthetic suite: 621 checks across 16 delay scenarios, including errors, warnings, missing callbacks, reset-write failure after effect, quiet-period access checks and retained DMA. - Existing application-flow suite: 271 checks across 15 scenarios. - The same new regression fails against unmodified upstream `port.c` at the fabricated-time assertion. - Freestanding Windows port archive builds successfully. Run the public tests with `windows/ad104-msi/Test-ResetDelay.ps1 -Gcc <gcc-path>`. They need no firmware, PROM, driver image, Windows image or GPU access. The full private-input firmware suite and a fresh hardware boot were not run for this patch. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
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
JustAResearcher/gpu-unlock-ada#135
No description provided.