Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Mar 2011 03:45:04 +0300
From:      Maxim Dounin <mdounin@mdounin.ru>
To:        Jung-uk Kim <jkim@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r219679 - head/sys/i386/include
Message-ID:  <20110316004503.GM99496@mdounin.ru>
In-Reply-To: <201103152145.p2FLjAlt060256@svn.freebsd.org>
References:  <201103152145.p2FLjAlt060256@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello!

On Tue, Mar 15, 2011 at 09:45:10PM +0000, Jung-uk Kim wrote:

> Author: jkim
> Date: Tue Mar 15 21:45:10 2011
> New Revision: 219679
> URL: http://svn.freebsd.org/changeset/base/219679
> 
> Log:
>   Partially revert r219672.  After r198295, kernel need to seed randomness as
>   soon as possible for stack protector.  However, dummy timecounter does not

Not after, long before and not only for stack protector.  The 
r198295 somewhat fixes things to actually make some randomness 
available early.

>   have enough entropy and we don't need to sacrifice Pentium class and later.
>   
>   Pointed out by:	Maxim Dounin (mdounin at mdounin dot ru)
> 
> Modified:
>   head/sys/i386/include/cpu.h
> 
> Modified: head/sys/i386/include/cpu.h
> ==============================================================================
> --- head/sys/i386/include/cpu.h	Tue Mar 15 21:34:10 2011	(r219678)
> +++ head/sys/i386/include/cpu.h	Tue Mar 15 21:45:10 2011	(r219679)
> @@ -69,10 +69,14 @@ void	swi_vm(void *);
>  static __inline uint64_t
>  get_cyclecount(void)
>  {
> +#if defined(I486_CPU) || defined(KLD_MODULE)
>  	struct bintime bt;
>  
>  	binuptime(&bt);
>  	return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
> +#else
> +	return (rdtsc());
> +#endif

This isn't really different as long as GENERIC kernel used, as 
GENERIC defines I486_CPU.

Maxim Dounin

>  }
>  
>  #endif
> _______________________________________________
> svn-src-all@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110316004503.GM99496>