8000 Disable CRYPTO_is_AVX512IFMA_capable by justsmth · Pull Request #1858 · aws/aws-lc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Disable CRYPTO_is_AVX512IFMA_capable #1858

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 2 commits into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions crypto/fipsmodule/cpucap/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,12 @@ OPENSSL_INLINE int CRYPTO_is_SHAEXT_capable(void) {
return (OPENSSL_ia32cap_get()[2] & (1 << 29)) != 0;
}

// AVX512VL | AVX512BW | AVX512DQ | AVX512F
// 1u << 31 | 1u << 30 | 1u << 17 | 1u << 16
// 1100_0000_0000_0011_0000_0000_0000_0000
#define CPU_CAP_AVX512_BITFLAGS 0xC0030000
OPENSSL_INLINE int CRYPTO_is_AVX512_capable(void) {
return (OPENSSL_ia32cap_get()[2] & 0xC0030000) == 0xC0030000;
return (OPENSSL_ia32cap_get()[2] & CPU_CAP_AVX512_BITFLAGS) == CPU_CAP_AVX512_BITFLAGS;
}

OPENSSL_INLINE int CRYPTO_is_VAES_capable(void) {
Expand All @@ -131,8 +135,15 @@ OPENSSL_INLINE int CRYPTO_is_VPCLMULQDQ_capable(void) {
return (OPENSSL_ia32cap_get()[3] & (1u << (42 - 32))) != 0;
}

// AVX512VL | AVX512BW | AVX512_IFMA | AVX512DQ | AVX512F
// 1u << 31 | 1u << 30 | 1u << 21 | 1u << 17 | 1u << 16
// 1100_0000_0010_0011_0000_0000_0000_0000
#define CPU_CAP_AVX512IFMA_BITFLAGS 0xC0230000
OPENSSL_INLINE int CRYPTO_is_AVX512IFMA_capable(void) {
return (OPENSSL_ia32cap_get()[3] & (1u << 31 | 1u << 21 |1u << 17 | 1u << 16)) != 0;
return 0;
// TODO: Re-enable once we understand Windows test failures.
// return (OPENSSL_ia32cap_get()[2] & CPU_CAP_AVX512IFMA_BITFLAGS) ==
// CPU_CAP_AVX512IFMA_BITFLAGS;
}

OPENSSL_INLINE int CRYPTO_is_VBMI2_capable(void) {
Expand Down
Loading
0