Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7978,6 +7978,7 @@ dependencies = [
"bitvec",
"build_rs_guest_arch",
"cfg-if",
"cvm_tracing",
"fs-err",
"guestmem",
"hcl",
Expand Down
2 changes: 1 addition & 1 deletion openhcl/underhill_core/src/dispatch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ impl LoadedVm {
}

fn notify_of_vtl_crash(&self, vtl_crash: VtlCrash) {
tracing::info!("Notifying the host of the guest system crash {vtl_crash:x?}");
tracelimit::info_ratelimited!("Notifying the host of the guest system crash");

let VtlCrash {
vp_index,
Expand Down
1 change: 1 addition & 0 deletions openhcl/virt_mshv_vtl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ x86defs.workspace = true
x86emu.workspace = true

atomic_ringbuf.workspace = true
cvm_tracing.workspace = true
inspect_counters.workspace = true
inspect = { workspace = true, features = ["std"] }
mesh.workspace = true
Expand Down
24 changes: 22 additions & 2 deletions openhcl/virt_mshv_vtl/src/processor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ cfg_if::cfg_if! {
use crate::VtlCrash;
use bitvec::prelude::BitArray;
use bitvec::prelude::Lsb0;
use cvm_tracing::CVM_CONFIDENTIAL;
use hv1_emulator::synic::ProcessorSynic;
use hvdef::HvRegisterCrInterceptControl;
use hvdef::HvX64RegisterName;
use virt::vp::MpState;
use virt::x86::MsrError;
use virt_support_apic::LocalApic;
use virt_support_x86emu::translate::TranslationRegisters;
use virt::vp::AccessVpState;
use zerocopy::IntoBytes;
use hvdef::HvRegisterCrInterceptControl;
} else if #[cfg(guest_arch = "aarch64")] {
use hv1_hypercall::Arm64RegisterState;
use hvdef::HvArm64RegisterName;
Expand Down Expand Up @@ -1049,7 +1050,26 @@ impl<'a, T: Backing> UhProcessor<'a, T> {
control: self.crash_control,
parameters: self.crash_reg,
};
tracelimit::info_ratelimited!(?crash, "Guest has reported system crash");
tracelimit::warn_ratelimited!(?crash, "Guest has reported system crash");

if crash.control.crash_message() {
let message_gpa = crash.parameters[3];
let message_size = crash.parameters[4];
let mut message = vec![0; message_size as usize];
match self.partition.gm[vtl].read_at(message_gpa, &mut message) {
Ok(()) => {
let message = String::from_utf8_lossy(&message).into_owned();
Copy link
Member

Choose a reason for hiding this comment

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

is into_owned required here? &str doesn't implement tracing::value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cow doesn't implement tracing::value for whatever reason.

tracelimit::warn_ratelimited!(
CVM_CONFIDENTIAL,
message,
"Guest has reported a system crash message"
);
}
Err(e) => {
tracelimit::warn_ratelimited!(?e, "Failed to read crash message");
}
}
}

self.partition.crash_notification_send.send(crash);
}
Expand Down