Skip to content

cpufeatures: check AVX availability when detecting AVX2 and FMA #792

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

Merged
merged 3 commits into from
Aug 18, 2022

Conversation

newpavlov
Copy link
Member

We must do it according to the Intel manual. Our non-conformance has caused issues with the sha2 crate.

Strictly speaking, during detection of AVX we also should use XGETBV to check whether XMM and YMM states are enabled by OS, but I think it's worth to do it later in a separate PR.

cc @brocaar

@newpavlov newpavlov requested a review from tarcieri August 16, 2022 16:42
@brocaar
Copy link

brocaar commented Aug 18, 2022

After merging, could you create a new (minor) release of this crate?

@newpavlov newpavlov merged commit b637d94 into master Aug 18, 2022
@newpavlov newpavlov deleted the avx2_fix branch August 18, 2022 09:57
@newpavlov
Copy link
Member Author

@brocaar
Done. Can you verify that the new version of cpufeatures fixes the sha2 issue?

@brocaar
Copy link

brocaar commented Aug 18, 2022

I'm currently recompiling with cpufeatures updated to v0.2.3, I will let you know if this solves the issue.

@brocaar
Copy link

brocaar commented Aug 18, 2022

@newpavlov I can confirm that this update solved RustCrypto/hashes#386.

Thanks for your support!

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.

3 participants