public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] RDSEED support for the Linux kernel
@ 2014-03-17 23:36 H. Peter Anvin
  2014-03-17 23:36 ` [PATCH v2 1/4] x86, random: Enable the RDSEED instruction H. Peter Anvin
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: H. Peter Anvin @ 2014-03-17 23:36 UTC (permalink / raw)
  To: Ted Ts'o, Linus Torvalds, Ingo Molnar, Thomas Gleixner
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Linux Kernel Mailing List, H. Peter Anvin

Upcoming Intel silicon adds a new RDSEED instruction.  Whereas RDRAND
returns output from a PRNG, the RDSEED instruction returns fully
conditioned entropy that is suitable for use as seeds to a PRNG.

This patchset adds support for RDSEED in the Linux kernel in three
places:

1. During bootup, use RDSEED to initialize the entropy pool if
   available (we already use RDRAND for this).  We don't add any
   credit at this point, but it will give much better starting point.

2. In the slow path to add_interrupt_randomness, executed once per
   second, we take a single RDSEED sample and mix it into the entropy
   pool, crediting it at 50% of its rated entropy.  This was suggested
   by Linus.

3. If we are about to block on /dev/random due to lack of entropy,
   attempt an "emergency pool refill" using RDSEED.

Changes since version 1:

a. Rebased on top of random.git:dev.
b. Unbreak the PowerPC build (I had managed to miss that PowerPC had
   grown archrandom.h support.)
c. Remove duplicate dummy function definitions in <linux/random.h>.
d. Add a fourth patch containing a microoptimization: avoid the loop
   in arch_random_refill() if arch_get_random_seed*() is unavailable.

Comments are, of course, appreciated.

Ted, if you are OK with this could you add this to random.git:dev so
linux-next can pick it up?

	-hpa

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-03-18 21:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-17 23:36 [PATCH v2 0/4] RDSEED support for the Linux kernel H. Peter Anvin
2014-03-17 23:36 ` [PATCH v2 1/4] x86, random: Enable the RDSEED instruction H. Peter Anvin
2014-03-17 23:36 ` [PATCH v2 2/4] random: Use arch_get_random_seed*() at init time and once a second H. Peter Anvin
2014-03-17 23:36 ` [PATCH v2 3/4] random: If we have arch_get_random_seed*(), try it before blocking H. Peter Anvin
2014-03-17 23:36 ` [PATCH v2 4/4] random: Add arch_has_random[_seed]() H. Peter Anvin
2014-03-18  3:44   ` Benjamin Herrenschmidt
2014-03-18 18:56     ` H. Peter Anvin
2014-03-18 21:52 ` [PATCH v2 0/4] RDSEED support for the Linux kernel tytso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox