Linux 7.5 kernel crypto gains AVX2 SHA-512 optimizations from Google engineer
Queued libcrypto-next patches speed up SHA-512 on AVX2-capable AMD and Intel CPUs, with roughly 5-6% gains on Zen 5 and Sapphire Rapids and larger benefits expected on Zen 1-era hardware.
Summary
The kernel's libcrypto code is receiving a new round of AVX2-focused SHA-512 optimizations queued for Linux 7.5, authored by Google engineer Eric Biggers. The patches target AMD and Intel processors that support Advanced Vector Extensions 2, and they are currently staged in libcrypto-next ahead of the Linux 7.5 merge window at the end of December.
The series includes a patch that optimizes the message schedule in the sha512-avx2 code, which is expected to help older Zen 1-era systems where 128-bit operations are faster than 256-bit ones, while newer CPUs likely see little benefit. Two follow-up patches factor out and then optimize SHA512_Round, delivering roughly 1% and then about 5% faster SHA-512 on AMD Zen 5 (Ryzen 9 9950X), and about 3% and then 6% on Intel Xeon Sapphire Rapids. The changes affect kernel crypto consumers on x86_64 hardware with AVX2 support once Linux 7.5 lands.
What changes in the sha512-avx2 code for Linux 7.5
- Message schedule optimization: A patch optimizes the message schedule in the sha512-avx2 implementation, aimed at Zen 1-era CPUs where 128-bit operations outperform 256-bit ones; newer AMD and Intel chips are unlikely to benefit from this specific change.
- SHA512_Round factoring: A follow-up patch factors out SHA512_Round in the sha512-avx2 code, yielding around 1% faster SHA-512 on AMD Zen 5 (Ryzen 9 9950X) and about 3% on Intel Xeon Sapphire Rapids.
- SHA512_Round optimization: A further patch optimizes SHA512_Round itself, producing roughly 5% faster SHA-512 on Zen 5 and about 6% faster on Sapphire Rapids processors.
- Merge timing: The patches are staged in libcrypto-next and are set to be merged during the Linux 7.5 merge window at the end of December, with the work credited to Google engineer Eric Biggers.
Why it matters
Kernel crypto performance matters for any workload that hashes with SHA-512 in-kernel, including dm-integrity, IPsec, and other subsystems relying on the kernel's crypto API, so incremental AVX2 gains compound with earlier AVX-512/AVX10 work. Distributions shipping Linux 7.5 will pass these improvements to users on AVX2-capable AMD and Intel systems without any configuration change, while older Zen 1 hardware gets targeted attention that newer microarchitectures do not need.
Original reference: www.phoronix.com →