All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Zhang, Yang Z" <yang.z.zhang@intel.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"avi@redhat.com" <avi@redhat.com>,
	"aliguori@us.ibm.com" <aliguori@us.ibm.com>,
	"Zhang, Xiantao" <xiantao.zhang@intel.com>,
	"Shan, Haitao" <haitao.shan@intel.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 3/3] stop the periodic RTC update timer
Date: Mon, 09 Jan 2012 09:19:02 +0100	[thread overview]
Message-ID: <4F0AA2F6.20005@redhat.com> (raw)
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E018CDB@SHSMSX101.ccr.corp.intel.com>

On 01/06/2012 08:37 AM, Zhang, Yang Z wrote:
>           VMSTATE_BUFFER(cmos_data, RTCState),
>           VMSTATE_UINT8(cmos_index, RTCState),
> -        VMSTATE_INT32(current_tm.tm_sec, RTCState),
> -        VMSTATE_INT32(current_tm.tm_min, RTCState),
> -        VMSTATE_INT32(current_tm.tm_hour, RTCState),
> -        VMSTATE_INT32(current_tm.tm_wday, RTCState),
> -        VMSTATE_INT32(current_tm.tm_mday, RTCState),
> -        VMSTATE_INT32(current_tm.tm_mon, RTCState),
> -        VMSTATE_INT32(current_tm.tm_year, RTCState),
> +        VMSTATE_INT64(offset, RTCState),
>           VMSTATE_TIMER(periodic_timer, RTCState),
>           VMSTATE_INT64(next_periodic_time, RTCState),
> -        VMSTATE_INT64(next_second_time, RTCState),
> -        VMSTATE_TIMER(second_timer, RTCState),
> -        VMSTATE_TIMER(second_timer2, RTCState),
> +        VMSTATE_TIMER(update_timer, RTCState),
> +        VMSTATE_INT64(next_update_time, RTCState),
> +        VMSTATE_TIMER(alarm_timer, RTCState),
> +        VMSTATE_INT64(next_alarm_time, RTCState),

Hi Yang,

this looks like a very nice piece of work, but this unfortunately breaks 
migration.  Also, I'm not sure if the update in progress flag still 
works.  Clients are supposed to wait for UIP=0 before reading the RTC, 
and an update is supposed to be at least 220 microseconds away when UIP=0.

Also, it would be nice if you could based these patches on the 4-patch 
series I sent recently that fixes some bugs with interrupts and 12-hour 
emulation.

There is another aspect of RTC emulation that is missing in the current 
code; after setting the clock, the next second tick will occur in 
exactly 500 ms.  I have patches to fix this, but it looks like it could 
be incorporated in your series, too.

Paolo

WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Zhang, Yang Z" <yang.z.zhang@intel.com>
Cc: "aliguori@us.ibm.com" <aliguori@us.ibm.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"Shan, Haitao" <haitao.shan@intel.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"avi@redhat.com" <avi@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/3] stop the periodic RTC update timer
Date: Mon, 09 Jan 2012 09:19:02 +0100	[thread overview]
Message-ID: <4F0AA2F6.20005@redhat.com> (raw)
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E018CDB@SHSMSX101.ccr.corp.intel.com>

On 01/06/2012 08:37 AM, Zhang, Yang Z wrote:
>           VMSTATE_BUFFER(cmos_data, RTCState),
>           VMSTATE_UINT8(cmos_index, RTCState),
> -        VMSTATE_INT32(current_tm.tm_sec, RTCState),
> -        VMSTATE_INT32(current_tm.tm_min, RTCState),
> -        VMSTATE_INT32(current_tm.tm_hour, RTCState),
> -        VMSTATE_INT32(current_tm.tm_wday, RTCState),
> -        VMSTATE_INT32(current_tm.tm_mday, RTCState),
> -        VMSTATE_INT32(current_tm.tm_mon, RTCState),
> -        VMSTATE_INT32(current_tm.tm_year, RTCState),
> +        VMSTATE_INT64(offset, RTCState),
>           VMSTATE_TIMER(periodic_timer, RTCState),
>           VMSTATE_INT64(next_periodic_time, RTCState),
> -        VMSTATE_INT64(next_second_time, RTCState),
> -        VMSTATE_TIMER(second_timer, RTCState),
> -        VMSTATE_TIMER(second_timer2, RTCState),
> +        VMSTATE_TIMER(update_timer, RTCState),
> +        VMSTATE_INT64(next_update_time, RTCState),
> +        VMSTATE_TIMER(alarm_timer, RTCState),
> +        VMSTATE_INT64(next_alarm_time, RTCState),

