crypto: aesni - replace function pointers with static branches
authorArd Biesheuvel <ardb@kernel.org>
Mon, 4 Jan 2021 15:55:50 +0000 (16:55 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 14 Jan 2021 06:10:25 +0000 (17:10 +1100)
commitd6cbf4eaa46794b173c691a71211d882398d7977
treeca94a2b4faddddd6b892f0f4d21f4ece1e22a839
parent83c83e658863e4e57f4defe6cc1bc05f3d968e2a
crypto: aesni - replace function pointers with static branches

Replace the function pointers in the GCM implementation with static branches,
which are based on code patching, which occurs only at module load time.
This avoids the severe performance penalty caused by the use of retpolines.

In order to retain the ability to switch between different versions of the
implementation based on the input size on cores that support AVX and AVX2,
use static branches instead of static calls.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/aesni-intel_glue.c