Re: [PATCH] mc146818rtc: fix timer interrupt reinjection

2019-10-10 Thread Marcelo Tosatti
On Wed, Oct 09, 2019 at 11:13:16PM +0200, Paolo Bonzini wrote: > On 09/10/19 20:40, Marcelo Tosatti wrote: > > s->period = period; > > lost_clock += old_irq_coalesced * old_period; > > -s->irq_coalesced = lost_clock / s->period; > > +if (old_period)

Re: [PATCH] mc146818rtc: fix timer interrupt reinjection

2019-10-09 Thread Paolo Bonzini
On 09/10/19 20:40, Marcelo Tosatti wrote: > s->period = period; > lost_clock += old_irq_coalesced * old_period; > -s->irq_coalesced = lost_clock / s->period; > +if (old_period) { > +s->irq_coalesced = lost_clock / s->period; > +

[PATCH] mc146818rtc: fix timer interrupt reinjection

2019-10-09 Thread Marcelo Tosatti
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 N