From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkARj-0006gF-UJ for qemu-devel@nongnu.org; Mon, 09 Jan 2012 03:19:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RkARj-00032A-3N for qemu-devel@nongnu.org; Mon, 09 Jan 2012 03:19:11 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:53775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkARi-000321-Sl for qemu-devel@nongnu.org; Mon, 09 Jan 2012 03:19:11 -0500 Received: by iagj37 with SMTP id j37so7563068iag.4 for ; Mon, 09 Jan 2012 00:19:10 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4F0AA2F6.20005@redhat.com> Date: Mon, 09 Jan 2012 09:19:02 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] stop the periodic RTC update timer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Zhang, Yang Z" Cc: "aliguori@us.ibm.com" , "kvm@vger.kernel.org" , "Shan, Haitao" , "qemu-devel@nongnu.org" , "avi@redhat.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