Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken rdrand implementation #154

Merged
merged 1 commit into from
Jan 15, 2021
Merged

Fix broken rdrand implementation #154

merged 1 commit into from
Jan 15, 2021

Conversation

josephlr
Copy link
Contributor

_rdrand{32,64}_step returns 1 on success and zero on failure. See:
https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rdrand64_step&expand=4539

This means that the current implementation will actually hang on most processors:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=716f8f6a77ab6be76800ff7ee5d37970

This fixes the implementation to use the reccomdendation from the Intel SDM.

Signed-off-by: Joe Richey joerichey@google.com

_rdrand{32,64}_step returns 1 on success and zero on failure. See:
  https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rdrand64_step&expand=4539

This means that the current implementation will actually hang on most processors:
  https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=716f8f6a77ab6be76800ff7ee5d37970

This fixes the implementation to use the reccomdendation from the Intel SDM.

Signed-off-by: Joe Richey <joerichey@google.com>
@stlankes
Copy link
Contributor

bors r+

@bors bors bot merged commit e843dac into hermit-os:master Jan 15, 2021
simonschoening pushed a commit to simonschoening/libhermit-rs that referenced this pull request Aug 26, 2021
154: Fix broken rdrand implementation r=stlankes a=josephlr

_rdrand{32,64}_step returns 1 on success and zero on failure. See:
  https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rdrand64_step&expand=4539

This means that the current implementation will actually hang on most processors:
  https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=716f8f6a77ab6be76800ff7ee5d37970

This fixes the implementation to use the reccomdendation from the Intel SDM.

Signed-off-by: Joe Richey <joerichey@google.com>

Co-authored-by: Joe Richey <joerichey@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants