aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/xen
diff options
context:
space:
mode:
authorRoger Pau Monné <royger@FreeBSD.org>2016-05-02 16:16:08 +0000
committerRoger Pau Monné <royger@FreeBSD.org>2016-05-02 16:16:08 +0000
commitf8af716b04ae27b97393e5c1959150f543fe301f (patch)
treea7425e2ba2299afac89a054d140754f08c36fcd9 /sys/dev/xen
parenteac636b0ce5cb889aa72628f18169cd58ba3697d (diff)
downloadsrc-f8af716b04ae27b97393e5c1959150f543fe301f.tar.gz
src-f8af716b04ae27b97393e5c1959150f543fe301f.zip
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
Notes
Notes: svn path=/head/; revision=298930
Diffstat (limited to 'sys/dev/xen')
-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 8eecc6051d7a..083898ca0704 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);