From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0TLB-0007Bq-5A for qemu-devel@nongnu.org; Thu, 23 Feb 2012 02:43:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0TL7-0004xK-7S for qemu-devel@nongnu.org; Thu, 23 Feb 2012 02:43:49 -0500 Received: from mail-ee0-f45.google.com ([74.125.83.45]:33782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0TL7-0004xC-1J for qemu-devel@nongnu.org; Thu, 23 Feb 2012 02:43:45 -0500 Received: by eekd17 with SMTP id d17so363171eek.4 for ; Wed, 22 Feb 2012 23:43:44 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4F45EE2E.2050207@redhat.com> Date: Thu, 23 Feb 2012 08:43:42 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <4F41F91F.7060206@redhat.com> <4F44CF3B.9010208@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 0/4] RTC: New logic to emulate RTC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Zhang, Yang Z" Cc: "aliguori@us.ibm.com" , Marcelo Tosatti , Jan Kiszka , "qemu-devel@nongnu.org" , "kvm@vger.kernel.org" On 02/23/2012 02:49 AM, Zhang, Yang Z wrote: >> Currently they hang very early because UF is not set. I >> attempted to fix that, but ran into other problems. UIP seems >> not to be really in sync with the update interrupt, because the >> 500 ms update tests pass when testing UIP, but not when testing >> UF. (Another reason why I wanted to have the 500 ms rule: it >> improves reliability of tests!) > > The current logic is not correct: It check the UIP with rtc clock and > use a timer to set UF bit. Since the delay of the timer, those two do > not in sync in some cases. Now, I separate UF logic from update > interrupt. And base it on UIP. With this changed, it works. I'm not sure I understand, UIP and UF are indeed the same logic (UIP is 1 between the rising and falling edge; UF becomes 1 on the falling edge), but they are also the same thing as the interrupt. UIE only says whether an interrupt is raised on the rising edge of UF. So, merging the handling of UF and UIP makes sense, but separating the two from the interrupt seems wrong. Paolo