[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Change RTC time drift IRQ re-injection

From: Dor Laor
Subject: Re: [Qemu-devel] [PATCH] Change RTC time drift IRQ re-injection
Date: Sun, 19 Apr 2009 17:06:42 +0300
User-agent: Thunderbird (X11/20090105)

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

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 <address@hidden>
             s->cmos_data[RTC_REG_C] = 0x00;
@@ -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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]