lkml.org 
[lkml]   [2007]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Use 64bit timer values while calibrating BogoMips
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-10-31 18:07    [W:0.021 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site