diff --git a/hypervisor/src/kvm/mod.rs b/hypervisor/src/kvm/mod.rs index 24e3cdbd7..8fa9f862e 100644 --- a/hypervisor/src/kvm/mod.rs +++ b/hypervisor/src/kvm/mod.rs @@ -125,6 +125,7 @@ use kvm_bindings::{KVM_X86_SW_PROTECTED_VM, KVMIO}; #[cfg(target_arch = "x86_64")] use kvm_bindings::{Xsave as xsave2, kvm_xsave2}; pub use kvm_ioctls::{self, Cap, Kvm, VcpuExit}; +use log::error; use thiserror::Error; use vfio_ioctls::VfioDeviceFd; #[cfg(target_arch = "x86_64")] @@ -2334,7 +2335,15 @@ impl cpu::Vcpu for KvmVcpu { #[cfg(target_arch = "x86_64")] VcpuExit::IoapicEoi(vector) => Ok(cpu::VmExit::IoapicEoi(vector)), #[cfg(target_arch = "x86_64")] - VcpuExit::Shutdown | VcpuExit::Hlt => Ok(cpu::VmExit::Reset), + VcpuExit::Shutdown => { + error!("Guest likely triple-faulted"); + Ok(cpu::VmExit::Reset) + } + // Practically unlikely, as KVM emulates the LAPIC and therefore HLT + VcpuExit::Hlt => { + error!("Received a HLT exit but KVM should handle this in kernel space"); + Ok(cpu::VmExit::Reset) + } #[cfg(target_arch = "aarch64")] VcpuExit::SystemEvent(event_type, flags) => {