mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 05:35:20 +00:00
hypervisor: mshv: handle APIC EOI message
Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
parent
d3fc12b160
commit
dbe67fca7f
@ -562,6 +562,18 @@ impl cpu::Vcpu for MshvVcpu {
|
||||
debug!("Exception Info {:?}", { info.exception_vector });
|
||||
Ok(cpu::VmExit::Ignore)
|
||||
}
|
||||
hv_message_type_HVMSG_X64_APIC_EOI => {
|
||||
let info = x.to_apic_eoi_info().unwrap();
|
||||
// The kernel should dispatch the EOI to the correct thread.
|
||||
// Check the VP index is the same as the one we have.
|
||||
assert!(info.vp_index == self.vp_index as u32);
|
||||
// The interrupt vector in info is u32, but x86 only supports 256 vectors.
|
||||
// There is no good way to recover from this if the hypervisor messes around.
|
||||
// Just unwrap.
|
||||
Ok(cpu::VmExit::IoapicEoi(
|
||||
info.interrupt_vector.try_into().unwrap(),
|
||||
))
|
||||
}
|
||||
exit => Err(cpu::HypervisorCpuError::RunVcpu(anyhow!(
|
||||
"Unhandled VCPU exit {:?}",
|
||||
exit
|
||||
|
Loading…
Reference in New Issue
Block a user