From 4a81d65f79ce4ccc19823ece79cdc2d0110ace28 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Wed, 17 Jun 2020 13:11:26 +0200 Subject: [PATCH] vmm: Notify the guest about vCPUs being paused Through the newly added API notify_guest_clock_paused(), this patch improves the vCPU pause operation by letting the guest know that each vCPU is being paused. This is important to avoid soft lockups detection from the guest that could happen because the VM has been paused for more than 20 seconds. Signed-off-by: Sebastien Boeuf --- vmm/src/cpu.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/vmm/src/cpu.rs b/vmm/src/cpu.rs index f198f660c..0828a0966 100644 --- a/vmm/src/cpu.rs +++ b/vmm/src/cpu.rs @@ -1322,6 +1322,20 @@ impl Pausable for CpuManager { state.signal_thread(); } + #[cfg(target_arch = "x86_64")] + for vcpu in self.vcpus.iter() { + vcpu.lock() + .unwrap() + .fd + .notify_guest_clock_paused() + .map_err(|e| { + MigratableError::Pause(anyhow!( + "Could not notify guest it has been paused {:?}", + e + )) + })?; + } + Ok(()) }