]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
openssl: Fix detection of ARMv7 and ARM64 CPU features
authorAllan Jude <allanjude@FreeBSD.org>
Fri, 19 Nov 2021 15:14:30 +0000 (15:14 +0000)
committerAllan Jude <allanjude@FreeBSD.org>
Mon, 22 Nov 2021 18:59:32 +0000 (18:59 +0000)
commit8ffcfb399b20f027cb50afe41c7f83c52c008191
treebc8d3016e20971a1fb5c6049eef1da1870a861c7
parent68396709e73a4cd392ffc06fde6bfa44d79118a7
openssl: Fix detection of ARMv7 and ARM64 CPU features

OpenSSL assumes the same value for AT_HWCAP=16 (Linux)
So it ends up calling elf_auxv_info() with AT_CANARY which
returns ENOENT, and all acceleration features are disabled.

With this, my ARM64 test machine runs the benchmark
`openssl speed -evp aes-256-gcm` nearly 20x faster
going from 100 MB/sec to 2000 MB/sec

It also improves sha256 from 300 MB/sec to 1800 MB/sec

This fix has been accepted but not yet merged upstream:
https://github.com/openssl/openssl/pull/17082

PR: 259937
Reviewed by: manu, imp
Approved by: re (gjb)
Relnotes: yes
Fixes: 88e852c0b5c872b1a ("OpenSSL: Merge OpenSSL 1.1.1j")
Sponsored by: Ampere Computing LLC
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D33060

(cherry picked from commit d9bb798725cfce9c72b80440659b48e8668eb10d)
(cherry picked from commit 0ed191d116f511c1e67338f05386d87aad53076f)
crypto/openssl/crypto/armcap.c