Hi Yang,

this looks like a very nice piece of work, but this unfortunately breaks 
migration.  Also, I'm not sure if the update in progress flag still 
works.  Clients are supposed to wait for UIP=0 before reading the RTC, 
and an update is supposed to be at least 220 microseconds away when UIP=0.

Also, it would be nice if you could based these patches on the 4-patch 
series I sent recently that fixes some bugs with interrupts and 12-hour 
emulation.

There is another aspect of RTC emulation that is missing in the current 
code; after setting the clock, the next second tick will occur in 
exactly 500 ms.  I have patches to fix this, but it looks like it could 
be incorporated in your series, too.

Paolo

  parent reply	other threads:[~2012-01-09  8:19 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-06  7:37 [PATCH 3/3] stop the periodic RTC update timer Zhang, Yang Z
2012-01-06  7:37 ` [Qemu-devel] " Zhang, Yang Z
2012-01-06 17:26 ` Jan Kiszka
2012-01-06 17:26   ` [Qemu-devel] " Jan Kiszka
2012-01-09  7:10   ` Zhang, Yang Z
2012-01-09  7:10     ` [Qemu-devel] " Zhang, Yang Z
2012-01-09  8:19 ` Paolo Bonzini [this message]
2012-01-09  8:19   ` Paolo Bonzini
2012-01-10  6:37   ` Zhang, Yang Z
2012-01-10  6:37     ` [Qemu-devel] " Zhang, Yang Z
2012-01-10  9:24     ` Paolo Bonzini
2012-01-10  9:24       ` [Qemu-devel] " Paolo Bonzini
2012-01-11  0:56       ` Zhang, Yang Z
2012-01-11  0:56         ` [Qemu-devel] " Zhang, Yang Z
2012-01-11  7:24         ` Paolo Bonzini
2012-01-11  7:24           ` [Qemu-devel] " Paolo Bonzini
2012-01-12  0:51           ` Zhang, Yang Z
2012-01-12  0:51             ` [Qemu-devel] " Zhang, Yang Z
2012-01-12  9:41             ` Paolo Bonzini
2012-01-11  7:25         ` [Qemu-devel] " Philipp Hahn
2012-01-11 13:10 ` Marcelo Tosatti
2012-01-11 13:10   ` [Qemu-devel] " Marcelo Tosatti
2012-01-12  0:00   ` Zhang, Yang Z
2012-01-12  0:00     ` [Qemu-devel] " Zhang, Yang Z
2012-01-12  9:26     ` Paolo Bonzini
2012-01-12  9:26       ` [Qemu-devel] " Paolo Bonzini
2012-01-12 10:20       ` Marcelo Tosatti
2012-01-12 10:20         ` [Qemu-devel] " Marcelo Tosatti
2012-01-12 10:43         ` Paolo Bonzini
2012-01-12 10:43           ` [Qemu-devel] " Paolo Bonzini
2012-01-12  9:59     ` Marcelo Tosatti
2012-01-12  9:59       ` [Qemu-devel] " Marcelo Tosatti
2012-01-12 10:03       ` Marcelo Tosatti
2012-01-12 10:03         ` [Qemu-devel] " Marcelo Tosatti
2012-01-12 10:12         ` Zhang, Yang Z
2012-01-12 10:12           ` [Qemu-devel] " Zhang, Yang Z

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=4F0AA2F6.20005@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=haitao.shan@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=xiantao.zhang@intel.com \
    --cc=yang.z.zhang@intel.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.