From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LvXf6-0002MD-EU for qemu-devel@nongnu.org; Sun, 19 Apr 2009 10:06:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LvXf1-0002LO-IY for qemu-devel@nongnu.org; Sun, 19 Apr 2009 10:06:23 -0400 Received: from [199.232.76.173] (port=56818 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LvXf1-0002LK-CD for qemu-devel@nongnu.org; Sun, 19 Apr 2009 10:06:19 -0400 Received: from mx2.redhat.com ([66.187.237.31]:34006) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LvXf0-0005KC-Qf for qemu-devel@nongnu.org; Sun, 19 Apr 2009 10:06:19 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n3JE6HhH016075 for ; Sun, 19 Apr 2009 10:06:17 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n3JE6Hnh028943 for ; Sun, 19 Apr 2009 10:06:17 -0400 Received: from localhost.localdomain (dhcp-0-217.tlv.redhat.com [10.35.0.217]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n3JE6FBl029987 for ; Sun, 19 Apr 2009 10:06:16 -0400 Message-ID: <49EB2FF2.70806@redhat.com> Date: Sun, 19 Apr 2009 17:06:42 +0300 From: Dor Laor MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Change RTC time drift IRQ re-injection References: <20090406132526.GA9153@redhat.com> <49E9E9D2.509@us.ibm.com> In-Reply-To: <49E9E9D2.509@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Reply-To: dlaor@redhat.com, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Anthony Liguori wrote: > Gleb Natapov wrote: >> Currently IRQ are reinjected as soon as they are acknowledged to >> the RTC, but Windows sometimes do acknowledgement in a loop with >> global interrupt disabled waiting for interrupt to be cleared and >> it does not mask RTC vector in PIC/APIC while doing this. In such >> situation interrupt injection always fails and RTC interrupt is never >> cleared. >> >> Instead of reinjecting coalesced IRQs on acknowledgement the patch below >> reinjects them by accelerating RTC clock a bit. This way RTC interrupt >> is not constantly raced after coalesced interrupt. >> >> Signed-off-by: Gleb Natapov >> s->cmos_data[RTC_REG_C] = 0x00; >> break; >> default: >> @@ -512,6 +539,7 @@ static void rtc_save_td(QEMUFile *f, void *opaque) >> >> qemu_put_be32(f, s->irq_coalesced); >> qemu_put_be32(f, s->period); >> + qemu_put_timer(f, s->coalesced_timer); >> } >> >> static int rtc_load_td(QEMUFile *f, void *opaque, int version_id) >> @@ -523,6 +551,7 @@ static int rtc_load_td(QEMUFile *f, void *opaque, >> int version_id) >> >> s->irq_coalesced = qemu_get_be32(f); >> s->period = qemu_get_be32(f); >> + qemu_get_timer(f, s->coalesced_timer); >> return 0; >> > > If you're adding something to the savevm format, you have to increment > the version_id and handle older versions correctly. > > Actually, it is not a must to save this boolean, you can assume it is set and schedule it for the current time on the load.