All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Matthias Kaehlcke <mka@google.com>
Subject: [PATCH 4.14 084/138] crypto: arm64/aes-ce-cipher - move assembler code to .S file
Date: Wed, 11 Apr 2018 00:24:34 +0200	[thread overview]
Message-ID: <20180410212911.975031640@linuxfoundation.org> (raw)
In-Reply-To: <20180410212902.121524696@linuxfoundation.org>

4.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

commit 019cd46984d04703a39924178f503a98436ac0d7 upstream.

Most crypto drivers involving kernel mode NEON take care to put the code
that actually touches the NEON register file in a separate compilation
unit, to prevent the compiler from reordering code that preserves or
restores the NEON context with code that may corrupt it. This is
necessary because we currently have no way to express the restrictions
imposed upon use of the NEON in kernel mode in a way that the compiler
understands.

However, in the case of aes-ce-cipher, it did not seem unreasonable to
deviate from this rule, given how it does not seem possible for the
compiler to reorder cross object function calls with asm blocks whose
in- and output constraints reflect that it reads from and writes to
memory.

Now that LTO is being proposed for the arm64 kernel, it is time to
revisit this. The link time optimization may replace the function
calls to kernel_neon_begin() and kernel_neon_end() with instantiations
of the IR that make up its implementation, allowing further reordering
with the asm block.

So let's clean this up, and move the asm() blocks into a separate .S
file.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-By: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Matthias Kaehlcke <mka@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm64/crypto/Makefile        |    2 
 arch/arm64/crypto/aes-ce-cipher.c |  281 --------------------------------------
 arch/arm64/crypto/aes-ce-core.S   |   87 +++++++++++
 arch/arm64/crypto/aes-ce-glue.c   |  190 +++++++++++++++++++++++++
 4 files changed, 278 insertions(+), 282 deletions(-)

--- a/arch/arm64/crypto/Makefile
+++ b/arch/arm64/crypto/Makefile
@@ -24,7 +24,7 @@ obj-$(CONFIG_CRYPTO_CRC32_ARM64_CE) += c
 crc32-ce-y:= crc32-ce-core.o crc32-ce-glue.o
 
 obj-$(CONFIG_CRYPTO_AES_ARM64_CE) += aes-ce-cipher.o
-CFLAGS_aes-ce-cipher.o += -march=armv8-a+crypto
+aes-ce-cipher-y := aes-ce-core.o aes-ce-glue.o
 
 obj-$(CONFIG_CRYPTO_AES_ARM64_CE_CCM) += aes-ce-ccm.o
 aes-ce-ccm-y := aes-ce-ccm-glue.o aes-ce-ccm-core.o
--- a/arch/arm64/crypto/aes-ce-cipher.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * aes-ce-cipher.c - core AES cipher using ARMv8 Crypto Extensions
- *
- * Copyright (C) 2013 - 2017 Linaro Ltd <ard.biesheuvel@linaro.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <asm/neon.h>
-#include <asm/simd.h>
-#include <asm/unaligned.h>
-#include <crypto/aes.h>
-#include <linux/cpufeature.h>
-#include <linux/crypto.h>
-#include <linux/module.h>
-
-#include "aes-ce-setkey.h"
-
-MODULE_DESCRIPTION("Synchronous AES cipher using ARMv8 Crypto Extensions");
-MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>");
-MODULE_LICENSE("GPL v2");
-
-asmlinkage void __aes_arm64_encrypt(u32 *rk, u8 *out, const u8 *in, int rounds);
-asmlinkage void __aes_arm64_decrypt(u32 *rk, u8 *out, const u8 *in, int rounds);
-
-struct aes_block {
-	u8 b[AES_BLOCK_SIZE];
-};
-
-static int num_rounds(struct crypto_aes_ctx *ctx)
-{
-	/*
-	 * # of rounds specified by AES:
-	 * 128 bit key		10 rounds
-	 * 192 bit key		12 rounds
-	 * 256 bit key		14 rounds
-	 * => n byte key	=> 6 + (n/4) rounds
-	 */
-	return 6 + ctx->key_length / 4;
-}
-
-static void aes_cipher_encrypt(struct crypto_tfm *tfm, u8 dst[], u8 const src[])
-{
-	struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm);
-	struct aes_block *out = (struct aes_block *)dst;
-	struct aes_block const *in = (struct aes_block *)src;
-	void *dummy0;
-	int dummy1;
-
-	if (!may_use_simd()) {
-		__aes_arm64_encrypt(ctx->key_enc, dst, src, num_rounds(ctx));
-		return;
-	}
-
-	kernel_neon_begin();
-
-	__asm__("	ld1	{v0.16b}, %[in]			;"
-		"	ld1	{v1.4s}, [%[key]], #16		;"
-		"	cmp	%w[rounds], #10			;"
-		"	bmi	0f				;"
-		"	bne	3f				;"
-		"	mov	v3.16b, v1.16b			;"
-		"	b	2f				;"
-		"0:	mov	v2.16b, v1.16b			;"
-		"	ld1	{v3.4s}, [%[key]], #16		;"
-		"1:	aese	v0.16b, v2.16b			;"
-		"	aesmc	v0.16b, v0.16b			;"
-		"2:	ld1	{v1.4s}, [%[key]], #16		;"
-		"	aese	v0.16b, v3.16b			;"
-		"	aesmc	v0.16b, v0.16b			;"
-		"3:	ld1	{v2.4s}, [%[key]], #16		;"
-		"	subs	%w[rounds], %w[rounds], #3	;"
-		"	aese	v0.16b, v1.16b			;"
-		"	aesmc	v0.16b, v0.16b			;"
-		"	ld1	{v3.4s}, [%[key]], #16		;"
-		"	bpl	1b				;"
-		"	aese	v0.16b, v2.16b			;"
-		"	eor	v0.16b, v0.16b, v3.16b		;"
-		"	st1	{v0.16b}, %[out]		;"
-
-	:	[out]		"=Q"(*out),
-		[key]		"=r"(dummy0),
-		[rounds]	"=r"(dummy1)
-	:	[in]		"Q"(*in),
-				"1"(ctx->key_enc),
-				"2"(num_rounds(ctx) - 2)
-	:	"cc");
-
-	kernel_neon_end();
-}
-
-static void aes_cipher_decrypt(struct crypto_tfm *tfm, u8 dst[], u8 const src[])
-{
-	struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm);
-	struct aes_block *out = (struct aes_block *)dst;
-	struct aes_block const *in = (struct aes_block *)src;
-	void *dummy0;
-	int dummy1;
-
-	if (!may_use_simd()) {
-		__aes_arm64_decrypt(ctx->key_dec, dst, src, num_rounds(ctx));
-		return;
-	}
-
-	kernel_neon_begin();
-
-	__asm__("	ld1	{v0.16b}, %[in]			;"
-		"	ld1	{v1.4s}, [%[key]], #16		;"
-		"	cmp	%w[rounds], #10			;"
-		"	bmi	0f				;"
-		"	bne	3f				;"
-		"	mov	v3.16b, v1.16b			;"
-		"	b	2f				;"
-		"0:	mov	v2.16b, v1.16b			;"
-		"	ld1	{v3.4s}, [%[key]], #16		;"
-		"1:	aesd	v0.16b, v2.16b			;"
-		"	aesimc	v0.16b, v0.16b			;"
-		"2:	ld1	{v1.4s}, [%[key]], #16		;"
-		"	aesd	v0.16b, v3.16b			;"
-		"	aesimc	v0.16b, v0.16b			;"
-		"3:	ld1	{v2.4s}, [%[key]], #16		;"
-		"	subs	%w[rounds], %w[rounds], #3	;"
-		"	aesd	v0.16b, v1.16b			;"
-		"	aesimc	v0.16b, v0.16b			;"
-		"	ld1	{v3.4s}, [%[key]], #16		;"
-		"	bpl	1b				;"
-		"	aesd	v0.16b, v2.16b			;"
-		"	eor	v0.16b, v0.16b, v3.16b		;"
-		"	st1	{v0.16b}, %[out]		;"
-
-	:	[out]		"=Q"(*out),
-		[key]		"=r"(dummy0),
-		[rounds]	"=r"(dummy1)
-	:	[in]		"Q"(*in),
-				"1"(ctx->key_dec),
-				"2"(num_rounds(ctx) - 2)
-	:	"cc");
-
-	kernel_neon_end();
-}
-
-/*
- * aes_sub() - use the aese instruction to perform the AES sbox substitution
- *             on each byte in 'input'
- */
-static u32 aes_sub(u32 input)
-{
-	u32 ret;
-
-	__asm__("dup	v1.4s, %w[in]		;"
-		"movi	v0.16b, #0		;"
-		"aese	v0.16b, v1.16b		;"
-		"umov	%w[out], v0.4s[0]	;"
-
-	:	[out]	"=r"(ret)
-	:	[in]	"r"(input)
-	:		"v0","v1");
-
-	return ret;
-}
-
-int ce_aes_expandkey(struct crypto_aes_ctx *ctx, const u8 *in_key,
-		     unsigned int key_len)
-{
-	/*
-	 * The AES key schedule round constants
-	 */
-	static u8 const rcon[] = {
-		0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36,
-	};
-
-	u32 kwords = key_len / sizeof(u32);
-	struct aes_block *key_enc, *key_dec;
-	int i, j;
-
-	if (key_len != AES_KEYSIZE_128 &&
-	    key_len != AES_KEYSIZE_192 &&
-	    key_len != AES_KEYSIZE_256)
-		return -EINVAL;
-
-	ctx->key_length = key_len;
-	for (i = 0; i < kwords; i++)
-		ctx->key_enc[i] = get_unaligned_le32(in_key + i * sizeof(u32));
-
-	kernel_neon_begin();
-	for (i = 0; i < sizeof(rcon); i++) {
-		u32 *rki = ctx->key_enc + (i * kwords);
-		u32 *rko = rki + kwords;
-
-		rko[0] = ror32(aes_sub(rki[kwords - 1]), 8) ^ rcon[i] ^ rki[0];
-		rko[1] = rko[0] ^ rki[1];
-		rko[2] = rko[1] ^ rki[2];
-		rko[3] = rko[2] ^ rki[3];
-
-		if (key_len == AES_KEYSIZE_192) {
-			if (i >= 7)
-				break;
-			rko[4] = rko[3] ^ rki[4];
-			rko[5] = rko[4] ^ rki[5];
-		} else if (key_len == AES_KEYSIZE_256) {
-			if (i >= 6)
-				break;
-			rko[4] = aes_sub(rko[3]) ^ rki[4];
-			rko[5] = rko[4] ^ rki[5];
-			rko[6] = rko[5] ^ rki[6];
-			rko[7] = rko[6] ^ rki[7];
-		}
-	}
-
-	/*
-	 * Generate the decryption keys for the Equivalent Inverse Cipher.
-	 * This involves reversing the order of the round keys, and applying
-	 * the Inverse Mix Columns transformation on all but the first and
-	 * the last one.
-	 */
-	key_enc = (struct aes_block *)ctx->key_enc;
-	key_dec = (struct aes_block *)ctx->key_dec;
-	j = num_rounds(ctx);
-
-	key_dec[0] = key_enc[j];
-	for (i = 1, j--; j > 0; i++, j--)
-		__asm__("ld1	{v0.4s}, %[in]		;"
-			"aesimc	v1.16b, v0.16b		;"
-			"st1	{v1.4s}, %[out]	;"
-
-		:	[out]	"=Q"(key_dec[i])
-		:	[in]	"Q"(key_enc[j])
-		:		"v0","v1");
-	key_dec[i] = key_enc[0];
-
-	kernel_neon_end();
-	return 0;
-}
-EXPORT_SYMBOL(ce_aes_expandkey);
-
-int ce_aes_setkey(struct crypto_tfm *tfm, const u8 *in_key,
-		  unsigned int key_len)
-{
-	struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm);
-	int ret;
-
-	ret = ce_aes_expandkey(ctx, in_key, key_len);
-	if (!ret)
-		return 0;
-
-	tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
-	return -EINVAL;
-}
-EXPORT_SYMBOL(ce_aes_setkey);
-
-static struct crypto_alg aes_alg = {
-	.cra_name		= "aes",
-	.cra_driver_name	= "aes-ce",
-	.cra_priority		= 250,
-	.cra_flags		= CRYPTO_ALG_TYPE_CIPHER,
-	.cra_blocksize		= AES_BLOCK_SIZE,
-	.cra_ctxsize		= sizeof(struct crypto_aes_ctx),
-	.cra_module		= THIS_MODULE,
-	.cra_cipher = {
-		.cia_min_keysize	= AES_MIN_KEY_SIZE,
-		.cia_max_keysize	= AES_MAX_KEY_SIZE,
-		.cia_setkey		= ce_aes_setkey,
-		.cia_encrypt		= aes_cipher_encrypt,
-		.cia_decrypt		= aes_cipher_decrypt
-	}
-};
-
-static int __init aes_mod_init(void)
-{
-	return crypto_register_alg(&aes_alg);
-}
-
-static void __exit aes_mod_exit(void)
-{
-	crypto_unregister_alg(&aes_alg);
-}
-
-module_cpu_feature_match(AES, aes_mod_init);
-module_exit(aes_mod_exit);
--- /dev/null
+++ b/arch/arm64/crypto/aes-ce-core.S
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2013 - 2017 Linaro Ltd <ard.biesheuvel@linaro.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/linkage.h>
+#include <asm/assembler.h>
+
+	.arch		armv8-a+crypto
+
+ENTRY(__aes_ce_encrypt)
+	sub		w3, w3, #2
+	ld1		{v0.16b}, [x2]
+	ld1		{v1.4s}, [x0], #16
+	cmp		w3, #10
+	bmi		0f
+	bne		3f
+	mov		v3.16b, v1.16b
+	b		2f
+0:	mov		v2.16b, v1.16b
+	ld1		{v3.4s}, [x0], #16
+1:	aese		v0.16b, v2.16b
+	aesmc		v0.16b, v0.16b
+2:	ld1		{v1.4s}, [x0], #16
+	aese		v0.16b, v3.16b
+	aesmc		v0.16b, v0.16b
+3:	ld1		{v2.4s}, [x0], #16
+	subs		w3, w3, #3
+	aese		v0.16b, v1.16b
+	aesmc		v0.16b, v0.16b
+	ld1		{v3.4s}, [x0], #16
+	bpl		1b
+	aese		v0.16b, v2.16b
+	eor		v0.16b, v0.16b, v3.16b
+	st1		{v0.16b}, [x1]
+	ret
+ENDPROC(__aes_ce_encrypt)
+
+ENTRY(__aes_ce_decrypt)
+	sub		w3, w3, #2
+	ld1		{v0.16b}, [x2]
+	ld1		{v1.4s}, [x0], #16
+	cmp		w3, #10
+	bmi		0f
+	bne		3f
+	mov		v3.16b, v1.16b
+	b		2f
+0:	mov		v2.16b, v1.16b
+	ld1		{v3.4s}, [x0], #16
+1:	aesd		v0.16b, v2.16b
+	aesimc		v0.16b, v0.16b
+2:	ld1		{v1.4s}, [x0], #16
+	aesd		v0.16b, v3.16b
+	aesimc		v0.16b, v0.16b
+3:	ld1		{v2.4s}, [x0], #16
+	subs		w3, w3, #3
+	aesd		v0.16b, v1.16b
+	aesimc		v0.16b, v0.16b
+	ld1		{v3.4s}, [x0], #16
+	bpl		1b
+	aesd		v0.16b, v2.16b
+	eor		v0.16b, v0.16b, v3.16b
+	st1		{v0.16b}, [x1]
+	ret
+ENDPROC(__aes_ce_decrypt)
+
+/*
+ * __aes_ce_sub() - use the aese instruction to perform the AES sbox
+ *                  substitution on each byte in 'input'
+ */
+ENTRY(__aes_ce_sub)
+	dup		v1.4s, w0
+	movi		v0.16b, #0
+	aese		v0.16b, v1.16b
+	umov		w0, v0.s[0]
+	ret
+ENDPROC(__aes_ce_sub)
+
+ENTRY(__aes_ce_invert)
+	ld1		{v0.4s}, [x1]
+	aesimc		v1.16b, v0.16b
+	st1		{v1.4s}, [x0]
+	ret
+ENDPROC(__aes_ce_invert)
--- /dev/null
+++ b/arch/arm64/crypto/aes-ce-glue.c
@@ -0,0 +1,190 @@
+/*
+ * aes-ce-cipher.c - core AES cipher using ARMv8 Crypto Extensions
+ *
+ * Copyright (C) 2013 - 2017 Linaro Ltd <ard.biesheuvel@linaro.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <asm/neon.h>
+#include <asm/simd.h>
+#include <asm/unaligned.h>
+#include <crypto/aes.h>
+#include <linux/cpufeature.h>
+#include <linux/crypto.h>
+#include <linux/module.h>
+
+#include "aes-ce-setkey.h"
+
+MODULE_DESCRIPTION("Synchronous AES cipher using ARMv8 Crypto Extensions");
+MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>");
+MODULE_LICENSE("GPL v2");
+
+asmlinkage void __aes_arm64_encrypt(u32 *rk, u8 *out, const u8 *in, int rounds);
+asmlinkage void __aes_arm64_decrypt(u32 *rk, u8 *out, const u8 *in, int rounds);
+
+struct aes_block {
+	u8 b[AES_BLOCK_SIZE];
+};
+
+asmlinkage void __aes_ce_encrypt(u32 *rk, u8 *out, const u8 *in, int rounds);
+asmlinkage void __aes_ce_decrypt(u32 *rk, u8 *out, const u8 *in, int rounds);
+
+asmlinkage u32 __aes_ce_sub(u32 l);
+asmlinkage void __aes_ce_invert(struct aes_block *out,
+				const struct aes_block *in);
+
+static int num_rounds(struct crypto_aes_ctx *ctx)
+{
+	/*
+	 * # of rounds specified by AES:
+	 * 128 bit key		10 rounds
+	 * 192 bit key		12 rounds
+	 * 256 bit key		14 rounds
+	 * => n byte key	=> 6 + (n/4) rounds
+	 */
+	return 6 + ctx->key_length / 4;
+}
+
+static void aes_cipher_encrypt(struct crypto_tfm *tfm, u8 dst[], u8 const src[])
+{
+	struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm);
+
+	if (!may_use_simd()) {
+		__aes_arm64_encrypt(ctx->key_enc, dst, src, num_rounds(ctx));
+		return;
+	}
+
+	kernel_neon_begin();
+	__aes_ce_encrypt(ctx->key_enc, dst, src, num_rounds(ctx));
+	kernel_neon_end();
+}
+
+static void aes_cipher_decrypt(struct crypto_tfm *tfm, u8 dst[], u8 const src[])
+{
+	struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm);
+
+	if (!may_use_simd()) {
+		__aes_arm64_decrypt(ctx->key_dec, dst, src, num_rounds(ctx));
+		return;
+	}
+
+	kernel_neon_begin();
+	__aes_ce_decrypt(ctx->key_dec, dst, src, num_rounds(ctx));
+	kernel_neon_end();
+}
+
+int ce_aes_expandkey(struct crypto_aes_ctx *ctx, const u8 *in_key,
+		     unsigned int key_len)
+{
+	/*
+	 * The AES key schedule round constants
+	 */
+	static u8 const rcon[] = {
+		0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36,
+	};
+
+	u32 kwords = key_len / sizeof(u32);
+	struct aes_block *key_enc, *key_dec;
+	int i, j;
+
+	if (key_len != AES_KEYSIZE_128 &&
+	    key_len != AES_KEYSIZE_192 &&
+	    key_len != AES_KEYSIZE_256)
+		return -EINVAL;
+
+	ctx->key_length = key_len;
+	for (i = 0; i < kwords; i++)
+		ctx->key_enc[i] = get_unaligned_le32(in_key + i * sizeof(u32));
+
+	kernel_neon_begin();
+	for (i = 0; i < sizeof(rcon); i++) {
+		u32 *rki = ctx->key_enc + (i * kwords);
+		u32 *rko = rki + kwords;
+
+		rko[0] = ror32(__aes_ce_sub(rki[kwords - 1]), 8) ^ rcon[i] ^ rki[0];
+		rko[1] = rko[0] ^ rki[1];
+		rko[2] = rko[1] ^ rki[2];
+		rko[3] = rko[2] ^ rki[3];
+
+		if (key_len == AES_KEYSIZE_192) {
+			if (i >= 7)
+				break;
+			rko[4] = rko[3] ^ rki[4];
+			rko[5] = rko[4] ^ rki[5];
+		} else if (key_len == AES_KEYSIZE_256) {
+			if (i >= 6)
+				break;
+			rko[4] = __aes_ce_sub(rko[3]) ^ rki[4];
+			rko[5] = rko[4] ^ rki[5];
+			rko[6] = rko[5] ^ rki[6];
+			rko[7] = rko[6] ^ rki[7];
+		}
+	}
+
+	/*
+	 * Generate the decryption keys for the Equivalent Inverse Cipher.
+	 * This involves reversing the order of the round keys, and applying
+	 * the Inverse Mix Columns transformation on all but the first and
+	 * the last one.
+	 */
+	key_enc = (struct aes_block *)ctx->key_enc;
+	key_dec = (struct aes_block *)ctx->key_dec;
+	j = num_rounds(ctx);
+
+	key_dec[0] = key_enc[j];
+	for (i = 1, j--; j > 0; i++, j--)
+		__aes_ce_invert(key_dec + i, key_enc + j);
+	key_dec[i] = key_enc[0];
+
+	kernel_neon_end();
+	return 0;
+}
+EXPORT_SYMBOL(ce_aes_expandkey);
+
+int ce_aes_setkey(struct crypto_tfm *tfm, const u8 *in_key,
+		  unsigned int key_len)
+{
+	struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm);
+	int ret;
+
+	ret = ce_aes_expandkey(ctx, in_key, key_len);
+	if (!ret)
+		return 0;
+
+	tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
+	return -EINVAL;
+}
+EXPORT_SYMBOL(ce_aes_setkey);
+
+static struct crypto_alg aes_alg = {
+	.cra_name		= "aes",
+	.cra_driver_name	= "aes-ce",
+	.cra_priority		= 250,
+	.cra_flags		= CRYPTO_ALG_TYPE_CIPHER,
+	.cra_blocksize		= AES_BLOCK_SIZE,
+	.cra_ctxsize		= sizeof(struct crypto_aes_ctx),
+	.cra_module		= THIS_MODULE,
+	.cra_cipher = {
+		.cia_min_keysize	= AES_MIN_KEY_SIZE,
+		.cia_max_keysize	= AES_MAX_KEY_SIZE,
+		.cia_setkey		= ce_aes_setkey,
+		.cia_encrypt		= aes_cipher_encrypt,
+		.cia_decrypt		= aes_cipher_decrypt
+	}
+};
+
+static int __init aes_mod_init(void)
+{
+	return crypto_register_alg(&aes_alg);
+}
+
+static void __exit aes_mod_exit(void)
+{
+	crypto_unregister_alg(&aes_alg);
+}
+
+module_cpu_feature_match(AES, aes_mod_init);
+module_exit(aes_mod_exit);

  parent reply	other threads:[~2018-04-10 22:24 UTC|newest]

