Skip to content

Commit 32eaebf

Browse files
committed
fix(kvm): remove UnexpectedExit, let catch-all handle unexpected HLT
Remove the dedicated VcpuExit::Hlt match arm and UnexpectedExit error variant in the hw-interrupts run loop. Unexpected HLT now falls through to the Ok(other) catch-all, returning VmExit::Unknown which gets converted to the existing UnexpectedVmExit in hyperlight_vm. Signed-off-by: danbugs <danilochiarlone@gmail.com>
1 parent a105ff5 commit 32eaebf

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

src/hyperlight_host/src/hypervisor/virtual_machine/kvm/x86_64.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,6 @@ impl KvmVm {
206206
fn run_vcpu_hw_interrupts(&mut self) -> std::result::Result<VmExit, RunVcpuError> {
207207
loop {
208208
match self.vcpu_fd.run() {
209-
Ok(VcpuExit::Hlt) => {
210-
return Err(RunVcpuError::UnexpectedExit(
211-
"KVM hw-interrupts: unexpected VcpuExit::Hlt".to_string(),
212-
));
213-
}
214209
Ok(VcpuExit::IoOut(port, data)) => {
215210
if port == VmAction::Halt as u16 {
216211
// Stop the timer thread before returning.

src/hyperlight_host/src/hypervisor/virtual_machine/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,6 @@ pub enum RunVcpuError {
202202
IncrementRip(HypervisorError),
203203
#[error("Parse GPA access info failed")]
204204
ParseGpaAccessInfo,
205-
#[error("Unexpected vCPU exit: {0}")]
206-
UnexpectedExit(String),
207205
#[error("Unknown error: {0}")]
208206
Unknown(HypervisorError),
209207
}

0 commit comments

Comments
 (0)