[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: Fix ptimer_get_count overflow.
From: |
Vladimir Prus |
Subject: |
[Qemu-devel] Re: Fix ptimer_get_count overflow. |
Date: |
Wed, 04 Mar 2009 12:31:29 +0300 |
User-agent: |
KNode/0.10.9 |
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.
>
> This was observed in SH4A emulation as "time jumps", where system
> time gets magically increased by 10 minutes sometimes.
>
> This patch fixes this. The math is not the most accurate possible,
> but it's relatively fast and fixes the problems.
Ping?
- Volodya
primer_overflow.diff
Description: Text Data
- [Qemu-devel] Re: Fix ptimer_get_count overflow.,
Vladimir Prus <=