mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: "Theodore Ts'o" <tytso@mit.edu>,
	"H. Peter Anvin" <hpa@linux.intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	greg@kroah.com, w@1wt.eu, ewust@umich.edu, zakir@umich.edu,
	mpm@selenic.com, nadiah@cs.ucsd.edu, jhalderm@umich.edu,
	tglx@linutronix.de, davem@davemloft.net, mingo@kernel.org,
	DJ Johnston <dj.johnston@intel.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH RFC] random: Account for entropy loss due to overwrites
Date: Tue, 16 Oct 2012 09:10:58 -0700	[thread overview]
Message-ID: <507D8712.4050008@zytor.com> (raw)
In-Reply-To: <20121016155307.GF17446@thunk.org>

On 10/16/2012 08:53 AM, Theodore Ts'o wrote:
> 
> ... and it looks like include/linux/log2.h already has a definition
> for ilog2() which should definitely work for all versions of gcc, so
> we could do this instead:
> 
> #define shiftbits(w)	(ilog2((w)) + 5)
> 
> 	/* x^128 + x^103 + x^76 + x^51 +x^25 + x + 1 -- 105 */
> 	{ shiftbits(128), 103,	76,	51,	25,	1 },
> 	/* x^32 + x^26 + x^20 + x^14 + x^7 + x + 1 -- 15 */
> 	{ shiftbits(32),  26,	20,	14,	7,	1 },
> 

OK, works for me.  I'll rev the patch later this week.

	-hpa



      reply	other threads:[~2012-10-16 16:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-13 17:26 H. Peter Anvin
2012-08-15 19:30 ` Matt Mackall
2012-08-15 20:37   ` H. Peter Anvin
2012-09-29 19:47 ` H. Peter Anvin
2012-10-16  4:08   ` Theodore Ts'o
2012-10-16  4:45     ` H. Peter Anvin
2012-10-16 15:53       ` Theodore Ts'o
2012-10-16 16:10         ` H. Peter Anvin [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=507D8712.4050008@zytor.com \
    --to=hpa@zytor.com \
    --cc=davem@davemloft.net \
    --cc=dj.johnston@intel.com \
    --cc=ewust@umich.edu \
    --cc=greg@kroah.com \
    --cc=hpa@linux.intel.com \
    --cc=jhalderm@umich.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mpm@selenic.com \
    --cc=nadiah@cs.ucsd.edu \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tytso@mit.edu \
    --cc=w@1wt.eu \
    --cc=zakir@umich.edu \
    /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

Powered by JetHome