From: Harald Freudenberger <freude@linux.vnet.ibm.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
Marcelo Cerri <marcelo.cerri@canonical.com>
Cc: linux-crypto@vger.kernel.org,
Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: Re: crypto: hang in crypto_larval_lookup
Date: Sun, 26 Feb 2017 20:14:21 +0100 [thread overview]
Message-ID: <e8f61e87-51b4-ffeb-1425-f4a1bc79e664@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170226042235.GA29266@gondor.apana.org.au>
On 02/26/2017 05:22 AM, Herbert Xu wrote:
> On Sat, Feb 25, 2017 at 04:20:22PM -0300, Marcelo Cerri wrote:
>> Yeah, I agree. This should work as long as the module aliases are
>> correct, which is enough.
>>
>> Other templates will not trigger the same error since they don't have to
>> try more than one underlying algorithm. But I think this is still
>> desirable for the remaining templates to avoid a long chain of unused
>> fallbacks as in the example I gave in my previous email.
>>
>> Probably a helper function to return the correct mask might be useful
>> for readability and to avoid duplicate code.
> You're right. Here is a patch to add a helper for this.
> Thanks!
>
> ---8<---
> Subject: crypto: api - Add crypto_requires_off helper
>
> This patch adds crypto_requires_off which is an extension of
> crypto_requires_sync for similar bits such as NEED_FALLBACK.
>
> Suggested-by: Marcelo Cerri <marcelo.cerri@canonical.com>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>
> diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h
> index ebe4ded..436c4c2 100644
> --- a/include/crypto/algapi.h
> +++ b/include/crypto/algapi.h
> @@ -360,13 +360,18 @@ static inline struct crypto_alg *crypto_get_attr_alg(struct rtattr **tb,
> return crypto_attr_alg(tb[1], type, mask);
> }
>
> +static inline int crypto_requires_off(u32 type, u32 mask, u32 off)
> +{
> + return (type ^ off) & mask & off;
> +}
> +
> /*
> * Returns CRYPTO_ALG_ASYNC if type/mask requires the use of sync algorithms.
> * Otherwise returns zero.
> */
> static inline int crypto_requires_sync(u32 type, u32 mask)
> {
> - return (type ^ CRYPTO_ALG_ASYNC) & mask & CRYPTO_ALG_ASYNC;
> + return crypto_requires_off(type, mask, CRYPTO_ALG_ASYNC);
> }
>
> noinline unsigned long __crypto_memneq(const void *a, const void *b, size_t size);
applied the xts.c create patch v2 and the helper patch, built and installed.
Now the aes_s390 module loads perfect without any hang, no complains
in syslog and /proc/crypto shows that all selftests for the algs in the module
passed successful.
Thanks all for your help :-)
regards, Harald Freudenberger
prev parent reply other threads:[~2017-02-26 19:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-17 17:50 crypto: hang in crypto_larval_lookup Harald Freudenberger
2017-02-23 11:19 ` Herbert Xu
2017-02-23 11:39 ` Herbert Xu
2017-02-23 16:02 ` Harald Freudenberger
2017-02-24 8:42 ` Harald Freudenberger
2017-02-24 10:32 ` Harald Freudenberger
2017-02-24 11:21 ` Harald Freudenberger
2017-02-24 23:44 ` Marcelo Cerri
2017-02-25 15:17 ` Herbert Xu
2017-02-25 19:20 ` Marcelo Cerri
2017-02-26 4:22 ` Herbert Xu
2017-02-26 4:24 ` [v2 PATCH] crypto: xts - Propagate NEED_FALLBACK bit Herbert Xu
2017-02-26 19:14 ` Harald Freudenberger [this message]
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=e8f61e87-51b4-ffeb-1425-f4a1bc79e664@linux.vnet.ibm.com \
--to=freude@linux.vnet.ibm.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=marcelo.cerri@canonical.com \
--cc=schwidefsky@de.ibm.com \
/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).