qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v10 2/7] hw/ptimer: Perform tick and counter wra


From: Dmitry Osipenko
Subject: Re: [Qemu-devel] [PATCH v10 2/7] hw/ptimer: Perform tick and counter wrap around if timer already expired
Date: Wed, 20 Jan 2016 20:03:47 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

Hi Peter,

10.01.2016 03:44, Peter Crosthwaite пишет:
On Sat, Jan 9, 2016 at 9:39 AM, Dmitry Osipenko <address@hidden> wrote:
[cut]
In addition, there is no reason to keep expired timer tick deferred, so
just perform the tick from ptimer_get_count().

[cut]

I noticed an issue here... The problem is that device reset invokes ptimer_stop() that invokes ptimer_get_count() that might cause the tick after reset, i.e. bogus bh would be invoked after QEMU reset. I have reproduced that issue.

The solution might be to introduce ptimer_reset() that would stop QEMU timer and reset delta/load/period without invoking ptimer_get_count. And of course all devices should be updated to use new ptimer_reset() prior to "Perform tick and counter wrap around if timer already expired" patch, but that's not an issue I suppose. Please let me know if you have any objections, I'm leaning to do it in V11.

void ptimer_reset(ptimer_state *s)
{
    timer_del(s->timer);
    s->enabled = 0;
    s->period_frac = 0;
    s->period = 0;
    s->delta = 0;
    s->limit = 0;
}

--
Dmitry



reply via email to

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