Page MenuHomeFreeBSD

openssl: Fix detection of ARMv7 and ARM64 CPU features
ClosedPublic

Authored by allanjude on Nov 19 2021, 3:18 PM.
Tags
None
Referenced Files
F115802955: D33060.diff
Mon, Apr 28, 9:19 PM
Unknown Object (File)
Tue, Apr 15, 6:36 AM
Unknown Object (File)
Wed, Apr 2, 6:59 AM
Unknown Object (File)
Mar 29 2025, 8:41 PM
Unknown Object (File)
Mar 20 2025, 6:34 AM
Unknown Object (File)
Mar 15 2025, 5:30 PM
Unknown Object (File)
Feb 27 2025, 7:04 PM
Unknown Object (File)
Feb 21 2025, 5:35 PM
Subscribers

Details

Summary

OpenSSL assumes the same value for AT_HWCAP at 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, the benchmark
openssl speed -evp aes-256-gcm is nearly 20x faster
going from 100 MB/sec to 2000 MB/sec

PR: 259937
Sponsored by: Klara Inc.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 42888
Build 39776: arc lint + arc unit

Event Timeline

Fixes: 88e852c0b5c872b1a ("OpenSSL: Merge OpenSSL 1.1.1j")

This would need to be an EN as 13.0 is affected too

Do you need to do the same for AT_hWCAP2? That's a frequent source of problems in bsd-user, so much so we've had to implement a faithful version there. Don't know if that's for crypto or for $OTHER_THINGS though.

crypto/openssl/crypto/armcap.c
118

I think this should be AT_HWCAP2 on FreeBSD

This revision is now accepted and ready to land.Nov 19 2021, 6:03 PM

Update to the cleaner style patch

This revision now requires review to proceed.Nov 19 2021, 6:43 PM
This revision is now accepted and ready to land.Nov 19 2021, 6:51 PM

Do you have a pointer to an upstream OpenSSL PR? I'm happy to comment on it if so (if only to provide a LGTM)

crypto/openssl/crypto/armcap.c
109

I would be tempted to stick these fallbacks under an #ifdef __linux.