From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlGvS-0008Lz-AU for qemu-devel@nongnu.org; Thu, 12 Jan 2012 04:26:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RlGvM-0001dk-Q4 for qemu-devel@nongnu.org; Thu, 12 Jan 2012 04:26:26 -0500 Received: from mail-we0-f173.google.com ([74.125.82.173]:46241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlGvM-0001dd-Cj for qemu-devel@nongnu.org; Thu, 12 Jan 2012 04:26:20 -0500 Received: by werb10 with SMTP id b10so1503050wer.4 for ; Thu, 12 Jan 2012 01:26:19 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4F0EA739.1040707@redhat.com> Date: Thu, 12 Jan 2012 10:26:17 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20120111131004.GA18178@amt.cnet> 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" , Marcelo Tosatti , "Shan, Haitao" , "qemu-devel@nongnu.org" , "avi@redhat.com" On 01/12/2012 01:00 AM, Zhang, Yang Z wrote: >> Regarding the UIP bit, a guest could read it in a loop and wait >> for the value to change. But you can emulate it in >> cmos_ioport_read by reading the host time, that is, return 1 >> during 244us, 0 for remaining of the second, and have that in >> sync with update-cycle-ended interrupt if its enabled. > > Yes. Guest may use the loop to read RTC, but the point is the guest > is waiting for the UIP changed to 0. If this bit always equal to 0 , > guest will never go into the loop. For real RTC, this may wrong, > because the RTC cannot give you the valid value during the update > cycle. But the virtual RTC doesn't' need this logic, whenever you > read it, it will always return the right value to you. The point is not _correctness_. It is _atomicity_. Paolo