All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Avi Kivity <avi@redhat.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"agraf@suse.de" <agraf@suse.de>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/4] xen: introduce mc146818rtcxen
Date: Mon, 21 Nov 2011 14:49:32 -0600	[thread overview]
Message-ID: <4ECAB95C.5010304@codemonkey.ws> (raw)
In-Reply-To: <4EC9146E.1070608@redhat.com>

On 11/20/2011 08:53 AM, Avi Kivity wrote:
> On 11/18/2011 04:54 PM, Anthony Liguori wrote:
>>
>> Thinking more about it, I think this entire line of thinking is wrong
>> (including mine) :-)
>>
>> The problem you're trying to solve is that the RTC fires two 1 second
>> timers regardless of whether the guest is reading the wall clock time,
>> right?  And since wall clock time is never read from the QEMU RTC in
>> Xen, it's a huge waste?
>>
>> The Right Solution would be to modify the RTC emulation such that it
>> did a qemu_get_clock() during read of the CMOS registers in order to
>> ensure the time was up to date (instead of using 1 second timers).
>>
>> Then the timers wouldn't even exist anymore.
>
> That would make host time adjustments (suspend/resume) be reflected in
> the guest.

qemu_get_clock(rtc_clock)

It depends on what clock rtc_clock is tied too.  If it's tied to vm_clock, it 
won't be affected.

> Not sure if that's good or bad, but it's different.

Doing this wouldn't change the behavior.  I presume you were confusing 
qemu_get_clock() with qemu_get_timedate().

But our current default behavior has the characteristic that you're concerned 
about.  It's was a conscious decision.  See:

commit 6875204c782e7c9aa5c28f96b2583fd31c50468f
Author: Jan Kiszka <jan.kiszka@siemens.com>
Date:   Tue Sep 15 13:36:04 2009 +0200

     Enable host-clock-based RTC

Regards,

Anthony Liguori

WARNING: multiple messages have this Message-ID (diff)
From: Anthony Liguori <anthony@codemonkey.ws>
To: Avi Kivity <avi@redhat.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"agraf@suse.de" <agraf@suse.de>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [PATCH 1/4] xen: introduce mc146818rtcxen
Date: Mon, 21 Nov 2011 14:49:32 -0600	[thread overview]
Message-ID: <4ECAB95C.5010304@codemonkey.ws> (raw)
In-Reply-To: <4EC9146E.1070608@redhat.com>

On 11/20/2011 08:53 AM, Avi Kivity wrote:
> On 11/18/2011 04:54 PM, Anthony Liguori wrote:
>>
>> Thinking more about it, I think this entire line of thinking is wrong
>> (including mine) :-)
>>
>> The problem you're trying to solve is that the RTC fires two 1 second
>> timers regardless of whether the guest is reading the wall clock time,
>> right?  And since wall clock time is never read from the QEMU RTC in
>> Xen, it's a huge waste?
>>
>> The Right Solution would be to modify the RTC emulation such that it
>> did a qemu_get_clock() during read of the CMOS registers in order to
>> ensure the time was up to date (instead of using 1 second timers).
>>
>> Then the timers wouldn't even exist anymore.
>
> That would make host time adjustments (suspend/resume) be reflected in
> the guest.

qemu_get_clock(rtc_clock)

It depends on what clock rtc_clock is tied too.  If it's tied to vm_clock, it 
won't be affected.

> Not sure if that's good or bad, but it's different.

Doing this wouldn't change the behavior.  I presume you were confusing 
qemu_get_clock() with qemu_get_timedate().

But our current default behavior has the characteristic that you're concerned 
about.  It's was a conscious decision.  See:

commit 6875204c782e7c9aa5c28f96b2583fd31c50468f
Author: Jan Kiszka <jan.kiszka@siemens.com>
Date:   Tue Sep 15 13:36:04 2009 +0200

     Enable host-clock-based RTC

Regards,

Anthony Liguori

  reply	other threads:[~2011-11-21 20:49 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-15 14:48 [Qemu-devel] [PATCH 0/4] prevent Qemu from waking up needlessly Stefano Stabellini
2011-11-15 14:48 ` Stefano Stabellini
2011-11-15 14:51 ` [Qemu-devel] [PATCH 1/4] xen: introduce mc146818rtcxen stefano.stabellini
2011-11-15 14:51   ` stefano.stabellini
2011-11-15 14:54   ` [Qemu-devel] " Anthony Liguori
2011-11-15 14:54     ` Anthony Liguori
2011-11-15 16:57     ` [Qemu-devel] " Stefano Stabellini
2011-11-18 11:46       ` Stefano Stabellini
2011-11-18 11:46         ` Stefano Stabellini
2011-11-18 13:58         ` [Qemu-devel] " Anthony Liguori
2011-11-18 13:58           ` Anthony Liguori
2011-11-18 14:54         ` [Qemu-devel] " Anthony Liguori
2011-11-18 14:54           ` Anthony Liguori
2011-11-20 14:53           ` [Qemu-devel] " Avi Kivity
2011-11-20 14:53             ` Avi Kivity
2011-11-21 20:49             ` Anthony Liguori [this message]
2011-11-21 20:49               ` Anthony Liguori
2011-11-21 11:05           ` [Qemu-devel] " Stefano Stabellini
2011-11-21 11:05             ` Stefano Stabellini
2011-11-21 13:21           ` [Qemu-devel] " Paolo Bonzini
2011-11-21 13:21             ` Paolo Bonzini
2011-11-15 14:51 ` [Qemu-devel] [PATCH 2/4] xen: do not initialize the interval timer emulator stefano.stabellini
2011-11-15 14:51   ` stefano.stabellini
2011-11-15 14:51 ` [Qemu-devel] [PATCH 3/4] xen: introduce an event channel for buffered io event notifications stefano.stabellini
2011-11-15 14:51   ` stefano.stabellini
2011-11-15 17:13   ` [Qemu-devel] [Xen-devel] " Ian Campbell
2011-11-15 17:13     ` Ian Campbell
2011-11-15 17:20     ` [Qemu-devel] " Stefano Stabellini
2011-11-15 17:20       ` Stefano Stabellini
2011-11-15 17:24       ` [Qemu-devel] " Ian Campbell
2011-11-15 17:24         ` Ian Campbell
2011-11-15 14:51 ` [Qemu-devel] [PATCH 4/4] qemu_calculate_timeout: increase minimum timeout to 1h stefano.stabellini
2011-11-15 14:51   ` stefano.stabellini

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=4ECAB95C.5010304@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.