Repository navigation
feat(windows): preserve running nested vm execution state - #160
Open
toksdotdev wants to merge 4 commits into
Open
toksdotdev wants to merge 4 commits into
toksdotdev wants to merge 4 commits into
Conversation
toksdotdev
added this pull request to stack #161
October 13, 2026 15:16
toksdotdev
force-pushed
the
toks/windows-nested-snapshot-state
branch
from
October 14, 2026 21:15
0ad05e6 to
d3ec49b
Compare
toksdotdev
removed this pull request from stack #161
October 14, 2026 21:16
This was referenced Oct 14, 2026
toksdotdev
marked this pull request as ready for review
October 14, 2026 21:16
This was referenced Oct 14, 2026
toksdotdev
added this pull request to stack #170
October 14, 2026 21:17
Retain bounded WHP nested-state transport and restore interrupt state after importing the nested payload. Restack the reviewed Windows implementation on the consolidated Linux backend.
toksdotdev
force-pushed
the
toks/windows-nested-snapshot-state
branch
from
October 14, 2026 23:05
d3ec49b to
2bf0912
Compare
Expose the documented Hyper-V enlightened VMCS interface on capable Intel hosts so nested state remains in guest-maintained memory. Reject ordinary current VMCS payloads instead of restoring an incoherent private cache. Retain the synthetic feature contract and partition reference time in nested ABI 3. Preserve ordinary snapshot encoding and AMD guest feature exposure.
Save the emulated PIT programming, remaining time and partial accesses at a paused interrupt boundary. Require the new Windows execution ABI by default; allow explicit recovery of older ordinary or enlightened snapshots using a known periodic reload without bypassing CPU compatibility checks.
Use a high-resolution waitable timer together with the control wake event. Condition-variable timeouts round millisecond PIT deadlines to the Windows scheduler tick, slowing guest clocks and breaking AMD guest startup. Keep pause and reprogramming interruptible without losing the captured timer phase.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
a running nested vm can fail after intel windows restore because whp reloads stale ordinary vmcs backing memory. enable the documented enlightened-vmcs interface on capable intel hosts so linux keeps that state in guest memory, and reject captures that still use an ordinary active vmcs.
save the full emulated pit timer state alongside cpu and interrupt state. without it, older ordinary snapshots can restore with a frozen guest clock and hanging commands. pause fences timer injection, and a high-resolution windows timer preserves millisecond deadlines without breaking amd startup.
ordinary snapshots now use whp abi 2 and enlightened nested snapshots use abi 4. normal restore rejects older snapshots with recovery instructions.
ExecutionState::recover_windows_periodic_pit(divisor)explicitly supplies a known periodic reload for old ordinary abi 1 or enlightened nested abi 3 snapshots; the original timer phase cannot be reconstructed. validate the recovered guest and capture a new snapshot. non-enlightened nested snapshots still require a disk restart. cpu compatibility checks remain enforced.preserve the hyper-v clock epoch and synthetic feature contract, and restore nested state, registers, xsave and interrupt state together. amd keeps its existing guest features.
merge order: #156 → #155 → #158 → #159 → #160 → #162 → #169 → #168. windows arm64 and linux arm64 remain unsupported; #164 is deferred.


Confidence Score: 5/5
The reviewed changes appear safe to merge, with no new blocking issues found.Reviews (10) · Last reviewed commit: "fix(windows): use precise interruptible ..." · Reviewed by Greptile