public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* x86, vmi: TSC going backwards check in vmi clocksource
@ 2009-02-18 20:33 Alok Kataria
  2009-02-19 11:18 ` Ingo Molnar
  2009-02-20 17:58 ` Ingo Molnar
  0 siblings, 2 replies; 7+ messages in thread
From: Alok Kataria @ 2009-02-18 20:33 UTC (permalink / raw)
  To: Ingo Molnar, the arch/x86 maintainers; +Cc: LKML, Zachary Amsden

From: Alok N Kataria <akataria@vmware.com>

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: stable@kernel.org
---

 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 c4c1f9e..bde106c 100644
--- a/arch/x86/kernel/vmiclock_32.c
+++ b/arch/x86/kernel/vmiclock_32.c
@@ -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 = {



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-02-20 18:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-18 20:33 x86, vmi: TSC going backwards check in vmi clocksource Alok Kataria
2009-02-19 11:18 ` Ingo Molnar
2009-02-19 18:03   ` Alok Kataria
2009-02-19 18:11     ` Ingo Molnar
2009-02-20 17:58 ` Ingo Molnar
2009-02-20 18:23   ` Alok Kataria
2009-02-20 18:31     ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox