linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Eric Biggers <ebiggers@google.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: crypto: run initcalls for generic implementations earlier
Date: Tue, 21 May 2019 18:39:00 +0200	[thread overview]
Message-ID: <CAMuHMdWSUMOh1uG1g+cipup86ZpiVYuHDpPJtp+gSmmUyjB6eA@mail.gmail.com> (raw)
In-Reply-To: <git-mailbomb-linux-master-c4741b23059794bd99beef0f700103b0d983b3fd@kernel.org>

Hi Eric,

On Tue, May 7, 2019 at 5:26 AM Linux Kernel Mailing List
<linux-kernel@vger.kernel.org> wrote:
> Commit:     c4741b23059794bd99beef0f700103b0d983b3fd
> Parent:     40153b10d91c9e25f912344ba6ce1f0874400659
> Refname:    refs/heads/master
> Web:        https://git.kernel.org/torvalds/c/c4741b23059794bd99beef0f700103b0d983b3fd
> Author:     Eric Biggers <ebiggers@google.com>
> AuthorDate: Thu Apr 11 21:57:42 2019 -0700
> Committer:  Herbert Xu <herbert@gondor.apana.org.au>
> CommitDate: Thu Apr 18 22:15:03 2019 +0800
>
>     crypto: run initcalls for generic implementations earlier
>
>     Use subsys_initcall for registration of all templates and generic
>     algorithm implementations, rather than module_init.  Then change
>     cryptomgr to use arch_initcall, to place it before the subsys_initcalls.
>
>     This is needed so that when both a generic and optimized implementation
>     of an algorithm are built into the kernel (not loadable modules), the
>     generic implementation is registered before the optimized one.
>     Otherwise, the self-tests for the optimized implementation are unable to
>     allocate the generic implementation for the new comparison fuzz tests.
>
>     Note that on arm, a side effect of this change is that self-tests for
>     generic implementations may run before the unaligned access handler has
>     been installed.  So, unaligned accesses will crash the kernel.  This is
>     arguably a good thing as it makes it easier to detect that type of bug.
>
>     Signed-off-by: Eric Biggers <ebiggers@google.com>
>     Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

> --- a/crypto/jitterentropy-kcapi.c
> +++ b/crypto/jitterentropy-kcapi.c
> @@ -198,7 +198,7 @@ static void __exit jent_mod_exit(void)
>         crypto_unregister_rng(&jent_alg);
>  }
>
> -module_init(jent_mod_init);
> +subsys_initcall(jent_mod_init);
>  module_exit(jent_mod_exit);
>
>  MODULE_LICENSE("Dual BSD/GPL");

This change causes jitterentropy to fail on Renesas SoCs based on
single-core Cortex A9 with:

    jitterentropy: Initialization failed with host not compliant with
requirements: 2

This happens because jitterentropy is now initialized before the main
clocksource is activated, i.e. before

    clocksource: Switched to clocksource ostm timer (on RZ/A1)
    clocksource: Switched to clocksource fff80000.timer (on R-Mobile A1)

is printed.
RZ/A1 and R-Mobile A1 SoCs rely on the OSTM resp. TMU timers.

The issue does not happen on SoCs with Cortex A15 cores (with ARM
architectured timer) or Cortex A9 multicore (with ARM global timer).

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

       reply	other threads:[~2019-05-21 16:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <git-mailbomb-linux-master-c4741b23059794bd99beef0f700103b0d983b3fd@kernel.org>
2019-05-21 16:39 ` Geert Uytterhoeven [this message]
2019-05-21 18:34   ` crypto: run initcalls for generic implementations earlier Eric Biggers
2019-05-21 18:46     ` [PATCH] crypto: jitterentropy - change back to module_init() Eric Biggers
2019-05-22  7:21       ` Geert Uytterhoeven
2019-05-30 13:42       ` Herbert Xu

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=CAMuHMdWSUMOh1uG1g+cipup86ZpiVYuHDpPJtp+gSmmUyjB6eA@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=ebiggers@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=tglx@linutronix.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).