Skip to content

virt_whp: Reset more state during scrub and reset#3539

Open
smalis-msft wants to merge 7 commits into
microsoft:mainfrom
smalis-msft:whp-scrub-vtl2
Open

virt_whp: Reset more state during scrub and reset#3539
smalis-msft wants to merge 7 commits into
microsoft:mainfrom
smalis-msft:whp-scrub-vtl2

Conversation

@smalis-msft
Copy link
Copy Markdown
Contributor

@smalis-msft smalis-msft commented May 20, 2026

Clear way more WHP state during the scrub and reset processes to prevent stale register values and potential faults upon resuming. Also fix a case where we were returning the wrong error code in virt_mshv_vtl, found during the same audits.

Hopefully fixes #71.

@smalis-msft smalis-msft requested a review from a team as a code owner May 20, 2026 20:50
Copilot AI review requested due to automatic review settings May 20, 2026 20:50
@smalis-msft smalis-msft enabled auto-merge (squash) May 20, 2026 20:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the WHP backend’s VTL2 scrub path to clear per-virtual-processor “VTL2 enabled” state for non-BSP VPs, preventing APs from resuming with stale pre-scrub register context when new VTL2 firmware reinitializes them.

Changes:

  • Clear vtl2_enable on all non-BSP VPs during WhpPartition::scrub(Vtl2).
  • Add detailed rationale in-code describing why APs must be re-enabled via HvCallEnableVpVtl after scrub.

Comment thread vmm_core/virt_whp/src/lib.rs Outdated
Comment thread vmm_core/virt_whp/src/lib.rs Outdated
@smalis-msft smalis-msft marked this pull request as draft May 21, 2026 20:34
auto-merge was automatically disabled May 21, 2026 20:34

Pull request was converted to draft

Copilot AI review requested due to automatic review settings May 21, 2026 21:57
@smalis-msft smalis-msft changed the title virt_whp: Reset VTL2-enable state for VPs during scrub virt_whp: Reset more state during scrub May 21, 2026
@smalis-msft smalis-msft changed the title virt_whp: Reset more state during scrub virt_whp: Reset more state during scrub and reset May 21, 2026
@smalis-msft smalis-msft marked this pull request as ready for review May 21, 2026 22:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread vmm_core/virt_whp/src/lib.rs Outdated
Comment thread vmm_core/virt_whp/src/lib.rs Outdated
Comment thread openhcl/virt_mshv_vtl/src/processor/hardware_cvm/mod.rs
Copilot AI review requested due to automatic review settings May 21, 2026 22:06
@github-actions github-actions Bot added the unsafe Related to unsafe code label May 21, 2026
@github-actions
Copy link
Copy Markdown

⚠️ Unsafe Code Detected

This PR modifies files containing unsafe Rust code. Extra scrutiny is required during review.

For more on why we check whole files, instead of just diffs, check out the Rustonomicon

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread vmm_core/virt_whp/src/lib.rs
Comment thread vmm_core/virt_whp/src/lib.rs Outdated
Comment thread vmm_core/virt_whp/src/lib.rs Outdated
Copilot AI review requested due to automatic review settings May 22, 2026 00:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread vmm_core/virt_whp/src/lib.rs
Comment thread opentmk/src/platform/hyperv/arch/hypercall.rs
@smalis-msft smalis-msft enabled auto-merge (squash) May 22, 2026 00:18
@github-actions
Copy link
Copy Markdown

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

Labels

unsafe Related to unsafe code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Servicing occasionally results in mesh child abnormal exit name="vmm" code=57005 during post-servicing AP startup

3 participants