Skip to content

Commit

Permalink
Allow aarch64 CPUID capability check for all Linux platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
skmcgrail committed Aug 13, 2024
1 parent 6e8f865 commit 884ee1d
Showing 1 changed file with 0 additions and 7 deletions.
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) {
#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

0 comments on commit 884ee1d

Please sign in to comment.