Skip to content

Commit

Permalink
fix(vmm): call KVMCLOCK_CTRL when pausing
Browse files Browse the repository at this point in the history
This is to avoid guest kernel panic on resume path
due to softlockup detection.

Signed-off-by: Nikita Kalyazin <[email protected]>
  • Loading branch information
kalyazin committed Feb 19, 2024
1 parent c403628 commit 8fbd685
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/vmm/src/vstate/vcpu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,11 @@ impl Vcpu {
.send(VcpuResponse::Paused)
.expect("vcpu channel unexpectedly closed");

// TODO: we should call `KVM_KVMCLOCK_CTRL` here to make sure
// TODO continued: the guest soft lockup watchdog does not panic on Resume.
// Calling `KVM_KVMCLOCK_CTRL` to make sure the guest softlockup watchdog
// does not panic on resume, see https://docs.kernel.org/virt/kvm/api.html .
// Unwrapping to exit immediately if we fail to do that.
#[cfg(target_arch = "x86_64")]
self.kvm_vcpu.fd.kvmclock_ctrl().unwrap();

// Move to 'paused' state.
state = StateMachine::next(Self::paused);
Expand Down

0 comments on commit 8fbd685

Please sign in to comment.