FULL AI ANALYSIS

KVM guests' clocks jump forward minutes after host suspend/resume when host uses TSC as RTC and guests use kvmclock

Generated Oct 18, 2026, 9:45:27 AM

Analysis summary

Host suspend/resume can rebase TSC/clocksource. Guests using kvmclock can inherit an advanced host monotonic reference, causing guest wallclock to jump if not adjusted. If guest has no NTP/chrony to correct smoothly, time jumps. qemu's rtc options and kernel clocksource selection influence behavior. Also, kvmclock paravirtual timers require host/guest coordination on suspend path.

Possible causes

Host TSC rebase on resume causes kvmclock guests to advance wallclock because guest kvmclock relies on host monotonic counters

85%

Guest lacks a time synchronization daemon (chrony/ntpd) configured to handle large steps smoothly

60%

QEMU/KVM not receiving or not propagating proper suspend/resume notifications to guests due to qemu args or outdated libvirt hooks

35%

Kernel bug in guest kvmclock implementation causing miscalculated offset on resume

20%

Suggested fixes

1

Diagnostic step 1

Install and configure chrony in every guest with 'makestep' options to handle big jumps and ensure realtime drift correction.

2

Diagnostic step 2

Enable qemu guest-agent and ensure libvirt hooks propagate suspend/resume events so guests can pause kvmclock and resync.

3

Diagnostic step 3

Set qemu -rtc parameters (e.g., -rtc base=utc,clock=host) cautiously and test on non-critical VMs.

4

Diagnostic step 4

On host, prefer a stable clocksource on resume (avoid host switching clocksource unexpectedly); check /sys/devices/system/clocksource/clocksource0/available_clocksource.

5

Diagnostic step 5

If necessary, add a resume hook to run 'chronyc makestep' or 'systemctl restart chronyd' inside guests via guest-agent.