qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: Vladimir Prus <vladimir@codesourcery.com>
Subject: Re: [Qemu-devel] Re: Fix ptimer_get_count overflow.
Date: Tue, 31 Mar 2009 14:38:26 +0000	[thread overview]
Message-ID: <200903311538.26753.paul@codesourcery.com> (raw)
In-Reply-To: <golhpd$sm5$1@ger.gmane.org>

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	other threads:[~2009-03-31 14:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-12 14:33 [Qemu-devel] Fix ptimer_get_count overflow Vladimir Prus
2009-03-04  9:31 ` [Qemu-devel] " Vladimir Prus
2009-03-31 14:38   ` Paul Brook [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200903311538.26753.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vladimir@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).