From da642fcf7fa90e06cfd5256a77ae4be6cfde811f Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 15 Sep 2020 16:17:23 +0100 Subject: [PATCH] hypervisor: Add "HyperV" exit to list of KVM exits Currently we don't need to do anything to service these exits but when the synthetic interrupt controller is active an exit will be triggered to notify the VMM of details of the synthetic interrupt page. Signed-off-by: Rob Bradford --- hypervisor/src/cpu.rs | 1 + hypervisor/src/kvm/mod.rs | 1 + vmm/src/cpu.rs | 2 ++ 3 files changed, 4 insertions(+) diff --git a/hypervisor/src/cpu.rs b/hypervisor/src/cpu.rs index 92de49362..f378d30c3 100644 --- a/hypervisor/src/cpu.rs +++ b/hypervisor/src/cpu.rs @@ -167,6 +167,7 @@ pub enum VmExit<'a> { MmioWrite(u64 /* address */, &'a [u8]), Ignore, Reset, + Hyperv, } /// diff --git a/hypervisor/src/kvm/mod.rs b/hypervisor/src/kvm/mod.rs index 2049459a0..7acb1c6a5 100644 --- a/hypervisor/src/kvm/mod.rs +++ b/hypervisor/src/kvm/mod.rs @@ -692,6 +692,7 @@ impl cpu::Vcpu for KvmVcpu { VcpuExit::MmioRead(addr, data) => Ok(cpu::VmExit::MmioRead(addr, data)), VcpuExit::MmioWrite(addr, data) => Ok(cpu::VmExit::MmioWrite(addr, data)), + VcpuExit::Hyperv => Ok(cpu::VmExit::Hyperv), r => Err(cpu::HypervisorCpuError::RunVcpu(anyhow!( "Unexpected exit reason on vcpu run: {:?}", diff --git a/vmm/src/cpu.rs b/vmm/src/cpu.rs index 8e6219e65..9c693f699 100644 --- a/vmm/src/cpu.rs +++ b/vmm/src/cpu.rs @@ -377,6 +377,8 @@ impl Vcpu { VmExit::Ignore => Ok(true), VmExit::Reset => Ok(false), + // No need to handle anything from a KVM HyperV exit + VmExit::Hyperv => Ok(true), }, Err(e) => Err(Error::VcpuRun(e.into())),