From: Eric Biggers <ebiggers@kernel.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au
Subject: Re: [PATCH 1/3] crypto: tcrypt - don't initialize at subsys_initcall time
Date: Mon, 9 Nov 2020 09:59:47 -0800 [thread overview]
Message-ID: <20201109175947.GA853@sol.localdomain> (raw)
In-Reply-To: <20201109083143.2884-2-ardb@kernel.org>
On Mon, Nov 09, 2020 at 09:31:41AM +0100, Ard Biesheuvel wrote:
> Commit c4741b2305979 ("crypto: run initcalls for generic implementations
> earlier") converted tcrypt.ko's module_init() to subsys_initcall(), but
> this was unintentional: tcrypt.ko currently cannot be built into the core
> kernel, and so the subsys_initcall() gets converted into module_init()
> under the hood. Given that tcrypt.ko does not implement a generic version
> of a crypto algorithm that has to be available early during boot, there
> is no point in running the tcrypt init code earlier than implied by
> module_init().
>
> However, for crypto development purposes, we will lift the restriction
> that tcrypt.ko must be built as a module, and when builtin, it makes sense
> for tcrypt.ko (which does its work inside the module init function) to run
> as late as possible. So let's switch to late_initcall() instead.
>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> ---
> crypto/tcrypt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
> index eea0f453cfb6..fc1f3e516694 100644
> --- a/crypto/tcrypt.c
> +++ b/crypto/tcrypt.c
> @@ -3066,7 +3066,7 @@ static int __init tcrypt_mod_init(void)
> */
> static void __exit tcrypt_mod_fini(void) { }
>
> -subsys_initcall(tcrypt_mod_init);
> +late_initcall(tcrypt_mod_init);
> module_exit(tcrypt_mod_fini);
>
> module_param(alg, charp, 0);
> --
Reviewed-by: Eric Biggers <ebiggers@google.com>
next prev parent reply other threads:[~2020-11-09 17:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-09 8:31 [PATCH 0/3] crypto: tcrypt enhancements Ard Biesheuvel
2020-11-09 8:31 ` [PATCH 1/3] crypto: tcrypt - don't initialize at subsys_initcall time Ard Biesheuvel
2020-11-09 17:59 ` Eric Biggers [this message]
2020-11-09 8:31 ` [PATCH 2/3] crypto: tcrypt - permit tcrypt.ko to be builtin Ard Biesheuvel
2020-11-20 3:44 ` Herbert Xu
2020-11-20 9:24 ` Ard Biesheuvel
2020-11-20 10:09 ` Herbert Xu
2020-11-20 10:34 ` Ard Biesheuvel
2020-11-20 10:37 ` Herbert Xu
2020-11-20 10:40 ` Ard Biesheuvel
2020-11-20 10:42 ` Herbert Xu
2020-11-20 10:43 ` Ard Biesheuvel
2020-11-20 10:45 ` Herbert Xu
2020-11-20 10:45 ` Ard Biesheuvel
2020-11-09 8:31 ` [PATCH 3/3] crypto: tcrypt - include 1420 byte blocks in aead and skcipher benchmarks Ard Biesheuvel
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=20201109175947.GA853@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=ardb@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox