From e05da69640bc584b33bb7b74e701116a67de8335 Mon Sep 17 00:00:00 2001 From: Roman Kisel Date: Sat, 10 May 2025 14:03:08 -0700 Subject: [PATCH 1/2] virt_mshv_vtl, snp: Provide control data for SEV errors This is a follow-up to https://github.com/microsoft/openvmm/pull/1324 to close feeback on that. --- .../virt_mshv_vtl/src/processor/snp/mod.rs | 22 ++++++++++++++----- 1 file changed, 17 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 a8a6730c47..e8b82f16aa 100644 --- a/openhcl/virt_mshv_vtl/src/processor/snp/mod.rs +++ b/openhcl/virt_mshv_vtl/src/processor/snp/mod.rs @@ -1537,15 +1537,27 @@ impl UhProcessor<'_, SnpBacked> { } _ => { - // Don't print too much of the register state, might have guest secrets - // parts thereof. tracing::error!( - "SEV exit code {sev_error_code:x?}, rip {:x?}, next rip {:x?}, sev features {:x?}, v_intr_control {:x?}, event inject {:x?}", - vmsa.rip(), - vmsa.next_rip(), + "SEV exit code {sev_error_code:x?} sev features {:x?} v_intr_control {:x?} event inject {:x?} \ + vmpl {:x?} cpl {:x?} exit_info1 {:x?} exit_info2 {:x?} exit_int_info {:x?} virtual_tom {:x?} guest_error_code {:x?} \ + efer {:x?} cr4 {:x?} cr3 {:x?} cr0 {:x?} rflag {:x?} rip {:x?} next rip {:x?}", vmsa.sev_features(), vmsa.v_intr_cntrl(), vmsa.event_inject(), + vmsa.vmpl(), + vmsa.cpl(), + vmsa.exit_info1(), + vmsa.exit_info2(), + vmsa.exit_int_info(), + vmsa.virtual_tom(), + vmsa.guest_error_code(), + vmsa.efer(), + vmsa.cr4(), + vmsa.cr3(), + vmsa.cr0(), + vmsa.rflags(), + vmsa.rip(), + vmsa.next_rip(), ); panic!("Received unexpected SEV exit code {sev_error_code:x?}"); } From 42ecf507d21be8e6627c2638e9fbf3cdbb7552df Mon Sep 17 00:00:00 2001 From: Roman Kisel Date: Mon, 12 May 2025 10:10:20 -0700 Subject: [PATCH 2/2] don't log error code twice --- openhcl/virt_mshv_vtl/src/processor/snp/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openhcl/virt_mshv_vtl/src/processor/snp/mod.rs b/openhcl/virt_mshv_vtl/src/processor/snp/mod.rs index e8b82f16aa..60180b0f23 100644 --- a/openhcl/virt_mshv_vtl/src/processor/snp/mod.rs +++ b/openhcl/virt_mshv_vtl/src/processor/snp/mod.rs @@ -1539,7 +1539,7 @@ impl UhProcessor<'_, SnpBacked> { _ => { tracing::error!( "SEV exit code {sev_error_code:x?} sev features {:x?} v_intr_control {:x?} event inject {:x?} \ - vmpl {:x?} cpl {:x?} exit_info1 {:x?} exit_info2 {:x?} exit_int_info {:x?} virtual_tom {:x?} guest_error_code {:x?} \ + vmpl {:x?} cpl {:x?} exit_info1 {:x?} exit_info2 {:x?} exit_int_info {:x?} virtual_tom {:x?} \ efer {:x?} cr4 {:x?} cr3 {:x?} cr0 {:x?} rflag {:x?} rip {:x?} next rip {:x?}", vmsa.sev_features(), vmsa.v_intr_cntrl(), @@ -1550,7 +1550,6 @@ impl UhProcessor<'_, SnpBacked> { vmsa.exit_info2(), vmsa.exit_int_info(), vmsa.virtual_tom(), - vmsa.guest_error_code(), vmsa.efer(), vmsa.cr4(), vmsa.cr3(),