提交 48ffc70b 编写于 作者: A Alok N Kataria 提交者: Ingo Molnar

x86, vmi: TSC going backwards check in vmi clocksource

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: NAlok N Kataria <akataria@vmware.com>
Cc: Zachary Amsden <zach@vmware.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
Cc: stable@kernel.org
上级 402a917a
...@@ -283,10 +283,13 @@ void __devinit vmi_time_ap_init(void) ...@@ -283,10 +283,13 @@ void __devinit vmi_time_ap_init(void)
#endif #endif
/** vmi clocksource */ /** vmi clocksource */
static struct clocksource clocksource_vmi;
static cycle_t read_real_cycles(void) 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 = { static struct clocksource clocksource_vmi = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册