Page MenuHomeFreeBSD

random: x86 driver: Prefer RDSEED over RDRAND when available
ClosedPublic

Authored by cem on May 8 2019, 12:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 12, 6:28 AM
Unknown Object (File)
Wed, Oct 8, 7:49 AM
Unknown Object (File)
Mon, Oct 6, 2:10 PM
Unknown Object (File)
Sun, Oct 5, 2:15 AM
Unknown Object (File)
Fri, Oct 3, 5:25 PM
Unknown Object (File)
Fri, Oct 3, 9:50 AM
Unknown Object (File)
Wed, Oct 1, 4:52 PM
Unknown Object (File)
Wed, Oct 1, 1:34 PM
Subscribers
None

Details

Summary

Per
https://software.intel.com/en-us/blogs/2012/11/17/the-difference-between-rdrand-and-rdseed
, RDRAND is a PRNG seeded from the same source as RDSEED. The source is
more suitable as PRNG seed material, so prefer it when the RDSEED intrinsic
is available (indicated in CPU feature bits).

Test Plan

Bhyve blocks RDSEED feature bit, unfortunately. So I have not tested RDSEED
functionality of this patch yet.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 24145
Build 22997: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.May 8 2019, 12:17 AM
sys/dev/random/ivy.c
88

Maybe "unsupported compiler" or something. I'd honestly just remove the #ifdef and force compile failure though.

108

I don't think you need the '!!' since these variables are 'bool'.

sys/dev/random/ivy.c
88

Will fix. :)

108

Ah, you're totally right. I'll drop that bit.

cem marked 2 inline comments as done.
  • Drop ifndef wat
  • Drop bangbang "operator" -- bool implicitly coerces on assignment already
This revision now requires review to proceed.May 8 2019, 12:35 AM
This revision is now accepted and ready to land.May 8 2019, 12:35 AM
This revision was automatically updated to reflect the committed changes.