From owner-svn-src-all@freebsd.org Mon May 2 16:16:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34C28AEEA2E; Mon, 2 May 2016 16:16:09 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 062701CCB; Mon, 2 May 2016 16:16:08 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u42GG8sd052446; Mon, 2 May 2016 16:16:08 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42GG8Nj052445; Mon, 2 May 2016 16:16:08 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201605021616.u42GG8Nj052445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 2 May 2016 16:16:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298930 - head/sys/dev/xen/timer X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2016 16:16:09 -0000 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);