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)
Fri, Apr 19, 1:24 AM
Unknown Object (File)
Mon, Apr 8, 3:25 PM
Unknown Object (File)
Jan 4 2024, 2:43 PM
Unknown Object (File)
Dec 31 2023, 7:19 AM
Unknown Object (File)
Dec 19 2023, 9:05 PM
Unknown Object (File)
Nov 11 2023, 6:27 PM
Unknown Object (File)
Nov 10 2023, 10:46 PM
Unknown Object (File)
Oct 13 2023, 3:15 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 24148
Build 23000: 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
84

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

98

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

sys/dev/random/ivy.c
84

Will fix. :)

98

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.