From: Jan Kiszka <jan.kiszka@siemens.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: Glauber Costa <glommer@redhat.com>,
aliguori@us.ibm.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] re-set rtc date on reset handler
Date: Tue, 08 Sep 2009 19:00:43 +0200 [thread overview]
Message-ID: <4AA68DBB.9080000@siemens.com> (raw)
In-Reply-To: <4AA68B50.8000805@siemens.com>
Jan Kiszka wrote:
> Jan Kiszka wrote:
>> Blue Swirl wrote:
>>> On Tue, Sep 1, 2009 at 7:22 PM, Glauber Costa<glommer@redhat.com> wrote:
>>>> guests without a stable timesource such as kvm-clock will grab the wallclock
>>>> from our rtc chip. However, we only sync the date when we first launch qemu.
>>>> If a guest goes through a series of reboot cycles, it will slowly see time
>>>> getting far behind the host.
>>>>
>>>> The proposal of this patch is to set the date to host clock again in the reset
>>>> handler. With this patch, I see a Fedora guest keeping its clock in sync upon
>>>> an ulimited number of reboots.
>>> A different approach is used in m48t59.c: the guest clock is generated
>>> directly from host clock without any timers and only a fixed offset
>>> (to account for time when guest was stopped) is added, so the clock
>>> will always in sync.
>> Ah, that looks like a useful approach! We currently face the issue of
>> vRTC drifting away from the host time (as the latter is tuned by NTP).
>>
>> Do you or anyone else know if switching the PC RTC over to the scheme
>> used in the m48t59 may have some downsides? If not, I would happily hack
>> up a patch ASAP and suggest it for mainline.
>
> Clearly, one downside is that a jumping host time will cause the RTC to
> jump as well. However, there might by setups where this does not happen,
> so optionally switching the RTC over rt_clock seems like a reasonable
> feature to me.
>
> What about consolidating -localtime, -starttime and -rtc-td-hack at this
> chance? Something like
>
> -rtc base=utc|localtime|date,clock=vm|rt
+ ,td-hack=on|off
of course. Or let's call it "drift-hack".
>
> with 'date' specifying the base as in -starttime. 'clock' would then
> allow to drive the RTC via the host's CLOCK_REALTIME (with all its pros
> and cons).
>
> Jan
>
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2009-09-08 17:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-01 16:22 [Qemu-devel] [PATCH] re-set rtc date on reset handler Glauber Costa
2009-09-01 16:56 ` Blue Swirl
2009-09-01 23:00 ` Glauber Costa
2009-09-08 14:55 ` Dor Laor
2009-09-08 16:15 ` [Qemu-devel] " Jan Kiszka
2009-09-08 16:50 ` Jan Kiszka
2009-09-08 17:00 ` Jan Kiszka [this message]
2009-09-09 12:28 ` Dor Laor
2009-09-09 12:57 ` Jan Kiszka
2009-09-09 13:27 ` Avi Kivity
2009-09-09 13:31 ` Jan Kiszka
2009-09-09 15:04 ` Avi Kivity
2009-09-09 15:34 ` Anthony Liguori
2009-09-09 16:09 ` Gleb Natapov
2009-09-09 17:52 ` Anthony Liguori
2009-09-09 18:40 ` Gleb Natapov
2009-09-09 18:50 ` Anthony Liguori
2009-09-09 18:25 ` Avi Kivity
2009-09-09 18:33 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AA68DBB.9080000@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=aliguori@us.ibm.com \
--cc=blauwirbel@gmail.com \
--cc=glommer@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).