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 <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2020-09-15 16:17:23 +01:00
parent 9b48ee38cb
commit da642fcf7f
3 changed files with 4 additions and 0 deletions

View File

@ -167,6 +167,7 @@ pub enum VmExit<'a> {
MmioWrite(u64 /* address */, &'a [u8]), MmioWrite(u64 /* address */, &'a [u8]),
Ignore, Ignore,
Reset, Reset,
Hyperv,
} }
/// ///

View File

@ -692,6 +692,7 @@ impl cpu::Vcpu for KvmVcpu {
VcpuExit::MmioRead(addr, data) => Ok(cpu::VmExit::MmioRead(addr, data)), VcpuExit::MmioRead(addr, data) => Ok(cpu::VmExit::MmioRead(addr, data)),
VcpuExit::MmioWrite(addr, data) => Ok(cpu::VmExit::MmioWrite(addr, data)), VcpuExit::MmioWrite(addr, data) => Ok(cpu::VmExit::MmioWrite(addr, data)),
VcpuExit::Hyperv => Ok(cpu::VmExit::Hyperv),
r => Err(cpu::HypervisorCpuError::RunVcpu(anyhow!( r => Err(cpu::HypervisorCpuError::RunVcpu(anyhow!(
"Unexpected exit reason on vcpu run: {:?}", "Unexpected exit reason on vcpu run: {:?}",

View File

@ -377,6 +377,8 @@ impl Vcpu {
VmExit::Ignore => Ok(true), VmExit::Ignore => Ok(true),
VmExit::Reset => Ok(false), 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())), Err(e) => Err(Error::VcpuRun(e.into())),