virt_mshv: support upstream enlightened SNP AP startup - #4467
Open
Chris Oo (chris-oo) wants to merge 1 commit into
Open
Chris Oo (chris-oo) wants to merge 1 commit into
Chris Oo (chris-oo) wants to merge 1 commit into
Conversation
Handle APIC-to-VP index lookups using the configured VP topology, and parse SNP StartVirtualProcessor inputs through the normal shared-memory hypercall dispatcher instead of the unsupported GPA-read passthrough. Retain reserved-field validation in the common x64 StartVP parser. Cover lookup ordering, partial completion, invalid targets, and reserved fields with tests. Validated normal-injection SNP boot and per-CPU timer wakeups with 2, 4, and 8 VPs on MSHV. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 309b650d-fb0e-44da-8054-30ece8ab7e01
|
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.
🟡 Changes recommended
The upstream StartVP context is incompatible with the current VMSA GPA parsing and can prevent AP startup.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Extends MSHV SNP support for upstream Hyper-V enlightened Linux AP startup.
Changes:
- Routes SNP hypercalls through the shared dispatcher.
- Adds APIC-ID-to-VP-index lookup and StartVP handling.
- Validates StartVP fields and documents multi-VP requirements.
File summaries
| File | Reviewed changes |
|---|---|
vmm_core/virt_mshv/src/x86_64/snp.rs |
Uses generic SNP hypercall dispatch. |
vmm_core/virt_mshv/src/x86_64/mod.rs |
Adds VP lookup and StartVP dispatch. |
vm/hv1/hv1_hypercall/src/support.rs |
Adds StartVP validation tests. |
vm/hv1/hv1_hypercall/src/imp.rs |
Validates x64 StartVP reserved fields. |
Guide/src/reference/openvmm/management/cli.md |
Documents SNP multi-VP requirements. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Will Wright (will-j-wright)
approved these changes
Sep 17, 2026
| For multi-VP SNP IGVM boots, `--processors` must match the processor count | ||
| encoded in the image. Hyper-V-enlightened MSHV guests can start APs using | ||
| Hyper-V APIC-to-VP lookup and processor-start hypercalls. The guest kernel | ||
| must allocate shared hypercall input and output buffers for this path. |
Contributor
There was a problem hiding this comment.
again, dumping internals in the CLI doc
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.
Handle the HvGetVpIndexFromApicId hypercall and standard AP start hypercall used by upstream SNP enlightened Linux guests with Hyper-V enlightenments enabled. This removes the previous implementation that was used during bring that targeted a specific ACI kernel, that had a slightly different hypercall expectations.