diff options
author | Eric Biggers <ebiggers@google.com> | 2019-04-12 22:33:12 -0700 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-04-18 22:15:04 +0800 |
commit | 626ddb2fbe7931a2996bd7fe88bd1ffd5daf7143 (patch) | |
tree | 132a14ae7204569d22896438fda6204af098a1e1 /drivers/crypto/vmx/aes_ctr.c | |
parent | 0edf8593eb0985c88aa668b00befcdc1183d004d (diff) | |
download | lwn-626ddb2fbe7931a2996bd7fe88bd1ffd5daf7143.tar.gz lwn-626ddb2fbe7931a2996bd7fe88bd1ffd5daf7143.zip |
crypto: powerpc - convert to use crypto_simd_usable()
Replace all calls to in_interrupt() in the PowerPC crypto code with
!crypto_simd_usable(). This causes the crypto self-tests to test the
no-SIMD code paths when CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y.
The p8_ghash algorithm is currently failing and needs to be fixed, as it
produces the wrong digest when no-SIMD updates are mixed with SIMD ones.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/vmx/aes_ctr.c')
-rw-r--r-- | drivers/crypto/vmx/aes_ctr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/crypto/vmx/aes_ctr.c b/drivers/crypto/vmx/aes_ctr.c index 214c69db9ebd..192a53512f5e 100644 --- a/drivers/crypto/vmx/aes_ctr.c +++ b/drivers/crypto/vmx/aes_ctr.c @@ -23,9 +23,10 @@ #include <linux/err.h> #include <linux/crypto.h> #include <linux/delay.h> -#include <linux/hardirq.h> +#include <asm/simd.h> #include <asm/switch_to.h> #include <crypto/aes.h> +#include <crypto/internal/simd.h> #include <crypto/scatterwalk.h> #include <crypto/skcipher.h> @@ -119,7 +120,7 @@ static int p8_aes_ctr_crypt(struct blkcipher_desc *desc, struct p8_aes_ctr_ctx *ctx = crypto_tfm_ctx(crypto_blkcipher_tfm(desc->tfm)); - if (in_interrupt()) { + if (!crypto_simd_usable()) { SYNC_SKCIPHER_REQUEST_ON_STACK(req, ctx->fallback); skcipher_request_set_sync_tfm(req, ctx->fallback); skcipher_request_set_callback(req, desc->flags, NULL, NULL); |