Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 May 2016 16:16:08 +0000 (UTC)
From:      =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <royger@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r298930 - head/sys/dev/xen/timer
Message-ID:  <201605021616.u42GG8Nj052445@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: royger
Date: Mon May  2 16:16:08 2016
New Revision: 298930
URL: https://svnweb.freebsd.org/changeset/base/298930

Log:
  xen/time: fix PV clock resolution
  
  The current resolution of the Xen PV clock is too high, which causes an
  adjustment of 5s to be applied to it. Reduce the resolution to be the same
  as the RTC plus one, so it's always selected as the best source when
  available on x86.
  
  Also don't reset the clock on resume, it's pointless and discards any
  previous adjustments.
  
  Sponsoted by: Citrix Systems R&D

Modified:
  head/sys/dev/xen/timer/timer.c

Modified: head/sys/dev/xen/timer/timer.c
==============================================================================
--- head/sys/dev/xen/timer/timer.c	Mon May  2 16:15:28 2016	(r298929)
+++ head/sys/dev/xen/timer/timer.c	Mon May  2 16:16:08 2016	(r298930)
@@ -77,7 +77,7 @@ static devclass_t xentimer_devclass;
 
 /* Xen timers may fire up to 100us off */
 #define	XENTIMER_MIN_PERIOD_IN_NSEC	100*NSEC_IN_USEC
-#define	XENCLOCK_RESOLUTION		10000000
+#define	XENCLOCK_RESOLUTION		1000001 /* ATRTC resolution + 1 */
 
 #define	XENTIMER_QUALITY	950
 
@@ -472,9 +472,6 @@ xentimer_resume(device_t dev)
 	/* Reset the last uptime value */
 	pvclock_resume();
 
-	/* Reset the RTC clock */
-	inittodr(time_second);
-
 	/* Kick the timers on all CPUs */
 	smp_rendezvous(NULL, xentimer_percpu_resume, NULL, dev);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605021616.u42GG8Nj052445>