Skip to content

Remove VP assist page for SNP VMs - #165

Open
Jenna Goddard (jennagoddard) wants to merge 1 commit into
microsoft:product/hcl-main/6.18from
jennagoddard:entryreason
Open

Jenna Goddard (jennagoddard) wants to merge 1 commit into
microsoft:product/hcl-main/6.18from
jennagoddard:entryreason

Conversation

@jennagoddard

@jennagoddard Jenna Goddard (jennagoddard) commented Oct 26, 2026 •

Copy link
Copy Markdown

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.

Copilot AI balanced review requested due to automatic review settings October 26, 2026 06:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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

Comment thread drivers/hv/mshv_vtl_main.c
Comment thread drivers/hv/mshv_vtl_main.c
Comment thread drivers/hv/mshv_vtl_main.c

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The SNP dispatch changes need human validation of interrupt-only wakeup behavior before approval.

2 open issues
1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 28, 2026 00:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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

Comment thread drivers/hv/mshv_vtl_main.c Outdated
Copilot AI balanced review requested due to automatic review settings October 28, 2026 01:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 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

Comment thread drivers/hv/mshv_vtl_main.c

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Ignoring the intercept handler’s retry result sends non-offloaded SNP vCPUs back to userspace on interrupt-only wakes with no message, regressing the previous in-kernel reentry behavior.

No open issues 🎉

Review effort: Balanced

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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

Comment on lines +898 to +900
/* SNP exit dispatch consumes non-proxy messages. */
if (hv_isolation_type_snp())
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants