From 6804c94fd48a2f2beaf7249560d5da27eeb2e043 Mon Sep 17 00:00:00 2001 From: Roman Kisel Date: Mon, 30 Jun 2025 14:38:34 -0700 Subject: [PATCH] virt_mshv_vtl, SNP: Fix a todo in the intercept processing Implement what the TODO requests: * Add a comment to explain why halt messages are expected, * Check that the only exception intercept messages are for the VC traps, and document that. Tested by booting various SEV-SNP VMs. --- .../virt_mshv_vtl/src/processor/snp/mod.rs | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/openhcl/virt_mshv_vtl/src/processor/snp/mod.rs b/openhcl/virt_mshv_vtl/src/processor/snp/mod.rs index 9e55ccac48..43d5ccdc00 100644 --- a/openhcl/virt_mshv_vtl/src/processor/snp/mod.rs +++ b/openhcl/virt_mshv_vtl/src/processor/snp/mod.rs @@ -1623,11 +1623,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 => { + // 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::(); + if exception_message.vector + != x86defs::Exception::SEV_VMM_COMMUNICATION.0 as u16 + { + tracelimit::error_ratelimited!( + CVM_ALLOWED, + "unexpected intercept message {:x?}", + exception_message + ); + } } message_type => { tracelimit::error_ratelimited!(