aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-10-08 08:51:51 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-10-08 08:51:51 +0100
commite82a2fb6080fa6cdb9f4baaf101b438baea07fc9 (patch)
tree50854756fb40e1a809e09d065eb48d9db65c73b9
parente9bb68a99b62baa638cadc587416471d11017c0f (diff)
downloadxen-e82a2fb6080fa6cdb9f4baaf101b438baea07fc9.tar.gz
xen-e82a2fb6080fa6cdb9f4baaf101b438baea07fc9.tar.bz2
xen-e82a2fb6080fa6cdb9f4baaf101b438baea07fc9.zip
x86 tsc: Fix check_tsc_warp() bug and add copyright notice
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
-rw-r--r--xen/arch/x86/time.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 5a56b717c9..7f1a1153d7 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1442,6 +1442,10 @@ struct tm wallclock_time(void)
* TSC Reliability check
*/
+/*
+ * The Linux original version of this function is
+ * Copyright (c) 2006, Red Hat, Inc., Ingo Molnar
+ */
void check_tsc_warp(unsigned long tsc_khz, unsigned long *max_warp)
{
#define rdtsc_barrier() mb()
@@ -1494,7 +1498,7 @@ void check_tsc_warp(unsigned long tsc_khz, unsigned long *max_warp)
if ( unlikely(prev > now) )
{
spin_lock(&sync_lock);
- if ( *max_warp > prev - now )
+ if ( *max_warp < prev - now )
*max_warp = prev - now;
spin_unlock(&sync_lock);
}