mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Andi Kleen <ak@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Use 64bit timer values while calibrating BogoMips
Date: Wed, 31 Oct 2007 09:31:00 -0700	[thread overview]
Message-ID: <20071031093100.3a1542b0@laptopd505.fenrus.org> (raw)
In-Reply-To: <200710311652.16776.ak@suse.de>

On Wed, 31 Oct 2007 16:52:16 +0100
Andi Kleen <ak@suse.de> wrote:

> 
> When calibrating BogoMips 32bit architectures using 
> read_current_timer will truncate the timer value to 32bit.
> This is a problem on x86 when the TSC timer is already beyond
> 2^32-1 or wraps during the calibration. The current code
> has no wrap handling.  
> 
> This could potentially lead to wrong BogoMips, causing 
> incorrect delays e.g. in hardware drivers and then difficult
> to track down bugs.

bogomips tends to not be used for that nowadays
> 
> Change read_current_timer() to always return a 64bit
> value even on 32bit and do the computation in 64bit.
> 
> Only found by code inspection; i haven't seen a failure 
> in the wild.
> 
> avr32/sparc64 read_current_timer() updated, but I haven't 
> compiled/tested them.

one general comment, if you really want 64 bit... you're using
"unsigned long long" all over, just use u64 instead.


-- 
If you want to reach me at my work email, use arjan@linux.intel.com
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

  reply	other threads:[~2007-10-31 16:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-31 15:52 Andi Kleen
2007-10-31 16:31 ` Arjan van de Ven [this message]
2007-10-31 16:47   ` Andi Kleen

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=20071031093100.3a1542b0@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®