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 <kalyazin@amazon.com>
  • Loading branch information
kalyazin committed Feb 19, 2024
1 parent c403628 commit ab32974
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 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,10 @@ 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.
self.kvm_vcpu.fd.kvmclock_ctrl().unwrap();

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

0 comments on commit ab32974

Please sign in to comment.