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
Unknown Object (File)
Mon, Mar 18, 8:50 AM
Unknown Object (File)
Thu, Mar 7, 11:46 PM
Unknown Object (File)
Thu, Mar 7, 11:46 PM
Unknown Object (File)
Thu, Mar 7, 11:46 PM
Unknown Object (File)
Thu, Mar 7, 11:46 PM
Unknown Object (File)
Thu, Mar 7, 11:33 PM
Unknown Object (File)
Jan 29 2024, 1:47 AM
Unknown Object (File)
Jan 28 2024, 10:53 AM
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 42893
Build 39781: 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–119

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.