diff options
author | Alok N Kataria <akataria@vmware.com> | 2009-02-18 12:33:55 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-03-16 17:53:01 -0700 |
commit | 96fa432160ed7498b6c7b8b83eb89df9e265412e (patch) | |
tree | e71b84dc1620cf0383c8e3ce5192f5049fa098a2 | |
parent | 4ad5471c089237a7efb11a8334e4f958ff7392a8 (diff) | |
download | lwn-96fa432160ed7498b6c7b8b83eb89df9e265412e.tar.gz lwn-96fa432160ed7498b6c7b8b83eb89df9e265412e.zip |
x86, vmi: TSC going backwards check in vmi clocksource
commit 48ffc70b675aa7798a52a2e92e20f6cce9140b3d upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | arch/x86/kernel/vmiclock_32.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kernel/vmiclock_32.c b/arch/x86/kernel/vmiclock_32.c index 6953859fe289..333977283068 100644 --- a/arch/x86/kernel/vmiclock_32.c +++ b/arch/x86/kernel/vmiclock_32.c @@ -280,10 +280,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 = { |