Skip to content

Commit ab32974

Browse files
committed
fix(vmm): call KVMCLOCK_CTRL when pausing
This is to avoid guest kernel panic on resume path due to softlockup detection. Signed-off-by: Nikita Kalyazin <[email protected]>
1 parent c403628 commit ab32974

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/vmm/src/vstate/vcpu/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,10 @@ impl Vcpu {
296296
.send(VcpuResponse::Paused)
297297
.expect("vcpu channel unexpectedly closed");
298298

299-
// TODO: we should call `KVM_KVMCLOCK_CTRL` here to make sure
300-
// TODO continued: the guest soft lockup watchdog does not panic on Resume.
299+
// Calling `KVM_KVMCLOCK_CTRL` to make sure the guest softlockup watchdog
300+
// does not panic on resume, see https://docs.kernel.org/virt/kvm/api.html .
301+
// Unwrapping to exit immediately if we fail to do that.
302+
self.kvm_vcpu.fd.kvmclock_ctrl().unwrap();
301303

302304
// Move to 'paused' state.
303305
state = StateMachine::next(Self::paused);

0 commit comments

Comments
 (0)