Page MenuHomeFreeBSD

openssl: Fix detection of ARMv7 and ARM64 CPU features

Authored by allanjude on Fri, Nov 19, 3:18 PM.



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

R10 FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

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.


I think this should be AT_HWCAP2 on FreeBSD

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

Update to the cleaner style patch

This revision now requires review to proceed.Fri, Nov 19, 6:43 PM
This revision is now accepted and ready to land.Fri, Nov 19, 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)


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