OSDN Git Service

mc146818rtc: fix timer interrupt reinjection
authorMarcelo Tosatti <mtosatti@redhat.com>
Thu, 10 Oct 2019 12:30:08 +0000 (09:30 -0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 22 Oct 2019 07:38:38 +0000 (09:38 +0200)
commitb429de730174b388ea5760e3debb0d542ea3c261
treebb4e25d48417b7146908ba771241a23ed15f693e
parent73284563dce268bade300370a8b20728d3866afe
mc146818rtc: fix timer interrupt reinjection

commit 369b41359af46bded5799c9ef8be2b641d92e043 broke timer interrupt
reinjection when there is no period change by the guest.

In that case, old_period is 0, which ends up zeroing irq_coalesced
(counter of reinjected interrupts).

The consequence is Windows 7 is unable to synchronize time via NTP.
Easily reproducible by playing a fullscreen video with cirrus and VNC.

Fix by not updating s->irq_coalesced when old_period is 0.

V2: reorganize code (Paolo Bonzini)

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Message-Id: <20191010123008.GA19158@amt.cnet>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/timer/mc146818rtc.c