From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LvBwy-0004HZ-Ib for qemu-devel@nongnu.org; Sat, 18 Apr 2009 10:55:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LvBwt-0004FX-F8 for qemu-devel@nongnu.org; Sat, 18 Apr 2009 10:55:23 -0400 Received: from [199.232.76.173] (port=44711 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LvBwt-0004FL-96 for qemu-devel@nongnu.org; Sat, 18 Apr 2009 10:55:19 -0400 Received: from e7.ny.us.ibm.com ([32.97.182.137]:53022) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LvBws-0005Vh-Dk for qemu-devel@nongnu.org; Sat, 18 Apr 2009 10:55:18 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e7.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n3IEj5tG021261 for ; Sat, 18 Apr 2009 10:45:05 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n3IEtHjH187522 for ; Sat, 18 Apr 2009 10:55:17 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n3IErWwG030255 for ; Sat, 18 Apr 2009 10:53:32 -0400 Received: from squirrel.codemonkey.ws (sig-9-65-8-246.mts.ibm.com [9.65.8.246]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n3IErV3b029702 for ; Sat, 18 Apr 2009 10:53:31 -0400 Message-ID: <49E9E9D2.509@us.ibm.com> Date: Sat, 18 Apr 2009 09:55:14 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Change RTC time drift IRQ re-injection References: <20090406132526.GA9153@redhat.com> In-Reply-To: <20090406132526.GA9153@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: 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 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. -- Regards, Anthony Liguori