mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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>
This commit is contained in:
1 parent
e9bb68a99b
commit
e82a2fb608
1 file changed
+5
-1
+5
-1
@@ -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);
|
||||
}
|
||||
|
||||