mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: support injecting NMI
Inject NMI interrupt when needed, by call ioctl KVM_NMI. Signed-off-by: Yi Wang <foxywang@tencent.com>
This commit is contained in:
@@ -316,6 +316,9 @@ pub enum Error {
|
||||
#[cfg(feature = "igvm")]
|
||||
#[error("Cannot load the igvm into memory: {0}")]
|
||||
IgvmLoad(#[source] igvm_loader::Error),
|
||||
|
||||
#[error("Error injecting NMI")]
|
||||
ErrorNmi,
|
||||
}
|
||||
pub type Result<T> = result::Result<T, Error>;
|
||||
|
||||
@@ -2446,6 +2449,15 @@ impl Vm {
|
||||
+ note_size as u64
|
||||
+ size_of::<elf::Elf64_Phdr>() as u64 * phdr_num as u64
|
||||
}
|
||||
|
||||
pub fn nmi(&self) -> Result<()> {
|
||||
return self
|
||||
.cpu_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.nmi()
|
||||
.map_err(|_| Error::ErrorNmi);
|
||||
}
|
||||
}
|
||||
|
||||
impl Pausable for Vm {
|
||||
|
||||
Reference in New Issue
Block a user