Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions openhcl/virt_mshv_vtl/src/processor/snp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1634,11 +1634,24 @@ impl UhProcessor<'_, SnpBacked> {
HvMessageType::HvMessageTypeSynicSintDeliverable => {
self.handle_synic_deliverable_exit();
}
HvMessageType::HvMessageTypeX64Halt
| HvMessageType::HvMessageTypeExceptionIntercept => {
// Ignore.
//
// TODO SNP: Figure out why we are getting these.
HvMessageType::HvMessageTypeX64Halt => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is it being processed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • Above in the match block, there is an arm for the HLT exit,
  • In the same block, when processing the MSR exit, read_msr_snp is called which checks for hvdef::HV_X64_MSR_GUEST_IDLE.

The intercept message from the hypervisor can't offer a better/more trustworthy data than that one (generated by the hardware). Both cases are handled with the VP "parked" in the state allowing for interrupts being delivered. That all made the impression all that's required to be done must be already done.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should assert or check/warn that the SevExitCode is what we'd expect here?

// Nothing to do here, the halt has already been processed.
}
HvMessageType::HvMessageTypeExceptionIntercept => {
// Only #VC's are expected due to the alternate injection.
let exception_message = self
.runner
.exit_message()
.as_message::<hvdef::HvX64ExceptionInterceptMessage>();
if exception_message.vector
Copy link
Preview

Copilot AI Aug 27, 2025

Choose a reason for hiding this comment

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

Consider adding a comment explaining what the SEV_VMM_COMMUNICATION exception vector represents and why it's the only expected exception type in the SNP context.

Copilot uses AI. Check for mistakes.

!= x86defs::Exception::SEV_VMM_COMMUNICATION.0 as u16
{
tracelimit::error_ratelimited!(
CVM_ALLOWED,
"unexpected intercept message {:x?}",
exception_message
);
}
}
message_type => {
tracelimit::error_ratelimited!(
Expand Down
Loading