Skip to content

Nested Windows VBS guest: after WSL2 has run, a restart or shutdown can end in a triple fault of a parked secure-kernel AP #5306

Backlog

Description

I'm filing this here because it's the closest place I know to the Hyper-V and secure kernel people. I don't think the bug is in openvmm: it reproduces under QEMU on the same host, at a similar rate, when the guest is asked to shut down the same way. KVM is common to both setups, so I can't rule it out, but every step I can see the host take is one the guest asked for. The fault only shows up after WSL2 has run in the guest.

Setup

  • Host: Intel Xeon E5-2697 v2, Linux 7.0 KVM. openvmm is main as of efe0b08 (2026-11-23) plus the nested-virtualization patches from Nested Hyper-V vmbus under OpenVMM on KVM: the working solution #3721, including the nested Hyper-V hypercall relay, which only openvmm turns on. QEMU is 11.1.3 (the Proxmox VE build, pve-qemu-kvm 11.1.3-4) on the same kernel.
  • Guest: Windows 11 25H2, 16 vCPUs, Hyper-V, VBS and memory integrity (HVCI) on. hvix64 runs at L1, the NT root and the secure kernel at L2. The QEMU guest is built from the same base installation but is a separate image, and it boots OVMF where openvmm boots its own UEFI firmware.
  • Each run starts from a clean disk snapshot: boot, run a command in a WSL2 distro (so the utility VM starts), restart the guest from inside, run the WSL2 command again, shut down. The runs without WSL2 skip both WSL2 steps.
  • A host-side ftrace recorder captures the in-guest restart and the final shutdown of every run. Runs go one at a time on an otherwise idle host, with the arms interleaved. Runs that overlapped a host backup job were excluded and replaced, and runs whose recording was incomplete count as invalid. Both are listed in the evidence and change no conclusion.
  • I have not tried this with Hyper-V as L0.

What happens

Instead of restarting or powering off, the guest either resets (6 to 8 vCPUs write the ACPI reset register within microseconds) or hangs before power-off. A fault at the restart is invisible from outside: the guest resets, which is what a restart looks like anyway, and boots normally. A fault at the final shutdown mostly ends in a reset instead of a power-off, and occasionally in a hang. The System log shows an ordinary shutdown request and no crash dump.

Triple faults per phase (first series, shutdown requested by the host):

                                       with WSL2                    without WSL2
                                       runs  restart  final         runs  faults
openvmm, guest RAM on 4 KiB pages       19      0       3            20     0
openvmm, guest RAM on 2 MiB pages       39      5       4            20     0
QEMU                                    38      2       0            19     0

The 2 MiB and QEMU rows with WSL2 include a later 20-run extension. No run without WSL2 faulted, under either VMM. Over the first 20 runs of each arm, the WSL2 effect is p = 0.11, 0.02 and 1.0 for the three rows (Fisher, run level). Pooling those three (9 of 57 against 0 of 59, p = 0.001) was my idea after the fact, so treat it as descriptive.

That series looked as if the final-shutdown fault happened only under openvmm, but the host asked for the final shutdown differently on the two VMMs: openvmm through the Hyper-V shutdown integration component, QEMU through the QEMU guest agent. The restart is requested from inside the guest on both, and it faulted on both. So I ran a second, pre-registered series in which the final shutdown is also requested from inside the guest (shutdown /s /t 0), with no host request before the power-off:

                                       runs   final faults
openvmm, guest RAM on 2 MiB pages        20       3
QEMU                                     20       2

The 95% intervals are 3 to 38% and 1 to 32%, and the two rates don't differ (p = 1.0). With 20 runs per arm I can't say whether the VMM changes the rate at all. What the series does show is that the final-shutdown fault doesn't need the host's request, and that QEMU shows it too.

What the traces show

Every caught fault, under both VMMs, follows the same sequence:

  1. At termination the 15 APs park. Going by the public symbols this is SkpTerminateCompleteSecondary: it loads a copied GDT and an IDT with limit 0, then runs nop; hlt; jmp $-2.
  2. A parked AP receives an interrupt with vector 0xEF. Under openvmm it comes from a direct-mode STIMER0 that hvix64 armed. Under QEMU, which doesn't offer direct-mode timers here, an interrupt with the same vector arrives from that AP's own vCPU thread; I couldn't trace where it originates.
  3. hvix64 re-enters the parked L2 AP at hlt+1, in the active state, with no event to inject.
  4. 7 to 21 us later (across the 45 faulting vCPUs I traced) the AP triple-faults at the jmp after the hlt. In the two runs I traced in full detail, the fault was an instruction-fetch page fault with CR2 equal to RIP, after the BSP had begun zeroing the VTL1 page tables. With a limit-0 IDT the page fault becomes a triple fault.

