Skip to content

openvmm: pin the WHP fix for nested UEFI timer interrupts - #384

Merged
Pedro Henrique Penna (ppenna) merged 1 commit into
devfrom
agents/fix-issue-368-baremetal-validation
Oct 8, 2026
Merged

Pedro Henrique Penna (ppenna) merged 1 commit into
devfrom
agents/fix-issue-368-baremetal-validation

Conversation

@ppenna

@ppenna Pedro Henrique Penna (ppenna) commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Pin OpenVMM 51b0a79bd from nanvix/openvmm#109, which lets WHP answer CPUID leaves 0 and 1 without exits. On a busy Windows/WHP host, the UEFI firmware's timer interrupts then no longer nest until its DXE stack overflows and the VM triple faults.

Fixes #368

Problem

multiarch::pcie::openvmm_uefi_x64_windows_datacenter_core_2022_x64_pcie_nvme_boot failed in 1 of 62 runs of OpenVMM vmm-tests / Windows / WHP with a stack guard page fault in the mu_msvm v26.0.36 firmware's EfiHvDxe, followed by a triple fault.

The firmware's SynIC timer handler sends its EOI with interrupts disabled, and on each EOI, EDK2's local APIC library runs five CPUID instructions for leaves 0 and 1. RestoreTPL() then enables interrupts before the handler returns, so a tick that outlasts the 10 ms timer period lets the next one nest on the same stack. OpenVMM's standard WHP partitions exit to OpenVMM on every CPUID, so under host contention (about 20 VMs were booting in the failing run), each of those CPUIDs waited on host scheduling. nanvix/openvmm#109 has the full analysis.

Change

The only change is the openvmm gitlink, from 07850d27a to 51b0a79bd. That is one commit on nanvix/openvmm main at 07850d27a, the commit NVX already pins. It:

  • programs leaves 0 and 1 into WHP and replaces exiting on every leaf with a 39-entry CPUID exit list, for VTL0 partitions with the Hyper-V guest interface (--hv) and the in-hypervisor APIC;
  • checks after setup that WHP presents the same CPUID results as the exit path, and fails partition creation otherwise, so the guest-visible CPUID does not change;
  • adds about 0.9 ms to the creation of those partitions.

VTL2, nested virtualization, isolation, the user-mode APIC, and the time ABI keep their current behavior. NVX microVMs reject --hv, so they are unaffected.

Dependencies

Validation

Before the rebase below, on a bare-metal Windows Server 2025 WHP host (HPE DL380 Gen10, 2× Xeon Silver 4114), with NVX at a3d929a. The OpenVMM source tree that was built is byte-for-byte identical to 011f534a6's (tree 292f61c49).

Scenario Before After
2.5 ms added to each CPUID exit triple fault 2/2; a stack dump showed 102 nested timer interrupt frames passed 2/2 at the normal stack depth
2.5 ms added to every exit triple fault UEFI boot succeeded
VP 0 CPUID exits during the test's boot 6,748 344, none for leaves 0 or 1
python scripts\nvx.py test-openvmm --backend whp — 29/29 in 2 runs, with a cold and a warm Petri cache

The first three rows add a temporary diagnostic patch for the delays and counters. An earlier revision of the OpenVMM commit, which differed only in exiting on the whole 0x40000000–0x400000FF range, also passed the suite 29/29 in 6 more runs.

Rebase onto dev at 03103c13

nanvix/openvmm#109 moved from cb18433ad on b7696e7ba to 51b0a79bd on nanvix/openvmm main at 07850d27a, which dev pins, and this PR's commit moved onto dev at 03103c13. The only textual conflict was the gitlink. OpenVMM had one semantic conflict: d290df675 made topology_cpuid add AMD's cache topology leaf, 0x8000001D, to the CPUID table, and verify rejects a table leaf that neither exits nor is leaf 0 or 1, so on AMD hosts --hv partitions would have failed to start with NativeCpuidUnrouted(0x8000001d). The exit list now includes 0x8000001D (39 entries). git range-diff b7696e7ba..cb18433ad 07850d27a..51b0a79bd shows no other change to the patch.

