From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v2 0/4] RTC: New logic to emulate RTC Date: Thu, 23 Feb 2012 08:43:42 +0100 Message-ID: <4F45EE2E.2050207@redhat.com> References: <4F41F91F.7060206@redhat.com> <4F44CF3B.9010208@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "aliguori@us.ibm.com" , Marcelo Tosatti , Jan Kiszka , "qemu-devel@nongnu.org" , "kvm@vger.kernel.org" To: "Zhang, Yang Z" Return-path: Received: from mail-ee0-f46.google.com ([74.125.83.46]:54841 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751479Ab2BWHnp (ORCPT ); Thu, 23 Feb 2012 02:43:45 -0500 Received: by eekc4 with SMTP id c4so266472eek.19 for ; Wed, 22 Feb 2012 23:43:44 -0800 (PST) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: 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