You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
openvmm: after a microVM restore, the TSC leads VM time by the restore's length #1371
After a time-ABI microVM restore, the guest's TSC is ahead of VM time, which drives the emulated devices' timers, by the window from the restore anchor to the start of VM time. In the real worker that window is milliseconds, and it grows with any delay in the restore. The capture side compensates for its own window (the recorded cut), but nothing compensates on the restore side, so every restore adds this skew between the guest's TSC and its device clocks. No guest or host action is needed. The TSC set on KVM, MSHV and WHP resumes the guest TSC at the anchor, so all three are affected; it was measured on KVM.
Reproduction
A KVM test (not attached) ran time_abi_restore's steps in order, with the real backend's capture anchor and synchronized TSC set and vmcore's VmTimeKeeper. TSC/F minus VM time should match the captured relation; it exceeded it by 32.1 µs for a 32.4 µs window, and by 20.116 ms for a 20.114 ms window with 20 ms inserted.
Cause
LoadedVm::time_abi_restore sets the TSC from the downtime selected at the restore anchor, after which the TSC runs with host time, and derives VM time's advance from the same downtime:
Activity
openvmm: pin restored VM time that runs from the TSCs' restart
doc: say that restored VM time runs from the TSCs' restart
virt: report when the synchronized TSC set lets the TSCs run
openvmm: run restored VM time from the instant the TSCs resume
virt: report when the synchronized TSC set lets the TSCs run
openvmm: run restored VM time from the instant the TSCs resume