In one hang I read hvix64's state from guest memory: it had raised bugcheck 0x26 for the triple fault, and the rendezvous it starts for the crash dump crossed the power-off rendezvous that was already running, so neither completed. I take the hang to be downstream of the fault.

The interrupt alone is not the problem. At the restart, 70 to 94% of the parked APs receive 0xEF after parking in every configuration, with and without WSL2. Without WSL2, hvix64 resumed none of them (none of roughly 700 such deliveries). With WSL2 it resumes some, most of those APs run jmp $-2 and halt again harmlessly, and the faults are among them. At the final shutdown under openvmm, a median of 10 to 11 APs have an armed timer at the last park with WSL2, against none without it. So the step that differs is hvix64 deciding to resume a parked VP, and that only happens once WSL2 has run.

Two other things I checked:

  • Among WSL2 runs, the number of APs with an armed timer at the last park does not differ between faulted and clean shutdowns.
  • Backing guest RAM with 2 MiB pages roughly halves the time from the first parked AP to the end of the shutdown (median 47 against 105 ms at the restart, 16 against 35 ms at the final shutdown). The fault rate didn't drop with it (5 of 19 against 3 of 19 in the same series, p = 0.69), so the length of that window doesn't seem to drive it.

Why I think it's guest-side

The host delivers the interrupt hvix64 or the guest set up and resumes the VP in the state hvix64 asks for. The fault comes from the guest's own page tables: the secure kernel tears them down while a parked AP can still be resumed, and that AP survives only if its code page still translates.

Two guest-side changes would close the window: don't resume a VP parked this way unless an NMI, INIT or SIPI is pending, or keep the terminating APs from being resumed until power-off. I'd like to know what WSL2 changes in hvix64's handling of the root's VPs, since I can't see that from outside.

Is this already known? I can share the traces and the analysis scripts, or run a test build.

Activity

  1. bitranox commented on Nov 27, 2026

    @bitranox
    ContributorAuthor

    Update: no faults with a nested Windows Server VM in place of WSL2

    To find out whether any Hyper-V child partition triggers this or only WSL2, I repeated the in-guest series with a different child: a Windows Server 2025 Core VM under the guest's own Hyper-V (Gen2, 2 vCPUs, 2 GB, no NIC, Secure Boot on). Each run starts the nested VM and waits for its heartbeat, restarts the guest from inside with the nested VM still running, starts it again, and then shuts the guest down from inside (shutdown /s /t 0) with it running. Apart from the nested load, the series is the same as the in-guest WSL2 one: same recorder, same analysis, same validity rules, all written down before the first run.

                                             runs   restart faults   final faults
    openvmm, guest RAM on 4 KiB pages          20         0                0
    QEMU                                       20         0                0
    

    With WSL2, in-guest: openvmm 3 of 20, QEMU 2 of 20. One difference: the openvmm arm here backs guest RAM with 4 KiB pages, and the in-guest WSL2 arm used 2 MiB. The first series faulted on 4 KiB pages as well (3 of 19), so I don't think it matters.

    Twenty clean runs don't prove the nested Server can never trigger it. At WSL2's rates, though, a clean 20 would come up about 4% of the time on openvmm and 12% on QEMU.

    The traces show more than the counts do. Across all 80 restart and shutdown records in this series, hvix64 didn't resume a single parked AP. With WSL2 it resumed at least one in 30 of 80. The openvmm restart is the clearest case: in most runs every parked AP still had an armed STIMER0 at the last park (median 15 of 15), as with WSL2, and hvix64 resumed none of them. I didn't pre-register this comparison, so it's descriptive.

    So a running child partition alone isn't enough. Either something WSL2 does or the way its utility VM is set up changes whether hvix64 resumes a parked root VP. I've posted the same update on microsoft/WSL#42375.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions