virt_mshv: freeze partition time across restore - #4477
Open
ayusharora221204 wants to merge 1 commit into
Open
ayusharora221204 wants to merge 1 commit into
ayusharora221204 wants to merge 1 commit into
Conversation
Freeze MSHV partition time before restoring ReferenceTime and retain the existing lazy thaw on first VP execution so the remaining VM and VP timer state is restored consistently. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f9c48f8e-125f-4bf9-a741-3850a89fd5ba
|
This PR modifies files containing For more on why we check whole files, instead of just diffs, check out the Rustonomicon |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues were identified.
Pull request overview
Updates MSHV snapshot restoration to freeze partition time before restoring ReferenceTime, preserving lazy thaw behavior.
Changes:
- Freeze partition time before setting
ReferenceTime. - Document restore-related freeze/thaw behavior.
File summaries
| File | Description |
|---|---|
vmm_core/virt_mshv/src/x86_64/vm_state.rs |
Freezes time before setting reference time. |
vmm_core/virt_mshv/src/lib.rs |
Documents restore-related freeze behavior. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
The Microsoft hypervisor requires partition time to be explicitly frozen (via
HV_PARTITION_PROPERTY_TIME_FREEZE) before the reference time can be modified. During snapshot restore,restore_all()calls the MSHVset_reftime()path without first freezing partition time. Without this,HvCallSetPartitionPropertyfor reference time returnsHV_STATUS_INVALID_PARTITION_STATE(0x7), causing restore to fail.Freeze partition time in
set_reftime()before restoringReferenceTime. The existing freeze operation is idempotent, so the reset path remains unchanged, and time is still thawed lazily by the first VP to enterrun_vp. This keeps time frozen through the remaining VM and per-VP state restoration rather than thawing immediately after the property write.