linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: "Stephan Müller" <smueller@chronox.de>
Cc: linux-crypto@vger.kernel.org
Subject: Re: simd ciphers
Date: Thu, 29 Dec 2016 17:44:15 +0800	[thread overview]
Message-ID: <20161229094415.GA14453@gondor.apana.org.au> (raw)
In-Reply-To: <2449210.sSYcIB5U3R@positron.chronox.de>

On Wed, Dec 28, 2016 at 12:21:52PM +0100, Stephan Müller wrote:
> 
> This patch does not help. But I now found the issue: we need some Kconfig 
> wizardry to mandate pcbc to be compiled statically when AES-NI is static. 
> Currently I had pcbc always as a module even when selecting AES-NI as static 
> compilation.

OK, please test this patch and see if it cures the problem with
aesni built-in and pcbc built as a module.

Thanks,

---8<---
Subject: crypto: aesni - Fix failure when built-in with modular pcbc

If aesni is built-in but pcbc is built as a module, then aesni
will fail completely because when it tries to register the pcbc
variant of aes the pcbc template is not available.

This patch fixes this by modifying the pcbc presence test so that
if aesni is built-in then pcbc must also be built-in for it to be
used by aesni.

Fixes: 85671860caac ("crypto: aesni - Convert to skcipher")
Reported-by: Stephan Müller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c
index 36ca150..7ad0ed7 100644
--- a/arch/x86/crypto/aesni-intel_glue.c
+++ b/arch/x86/crypto/aesni-intel_glue.c
@@ -1024,7 +1024,8 @@ struct {
 	const char *basename;
 	struct simd_skcipher_alg *simd;
 } aesni_simd_skciphers2[] = {
-#if IS_ENABLED(CONFIG_CRYPTO_PCBC)
+#if (defined(MODULE) && IS_ENABLED(CONFIG_CRYPTO_PCBC)) || \
+    IS_BUILTIN(CONFIG_CRYPTO_PCBC)
 	{
 		.algname	= "pcbc(aes)",
 		.drvname	= "pcbc-aes-aesni",
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply	other threads:[~2016-12-29  9:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-08 18:32 simd ciphers Stephan Müller
2016-12-08 18:40 ` Stephan Müller
2016-12-28  8:37   ` Stephan Müller
2016-12-28  8:59     ` Herbert Xu
2016-12-28 10:00       ` Stephan Müller
2016-12-28 10:28         ` Herbert Xu
2016-12-28 11:21           ` Stephan Müller
2016-12-29  9:44             ` Herbert Xu [this message]
2016-12-30 10:51               ` Stephan Müller

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=20161229094415.GA14453@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=smueller@chronox.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).