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

Allow aarch64 CPUID capability check for all Linux platforms #1762

Merged
merged 1 commit into from
Aug 14, 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
7 changes: 0 additions & 7 deletions crypto/fipsmodule/cpucap/cpu_aarch64_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ void OPENSSL_cpuid_setup(void) {
static const unsigned long kSHA256 = 1 << 6;
static const unsigned long kSHA512 = 1 << 21;
static const unsigned long kSHA3 = 1 << 17;
#if defined(OPENSSL_ANDROID)
static const unsigned long kCPUID = 1 << 11;
#endif

uint64_t OPENSSL_arm_midr = 0;

Expand Down Expand Up @@ -133,19 +131,14 @@ void OPENSSL_cpuid_setup(void) {
// Before calling armv8_cpuid_probe and reading from MIDR_EL1 check that it
// is supported. As of Valgrind 3.21 trying to read from that register will
// cause Valgrind to crash.

#if defined(OPENSSL_ANDROID)
if (hwcap & kCPUID) {
justsmth marked this conversation as resolved.
Show resolved Hide resolved
#endif
// Check if the CPU model is Neoverse V1,
// which has a wide crypto/SIMD pipeline.
OPENSSL_arm_midr = armv8_cpuid_probe();
if (MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_V1)) {
OPENSSL_armcap_P |= ARMV8_NEOVERSE_V1;
}
#if defined(OPENSSL_ANDROID)
}
#endif

// OPENSSL_armcap is a 32-bit, unsigned value which may start with "0x" to
// indicate a hex value. Prior to the 32-bit value, a '~' or '|' may be given.
Expand Down
Loading