Subject: Re: new MI/MD interface for rnd(4)
To: None <thorpej@zembu.com>
From: Colin Wood <cwood@ichips.intel.com>
List: tech-kern
Date: 06/06/2000 14:13:12
Jason R Thorpe wrote:
> On Mon, Jun 05, 2000 at 05:50:12PM -0700, Colin Wood wrote:
> 
>  > Is a 32-bit number big enough?  On a sufficiently fast IA32 processor,
>  > that counter (assuming you're using the timestamp counter) can overflow
>  > within a relatively short period of time (4s on currently shipping
>  > processors).  It is forseeable that it could overflow in less than a
>  > second on processors shipping within the next few years. I don't know
>  > enough about how often rnd.c samples, tho, so this might not be a
>  > problem...
> 
> Not only that, but the TSC return value is 64-bit, right?  Also, the
> Alpha `rpcc' intruction returns a 64-bit value, so I'd think this
> would be 64-bit, at least.

yes, RDTSC should return a 64-bit number.  hopefully these new routines
are picking the proper 32 bits as the upper 32 bits (in EDX) only change
every few seconds.  if bill is just trying to read some random value, then
i guess only using the lower 32 bits is fine.  relying on only 32-bits as
a true timestamp can cause some nasty problems, tho.  i believe we found a
bug in linux's MP initialization code a few months back due to this (they
were storing the counter in a 32-bit integer which overflowed and caused a
divide error).  i think the problem has been fixed, now, tho.

-colin



-- 
Colin Wood                                 cwood@ichips.intel.com
Component Design Engineer - DPG                 Intel Corporation
-----------------------------------------------------------------
I speak only on my own behalf, not for my employer.