]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: arm64/ghash-ce - replace NEON yield check with block limit
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Sat, 4 Aug 2018 18:46:24 +0000 (20:46 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 7 Aug 2018 09:51:39 +0000 (17:51 +0800)
commite1fd7855b6b636d700da19fc54062a5bc09b6651
tree70b149f7f5a1c11335f4507dbce2a705398c598e
parent9d607700b7bfe890281e70ffdd15f0d72e63d0a2
crypto: arm64/ghash-ce - replace NEON yield check with block limit

Checking the TIF_NEED_RESCHED flag is disproportionately costly on cores
with fast crypto instructions and comparatively slow memory accesses.

On algorithms such as GHASH, which executes at ~1 cycle per byte on
cores that implement support for 64 bit polynomial multiplication,
there is really no need to check the TIF_NEED_RESCHED particularly
often, and so we can remove the NEON yield check from the assembler
routines.

However, unlike the AEAD or skcipher APIs, the shash/ahash APIs take
arbitrary input lengths, and so there needs to be some sanity check
to ensure that we don't hog the CPU for excessive amounts of time.

So let's simply cap the maximum input size that is processed in one go
to 64 KB.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/arm64/crypto/ghash-ce-core.S
arch/arm64/crypto/ghash-ce-glue.c