Thread overview: 150+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-10 22:23 [PATCH 4.14 000/138] 4.14.34-stable review Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 001/138] i40iw: Fix sequence number for the first partial FPDU Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 002/138] i40iw: Correct Q1/XF object count equation Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 003/138] i40iw: Validate correct IRD/ORD connection parameters Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 004/138] clk: meson: mpll: use 64-bit maths in params_from_rate Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 005/138] ARM: dts: ls1021a: add "fsl,ls1021a-esdhc" compatible string to esdhc node Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 006/138] Bluetooth: Add a new 04ca:3015 QCA_ROME device Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 007/138] ipv6: Reinject IPv6 packets if IPsec policy matches after SNAT Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 008/138] thermal: power_allocator: fix one race condition issue for thermal_instances list Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 009/138] perf probe: Find versioned symbols from map Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 010/138] perf probe: Add warning message if there is unexpected event name Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 011/138] perf evsel: Enable ignore_missing_thread for pid option Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 012/138] net: hns3: free the ring_data structrue when change tqps Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 013/138] net: hns3: fix for getting auto-negotiation state in hclge_get_autoneg Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 014/138] l2tp: fix missing print session offset info Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 015/138] rds; Reset rs->rs_bound_addr in rds_add_bound() failure path Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 016/138] ACPI / video: Default lcd_only to true on Win8-ready and newer machines Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 017/138] net/mlx4_en: Change default QoS settings Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 018/138] VFS: close race between getcwd() and d_move() Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 019/138] watchdog: dw_wdt: add stop watchdog operation Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 020/138] clk: divider: fix incorrect usage of container_of Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 021/138] PM / devfreq: Fix potential NULL pointer dereference in governor_store Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 022/138] selftests/net: fix bugs in address and port initialization Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 023/138] RDMA/cma: Mark end of CMA ID messages Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 024/138] hwmon: (ina2xx) Make calibration register value fixed Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 025/138] clk: sunxi-ng: a83t: Add M divider to TCON1 clock Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 026/138] media: videobuf2-core: dont go out of the buffer range Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 027/138] ASoC: Intel: Skylake: Disable clock gating during firmware and library download Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 028/138] ASoC: Intel: cht_bsw_rt5645: Analog Mic support Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 029/138] spi: sh-msiof: Fix timeout failures for TX-only DMA transfers Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 030/138] scsi: libiscsi: Allow sd_shutdown on bad transport Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 031/138] scsi: mpt3sas: Proper handling of set/clear of "ATA command pending" flag Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 032/138] irqchip/gic-v3: Fix the driver probe() fail due to disabled GICC entry Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 033/138] ACPI: EC: Fix debugfs_create_*() usage Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 034/138] mac80211: Fix setting TX power on monitor interfaces Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 035/138] vfb: fix video mode and line_length being set when loaded Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 036/138] gpio: label descriptors using the device name Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 037/138] powernv-cpufreq: Add helper to extract pstate from PMSR Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 038/138] IB/rdmavt: Allocate CQ memory on the correct node Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 039/138] blk-mq: avoid to map CPU into stale hw queue Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 040/138] blk-mq: fix race between updating nr_hw_queues and switching io sched Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 041/138] backlight: tdo24m: Fix the SPI CS between transfers Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 042/138] pinctrl: baytrail: Enable glitch filter for GPIOs used as interrupts Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 043/138] nvme_fcloop: disassocate local port structs Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 044/138] nvme_fcloop: fix abort race condition Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 045/138] tpm: return a TPM_RC_COMMAND_CODE response if command is not implemented Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 046/138] perf report: Fix a no annotate browser displayed issue Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 047/138] staging: lustre: disable preempt while sampling processor id Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 048/138] ASoC: Intel: sst: Fix the return value of sst_send_byte_stream_mrfld() Greg Kroah-Hartman
2018-04-10 22:23 ` [PATCH 4.14 049/138] power: supply: axp288_charger: Properly stop work on probe-error / remove Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 050/138] rt2x00: do not pause queue unconditionally on error path Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 051/138] wl1251: check return from call to wl1251_acx_arp_ip_filter Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 052/138] net/mlx5: Fix race for multiple RoCE enable Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 053/138] net: hns3: Fix an error of total drop packet statistics Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 054/138] net: hns3: Fix a loop index error of tqp statistics query Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 055/138] net: hns3: Fix an error macro definition of HNS3_TQP_STAT Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 056/138] net: hns3: fix for changing MTU Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 057/138] bcache: ret IOERR when read meets metadata error Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 058/138] bcache: stop writeback thread after detaching Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 059/138] bcache: segregate flash only volume write streams Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 060/138] scsi: libsas: fix memory leak in sas_smp_get_phy_events() Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 061/138] scsi: libsas: fix error when getting phy events Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 062/138] scsi: libsas: initialize sas_phy status according to response of DISCOVER Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 063/138] blk-mq: fix kernel oops in blk_mq_tag_idle() Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 064/138] tty: n_gsm: Allow ADM response in addition to UA for control dlci Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 065/138] block, bfq: put async queues for root bfq groups too Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 066/138] EDAC, mv64x60: Fix an error handling path Greg Kroah-Hartman
2018-04-10 22:24   ` [4.14,066/138] " Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 067/138] uio_hv_generic: check that host supports monitor page Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 068/138] i40evf: dont rely on netif_running() outside rtnl_lock() Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 069/138] cxgb4vf: Fix SGE FL buffer initialization logic for 64K pages Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 070/138] scsi: megaraid_sas: Error handling for invalid ldcount provided by firmware in RAID map Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 071/138] scsi: megaraid_sas: unload flag should be set after scsi_remove_host is called Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 072/138] RDMA/cma: Fix rdma_cm path querying for RoCE Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 073/138] gpio: thunderx: fix error return code in thunderx_gpio_probe() Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 074/138] x86/gart: Exclude GART aperture from vmcore Greg Kroah-Hartman
2018-04-10 22:24   ` Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 075/138] sdhci: Advertise 2.0v supply on SDIO host controller Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 076/138] ibmvnic: Dont handle RX interrupts when not up Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 077/138] Input: goodix - disable IRQs while suspended Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 078/138] mtd: mtd_oobtest: Handle bitflips during reads Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 079/138] crypto: aes-generic - build with -Os on gcc-7+ Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 080/138] perf tools: Fix copyfile_offset update of output offset Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 081/138] tcmu: release blocks for partially setup cmds Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 082/138] thermal: int3400_thermal: fix error handling in int3400_thermal_probe() Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 083/138] objtool: Add Clang support Greg Kroah-Hartman
2018-04-10 22:24 ` Greg Kroah-Hartman [this message]
2018-04-10 22:24 ` [PATCH 4.14 085/138] x86/microcode: Propagate return value from updating functions Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 086/138] x86/CPU: Add a microcode loader callback Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 087/138] x86/CPU: Check CPU feature bits after microcode upgrade Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 088/138] x86/microcode: Get rid of struct apply_microcode_ctx Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 089/138] x86/microcode/intel: Check microcode revision before updating sibling threads Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 090/138] x86/microcode/intel: Writeback and invalidate caches before updating microcode Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 091/138] x86/microcode: Do not upload microcode if CPUs are offline Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 092/138] x86/microcode/intel: Look into the patch cache first Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 093/138] x86/microcode: Request microcode on the BSP Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 094/138] x86/microcode: Synchronize late microcode loading Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 095/138] x86/microcode: Attempt late loading only when new microcode is present Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 096/138] x86/microcode: Fix CPU synchronization routine Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 097/138] arp: fix arp_filter on l3slave devices Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 098/138] ipv6: the entire IPv6 header chain must fit the first fragment Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 099/138] lan78xx: Crash in lan78xx_writ_reg (Workqueue: events lan78xx_deferred_multicast_write) Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 100/138] net: fix possible out-of-bound read in skb_network_protocol() Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 101/138] net/ipv6: Fix route leaking between VRFs Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 102/138] net/ipv6: Increment OUTxxx counters after netfilter hook Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 103/138] netlink: make sure nladdr has correct size in netlink_connect() Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 104/138] net sched actions: fix dumping which requires several messages to user space Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 105/138] net/sched: fix NULL dereference in the error path of tcf_bpf_init() Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 106/138] pptp: remove a buggy dst release in pptp_connect() Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 107/138] r8169: fix setting driver_data after register_netdev Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 108/138] sctp: do not leak kernel memory to user space Greg Kroah-Hartman
2018-04-10 22:24 ` [PATCH 4.14 109/138] sctp: sctp_sockaddr_af must check minimal addr length for AF_INET6 Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 110/138] sky2: Increase D3 delay to sky2 stops working after suspend Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 111/138] vhost: correctly remove wait queue during poll failure Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 112/138] vlan: also check phy_driver ts_info for vlans real device Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 113/138] vrf: Fix use after free and double free in vrf_finish_output Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 114/138] bonding: fix the err path for dev hwaddr sync in bond_enslave Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 115/138] bonding: move dev_mc_sync after master_upper_dev_link " Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 116/138] bonding: process the err returned by dev_set_allmulti properly " Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 117/138] net: fool proof dev_valid_name() Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 118/138] ip_tunnel: better validate user provided tunnel names Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 119/138] ipv6: sit: " Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 120/138] ip6_gre: " Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 121/138] ip6_tunnel: " Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 122/138] vti6: " Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 123/138] net/mlx5e: Avoid using the ipv6 stub in the TC offload neigh update path Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 124/138] net/mlx5e: Fix memory usage issues in offloading TC flows Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 125/138] nfp: use full 40 bits of the NSP buffer address Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 126/138] ipv6: sr: fix seg6 encap performances with TSO enabled Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 127/138] net/mlx5e: Dont override vport admin link state in switchdev mode Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 128/138] net/mlx5e: Sync netdev vxlan ports at open Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 129/138] net/sched: fix NULL dereference in the error path of tunnel_key_init() Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 130/138] net/sched: fix NULL dereference on the error path of tcf_skbmod_init() Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 131/138] strparser: Fix sign of err codes Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 132/138] net/mlx4_en: Fix mixed PFC and Global pause user control requests Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 133/138] net/mlx5e: Fix traffic being dropped on VF representor Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 134/138] vhost: validate log when IOTLB is enabled Greg Kroah-Hartman
2018-04-10 23:33   ` Michael S. Tsirkin
2018-04-11  0:55     ` David Miller
2018-04-11  8:04       ` Greg KH
2018-04-11 13:25         ` Michael S. Tsirkin
2018-04-11 14:44           ` David Miller
2018-04-10 22:25 ` [PATCH 4.14 135/138] route: check sysctl_fib_multipath_use_neigh earlier than hash Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 136/138] team: move dev_mc_sync after master_upper_dev_link in team_port_add Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 137/138] vhost_net: add missing lock nesting notation Greg Kroah-Hartman
2018-04-10 22:25 ` [PATCH 4.14 138/138] net/mlx4_core: Fix memory leak while delete slaves resources Greg Kroah-Hartman
2018-04-11  3:42 ` [PATCH 4.14 000/138] 4.14.34-stable review kernelci.org bot
2018-04-11 17:14 ` Shuah Khan
2018-04-11 17:26 ` Guenter Roeck
2018-04-11 19:19 ` Dan Rue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180410212911.975031640@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mka@google.com \
    --cc=ndesaulniers@google.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.