summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroyger <royger@FreeBSD.org>2016-05-02 16:16:08 +0000
committerroyger <royger@FreeBSD.org>2016-05-02 16:16:08 +0000
commita394bd2abd40f90a6b211a64f88b645898a99050 (patch)
treea7425e2ba2299afac89a054d140754f08c36fcd9
parente0a6b782e12a2f322f05d914e09fdec5e421db4e (diff)
downloadFreeBSD-src-a394bd2abd40f90a6b211a64f88b645898a99050.zip
FreeBSD-src-a394bd2abd40f90a6b211a64f88b645898a99050.tar.gz
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
-rw-r--r--sys/dev/xen/timer/timer.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/dev/xen/timer/timer.c b/sys/dev/xen/timer/timer.c
index 8eecc60..083898c 100644
--- a/sys/dev/xen/timer/timer.c
+++ b/sys/dev/xen/timer/timer.c
@@ -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);
OpenPOWER on IntegriCloud