At 51b0a79bd, on an AMD EPYC 7763 Hyper-V VM with WHP, with Rust 1.95.0: cargo test -p virt_whp passes (45 passed, and its new AMD case fails without the fix), as do the ignored real-WHP test whp_answers_the_programmed_leaves, cargo clippy --all-targets -p virt_whp, cargo doc --no-deps -p virt_whp, and cargo xtask fmt --fix. On the same host, a debug openvmm --hv --uefi firmware=MSVM.fd,disable_frontpage with no boot device failed with "failed to create the partition: CPUID leaf 0x8000001d has a programmed result but does not exit" without the new exit-list entry, and with it booted through BDS and powered off. The previous NVX CI run's WHP vmm-test runner was an Intel Xeon Platinum 8370C, so CI may not exercise this path.

python scripts\nvx.py verify passes at 8ed47267. The OpenVMM package checks are also listed in nanvix/openvmm#109.

Not run locally: Linux/KVM and Linux/MSHV, since the change is WHP-only; the NVX CI matrix covers them. Head: 8ed47267363f45799bf9d58337c85bb9200c728e.

Notes

  • The firmware defect remains: any other stall longer than 10 ms inside the timer handler can still nest it. It should be reported to microsoft/mu_msvm; EDK2's OVMF avoids it with NestedInterruptTplLib.

Copilot AI balanced review requested due to automatic review settings October 5, 2026 15:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The upstream dependency remains draft and unmerged, and exact-head NVX CI validation is still pending.

Review effort: Balanced
Findings: None

What changed in this PR

Updates NVX’s OpenVMM pin to mitigate the intermittent WHP UEFI timer-interrupt stack overflow tracked in #368.

Changes:

  • Advances the openvmm gitlink from 974f35652 to 011f534a6.
  • Incorporates native handling of CPUID leaves 0 and 1 for eligible WHP partitions, without changing NVX microVM behavior.
File Description

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ppenna
Pedro Henrique Penna (ppenna) marked this pull request as ready for review October 5, 2026 16:19
@ppenna
Pedro Henrique Penna (ppenna) force-pushed the agents/fix-issue-368-baremetal-validation branch from 1b3a67c to 5d884f9 Compare October 5, 2026 22:12
Copilot AI balanced review requested due to automatic review settings October 5, 2026 22:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: None

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The upstream dependency remains unmerged at a newer revision than documented, requiring human confirmation of pin alignment and exact-revision validation.

Review effort: Balanced
Findings: None

3e1f5bd48 lets WHP answer CPUID leaves 0 and 1 without exits for VTL0
partitions with the Hyper-V guest interface and no VTL2, nested
virtualization, isolation, or time ABI. It programs the bits that
OpenVMM's CPUID table sets in those leaves with CpuidResultList2, exits
only on a 39-entry CPUID exit list, and fails partition creation if
WHP's results differ from the table, so the guest-visible CPUID is
unchanged.

The mu_msvm UEFI firmware runs five CPUID instructions for those leaves
on each SynIC timer EOI, with interrupts disabled, and enables
interrupts again before its handler returns. Each of them used to exit
to OpenVMM and wait on host scheduling, so under host contention a
timer interrupt could outlast the firmware's 10 ms period, and the next
one nested on the same stack until the DXE stack overflowed and the VM
triple faulted. That is the intermittent failure of
openvmm_uefi_x64_windows_datacenter_core_2022_x64_pcie_nvme_boot on
Windows/WHP in #368. NVX microVMs use the time ABI and keep their CPUID
configuration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 226731e8-3e38-4396-8109-80c7ab5f79bd
@ppenna
Pedro Henrique Penna (ppenna) force-pushed the agents/fix-issue-368-baremetal-validation branch from 8ed4726 to ba5bc7f Compare October 7, 2026 15:19
@ppenna
Pedro Henrique Penna (ppenna) merged commit 96978ea into dev Oct 8, 2026
81 of 86 checks passed
@ppenna
Pedro Henrique Penna (ppenna) deleted the agents/fix-issue-368-baremetal-validation branch October 8, 2026 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenVMM: intermittent EfiHvDxe stack-guard triple fault in WHP pcie_nvme_boot vmm-test

2 participants