qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: Fix ptimer_get_count overflow.


From: Paul Brook
Subject: Re: [Qemu-devel] Re: Fix ptimer_get_count overflow.
Date: Tue, 31 Mar 2009 14:38:26 +0000
User-agent: KMail/1.9.9

On Wednesday 04 March 2009, Vladimir Prus wrote:
> Vladimir Prus wrote:
> > At present, ptimers have a slight inaccuracy that can lead to
> > overflow. The period is stored as 64.32 fixed point number.
> > ptimer_reload uses both integer and fractional part of the perion
> > when computing when the next event should happen. ptimer_get_count,
> > however, uses only integer part of the period. Therefore, when
> > ptimer_get_count is called very soon after ptimer_reload the value
> > returned may be greater than the value ptimer_reload has set.
> > And if the counter was 0xFFFFFFFF, this may result in overflow.

I think your patch has problems with out of range shift counts, so I applied a 
slightly different version.

Paul




reply via email to

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