From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38139 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pi3pm-00056H-Ht for qemu-devel@nongnu.org; Wed, 26 Jan 2011 06:46:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pi3pl-00026I-52 for qemu-devel@nongnu.org; Wed, 26 Jan 2011 06:46:46 -0500 Received: from goliath.siemens.de ([192.35.17.28]:23172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pi3pk-00025p-Nt for qemu-devel@nongnu.org; Wed, 26 Jan 2011 06:46:45 -0500 Message-ID: <4D4009A0.2070804@siemens.com> Date: Wed, 26 Jan 2011 12:46:40 +0100 From: Jan Kiszka MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [RFC][PATCH 0/3] Let RTC follow backward jumps of host clock immediately List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Anthony Liguori On 2010-12-17 15:58, Jan Kiszka wrote: > By default, we base the mc146818 RTC on the host clock (CLOCK_REALTIME). > This works fine if only the frequency of the host clock is tuned (e.g. > by NTP) or if it is set to a future time. However, if the host is tuned > backward, e.g. because NTP obtained the correct time after the guest was > already started or the admin decided to tune the local time, we see an > unpleasant effect in the guest: The RTC will stall for the period the > host clock is set back. > > This series tries to address the issue more gracefully. By detecting > those warps and providing a callback mechanism to device models, the > RTC is enabled to update its timers and register content immediately. > Tested successfully with a hwclock readout loop in a Linux guest while > fiddling with the host time. > > Note that if this kind of RTC adjustment is not wanted, the user is > still free to decouple the RTC from the host clock and base it on the > VM clock - just like before. > > Jan Kiszka (3): > qemu-timer: Consolidate qemu_get_clock and qemu_get_clock_ns > qemu-timer: Introduce warp callback > mc146818rtc: Handle host clock warps > > hw/mc146818rtc.c | 17 ++++++++++++ > qemu-timer.c | 77 ++++++++++++++++++++++++++++++++++++++++++++---------- > qemu-timer.h | 5 +++ > 3 files changed, 85 insertions(+), 14 deletions(-) > Ping? Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux