From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Winchell Subject: Re: [PATCH 0/2] Improve hpet accuracy Date: Tue, 10 Jun 2008 13:13:56 -0400 Message-ID: <484EB654.4010801@virtualiron.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090107060300060806040601" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: dan.magenheimer@oracle.com, xen-devel , Ben Guthro List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------090107060300060806040601 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Keir, Dan: Although I plan to break up the patch, etc., I'm posting this fix to the patch for anyone who might be interested. thanks, Dave --------------090107060300060806040601 Content-Type: text/x-csrc; name="p.6.10.time.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="p.6.10.time.c" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2008/06/10 12:20:48-04:00 winchell@dwinchell2.virtualiron.com # vi-patch: xen-hpet # # Bug Id: 6057 # # Reviewed by: Robert # # SUMMARY: Fix wrap issue in monotonic s_time(). # # xen/arch/x86/time.c # 2008/06/10 12:20:48-04:00 winchell@dwinchell2.virtualiron.com +3 -2 # Fix wrap issue in monotonic s_time(). # diff -Nru a/xen/arch/x86/time.c b/xen/arch/x86/time.c --- a/xen/arch/x86/time.c 2008-06-10 13:08:39 -04:00 +++ b/xen/arch/x86/time.c 2008-06-10 13:08:39 -04:00 @@ -534,7 +534,7 @@ u64 count; unsigned long flags; struct cpu_time *t = &this_cpu(cpu_time); - u64 tsc, delta; + u64 tsc, delta, diff; s_time_t now; if(hpet_main_counter_phys_avoid_hdw || !hpet_physical_inited) { @@ -542,7 +542,8 @@ rdtscll(tsc); delta = tsc - t->local_tsc_stamp; now = t->stime_local_stamp + scale_delta(delta, &t->tsc_scale); - if(now > get_s_time_mon.last_ret) + diff = (u64)now - (u64)get_s_time_mon.last_ret; + if((s64)diff > (s64)0) get_s_time_mon.last_ret = now; else now = get_s_time_mon.last_ret; --------------090107060300060806040601 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------090107060300060806040601--