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)
Tue, Oct 29, 2:47 PM
Unknown Object (File)
Wed, Oct 16, 3:55 PM
Unknown Object (File)
Oct 9 2024, 1:11 AM
Unknown Object (File)
Oct 9 2024, 1:11 AM
Unknown Object (File)
Oct 9 2024, 1:11 AM
Unknown Object (File)
Oct 9 2024, 1:09 AM
Unknown Object (File)
Oct 9 2024, 12:47 AM
Unknown Object (File)
Oct 2 2024, 1:12 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
rG FreeBSD src repository
Lint
Lint Not Applicable
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.

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.