Skip to content

Commit

Permalink
x86, vmi: TSC going backwards check in vmi clocksource
Browse files Browse the repository at this point in the history
Impact: fix time warps under vmware

Similar to the check for TSC going backwards in the TSC clocksource,
we also need this check for VMI clocksource.

Signed-off-by: Alok N Kataria <akataria@vmware.com>
Cc: Zachary Amsden <zach@vmware.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: stable@kernel.org
  • Loading branch information
Alok N Kataria authored and Ingo Molnar committed Feb 20, 2009
1 parent 402a917 commit 48ffc70
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/x86/kernel/vmiclock_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,13 @@ void __devinit vmi_time_ap_init(void)
#endif

/** vmi clocksource */
static struct clocksource clocksource_vmi;

static cycle_t read_real_cycles(void)
{
return vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL);
cycle_t ret = (cycle_t)vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL);
return ret >= clocksource_vmi.cycle_last ?
ret : clocksource_vmi.cycle_last;
}

static struct clocksource clocksource_vmi = {
Expand Down

0 comments on commit 48ffc70

Please sign in to comment.