diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2019-09-09 15:44:01 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2019-09-09 15:44:01 -0400 |
commit | c697950127e0b37d16f8d40ef85542670d384c4c (patch) | |
tree | bd2ce4e74f36e6c7996d72b140ec5d947ff1179a | |
parent | d5531d8afe3508059ac2953585d395d419e300ff (diff) | |
download | longterm-queue-4.18-c697950127e0b37d16f8d40ef85542670d384c4c.tar.gz |
crypto: sub in older 4.14.x version
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r-- | queue/crypto-vmx-ghash-do-nosimd-fallback-manually.patch | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/queue/crypto-vmx-ghash-do-nosimd-fallback-manually.patch b/queue/crypto-vmx-ghash-do-nosimd-fallback-manually.patch index 01201d2..fa246c5 100644 --- a/queue/crypto-vmx-ghash-do-nosimd-fallback-manually.patch +++ b/queue/crypto-vmx-ghash-do-nosimd-fallback-manually.patch @@ -1,4 +1,4 @@ -From 357d065a44cdd77ed5ff35155a989f2a763e96ef Mon Sep 17 00:00:00 2001 +From 75b844eec93504c1fea107211321ce7696dc6811 Mon Sep 17 00:00:00 2001 From: Daniel Axtens <dja@axtens.net> Date: Fri, 17 May 2019 01:40:02 +1000 Subject: [PATCH] crypto: vmx - ghash: do nosimd fallback manually @@ -23,9 +23,13 @@ Signed-off-by: Daniel Axtens <dja@axtens.net> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> +Signed-off-by: Daniel Axtens <dja@axtens.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +[PG: use 4.14.124-stable version for this 4.18 codebase.] +Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> diff --git a/drivers/crypto/vmx/ghash.c b/drivers/crypto/vmx/ghash.c -index b5a6883bb09e..14807ac2e3b9 100644 +index 1c4b5b889fba..1bfe867c0b7b 100644 --- a/drivers/crypto/vmx/ghash.c +++ b/drivers/crypto/vmx/ghash.c @@ -1,22 +1,14 @@ @@ -57,7 +61,7 @@ index b5a6883bb09e..14807ac2e3b9 100644 */ #include <linux/types.h> -@@ -38,70 +30,25 @@ void gcm_ghash_p8(u64 Xi[2], const u128 htable[16], +@@ -39,71 +31,25 @@ void gcm_ghash_p8(u64 Xi[2], const u128 htable[16], const u8 *in, size_t len); struct p8_ghash_ctx { @@ -127,12 +131,13 @@ index b5a6883bb09e..14807ac2e3b9 100644 dctx->bytes = 0; memset(dctx->shash, 0, GHASH_DIGEST_SIZE); - dctx->fallback_desc.tfm = ctx->fallback; +- dctx->fallback_desc.flags = desc->flags; - return crypto_shash_init(&dctx->fallback_desc); + return 0; } static int p8_ghash_setkey(struct crypto_shash *tfm, const u8 *key, -@@ -119,7 +66,51 @@ static int p8_ghash_setkey(struct crypto_shash *tfm, const u8 *key, +@@ -121,7 +67,51 @@ static int p8_ghash_setkey(struct crypto_shash *tfm, const u8 *key, disable_kernel_vsx(); pagefault_enable(); preempt_enable(); @@ -146,7 +151,7 @@ index b5a6883bb09e..14807ac2e3b9 100644 +static inline void __ghash_block(struct p8_ghash_ctx *ctx, + struct p8_ghash_desc_ctx *dctx) +{ -+ if (crypto_simd_usable()) { ++ if (!IN_INTERRUPT) { + preempt_disable(); + pagefault_disable(); + enable_kernel_vsx(); @@ -165,7 +170,7 @@ index b5a6883bb09e..14807ac2e3b9 100644 + struct p8_ghash_desc_ctx *dctx, + const u8 *src, unsigned int srclen) +{ -+ if (crypto_simd_usable()) { ++ if (!IN_INTERRUPT) { + preempt_disable(); + pagefault_disable(); + enable_kernel_vsx(); @@ -185,11 +190,11 @@ index b5a6883bb09e..14807ac2e3b9 100644 } static int p8_ghash_update(struct shash_desc *desc, -@@ -129,49 +120,33 @@ static int p8_ghash_update(struct shash_desc *desc, +@@ -131,49 +121,33 @@ static int p8_ghash_update(struct shash_desc *desc, struct p8_ghash_ctx *ctx = crypto_tfm_ctx(crypto_shash_tfm(desc->tfm)); struct p8_ghash_desc_ctx *dctx = shash_desc_ctx(desc); -- if (!crypto_simd_usable()) { +- if (IN_INTERRUPT) { - return crypto_shash_update(&dctx->fallback_desc, src, - srclen); - } else { @@ -259,11 +264,11 @@ index b5a6883bb09e..14807ac2e3b9 100644 } static int p8_ghash_final(struct shash_desc *desc, u8 *out) -@@ -180,25 +155,14 @@ static int p8_ghash_final(struct shash_desc *desc, u8 *out) +@@ -182,25 +156,14 @@ static int p8_ghash_final(struct shash_desc *desc, u8 *out) struct p8_ghash_ctx *ctx = crypto_tfm_ctx(crypto_shash_tfm(desc->tfm)); struct p8_ghash_desc_ctx *dctx = shash_desc_ctx(desc); -- if (!crypto_simd_usable()) { +- if (IN_INTERRUPT) { - return crypto_shash_final(&dctx->fallback_desc, out); - } else { - if (dctx->bytes) { @@ -292,11 +297,12 @@ index b5a6883bb09e..14807ac2e3b9 100644 } struct shash_alg p8_ghash_alg = { -@@ -213,11 +177,8 @@ struct shash_alg p8_ghash_alg = { +@@ -215,11 +178,9 @@ struct shash_alg p8_ghash_alg = { .cra_name = "ghash", .cra_driver_name = "p8_ghash", .cra_priority = 1000, -- .cra_flags = CRYPTO_ALG_NEED_FALLBACK, +- .cra_flags = CRYPTO_ALG_TYPE_SHASH | CRYPTO_ALG_NEED_FALLBACK, ++ .cra_flags = CRYPTO_ALG_TYPE_SHASH, .cra_blocksize = GHASH_BLOCK_SIZE, .cra_ctxsize = sizeof(struct p8_ghash_ctx), .cra_module = THIS_MODULE, @@ -305,5 +311,5 @@ index b5a6883bb09e..14807ac2e3b9 100644 }, }; -- -2.9.5 +2.7.4 |