« Previous | Next » 

Revision 00f4d64e

ID00f4d64ee76e873be881a82d893a591487aa7950

Added by Marcelo Tosatti almost 11 years ago

kvmclock: clock should count only if vm is running

kvmclock should not count while vm is paused, because:

1) if the vm is paused for long periods, timekeeping
math can overflow while converting the (large) clocksource
delta to nanoseconds.

2) Users rely on CLOCK_MONOTONIC to count run time, that is,
time which OS has been in a runnable state (see CLOCK_BOOTTIME).

Change kvmclock driver so as to save clock value when vm transitions
from runnable to stopped state, and to restore clock value from stopped
to runnable transition.

Cc:
Signed-off-by: Marcelo Tosatti <>
Signed-off-by: Gleb Natapov <>
Signed-off-by: Paolo Bonzini <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences