Repository navigation
Remove VP assist page for SNP VMs - #165
Jenna Goddard (jennagoddard) wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved dispatch issues can return stale exit data, lose intercept messages, and mishandle VTL1 exits.
3 open issues
What changed in this PR
Removes the SNP dispatch loop’s dependency on the hypervisor-provided VP assist page, using VMSA state and SynIC messages instead.
Changes:
- Stops allocating VP assist pages for SNP guests and makes APIC EOI access null-safe.
- Uses VMSA exit codes and tracks whether the lower VTL ran.
- Routes SNP intercept messages through SynIC and disables assist-page-dependent capabilities.
| File | Description |
|---|---|
drivers/hv/mshv_vtl_main.c |
Reworks SNP exit handling around VMSA state and SynIC messages. |
drivers/hv/hv_common.c |
Disables VP assist page allocation for SNP guests. |
arch/x86/hyperv/hv_apic.c |
Uses the null-safe VP assist page accessor. |
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
With interrupt offloading disabled, the halt-wake path overwrites userspace-managed VMSA state without guest execution, while interrupt-only exits introduce unnecessary userspace round trips.
2 open issues
1 resolved since last review
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
Ignoring the intercept handler’s return value causes interrupt-only exits to return to userspace with HVMSG_NONE instead of re-entering the guest, adding a round trip for every host interrupt when injection offload is disabled.
No open issues 🎉
2 resolved since last review
Review effort: Balanced
d6c3c87 to
2b346bd
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
With interrupt-injection offload disabled, interrupt-only wakeups without an intercept now return to userspace with HVMSG_NONE instead of retrying in kernel, adding unnecessary round trips and bypassing the configured reentry policy.
No open issues 🎉
Review effort: Balanced
2b346bd to
135d584
Compare
135d584 to
a4362c9
Compare
The mshv SNP VTL return path uses vtl_entry_reason and intercept_message from the VP assist page to classify lower-VTL exits. The page is shared with the host in an SNP VM, so its contents are not trustworthy for exit dispatch. Do not allocate VP assist pages for SNP guests. Classify architectural exits from protected VMSA state and obtain synthetic intercept messages from the SynIC message page. Track whether the lower VTL ran so a local halt wakeup is not mistaken for a new VMSA exit, and keep the existing kernel exit offloads and timer state synchronized. Use a NULL-safe assist-page lookup in the Hyper-V APIC EOI path, and stop advertising assist-page-backed intercept and return-action capabilities for SNP and TDX guests. This does not change the userspace ABI. Signed-off-by: Jenna Goddard <jennagoddard@microsoft.com>
a4362c9 to
012bddd
Compare
There was a problem hiding this comment.
🟡 Changes recommended
A SynIC-message race can leave a halted guest with queued messages unprocessed indefinitely, and interrupt-only wakeups now cause unnecessary userspace round trips when interrupt-injection offload is disabled.
1 open issue
Review effort: Balanced
| /* SNP exit dispatch consumes non-proxy messages. */ | ||
| if (hv_isolation_type_snp()) | ||
| break; |

Remove mshv driver dependency on the hypervisor provided VP assist page in the main dispatch loop for SNP VMs. There is no user-visible impact. For SNP VMs the VP assist page is no longer registered, and the dispatch loop relies on VMSA state instead of hypervisor provided entry reason. Synic messsages are used instead of the intercept page.