From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,FSL_HELO_FAKE,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 193D8C04AAF for ; Tue, 21 May 2019 18:34:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E46E6217F5 for ; Tue, 21 May 2019 18:34:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OCPr4J9H"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="qlKEBLZM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E46E6217F5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+O0z0u7ttsv0+dAk7rSUOGPeCzb5PijbvZebajh+WMU=; b=OCPr4J9HQ/terO TdbTAI7/OzjvuW/wpP1bNOQNgArpydY9Q36LqmCsYkP5EJS8IeFpr5HnoGlfJ1h1sx68lfnTFkaGA rkzk6M1YA7Zhl+mm1OpbUah2ebIbuaN+xqTse8idOkXDaUMAMSg8i1r8NuC2Abm9vzKYkWSiscRHX fhsdrgdgmr4QlRoaBAWUbcNfoCAkVsqOPqA5wns1feDtrlyX23LmfHF3iqqEf+yw57Gujz/r0lC3w h4mpRGd5AAyYSL3PSFrwNuoxmU73S8Xrc2IgPAnwf+8y7i+qxU2QBo2jM/NBvUGpf/kR699qVbc03 EgEb3c7igugEJmbOGs4g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hT9am-0003WJ-79; Tue, 21 May 2019 18:34:28 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hT9ai-0003VX-It for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2019 18:34:26 +0000 Received: from gmail.com (unknown [104.132.1.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DE3E62173E; Tue, 21 May 2019 18:34:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558463660; bh=TS+Myr7yTT1qT00ODngyVPlLPpDgzJtrP5FUpXyLIEs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qlKEBLZMfmLyAMNkN9oCsU/Wup5zhTA9zasTLh40i5Zyp8qlqlklHK/+m2/KGngOA pixi4WTFD9n5AjTcIiG1TLcRJkcI8p+yapxLMdOLxC1pPHv+UveLyUuFDmm2loPgD6 2kTmneGIO6MOBoGzSbrjqVpWxH879GcvzelQ5xMI= Date: Tue, 21 May 2019 11:34:18 -0700 From: Eric Biggers To: Geert Uytterhoeven Subject: Re: crypto: run initcalls for generic implementations earlier Message-ID: <20190521183417.GA121164@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190521_113424_653588_9E82A8BD X-CRM114-Status: GOOD ( 21.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Herbert Xu , Daniel Lezcano , Linux Kernel Mailing List , Linux-Renesas , Linux Crypto Mailing List , Thomas Gleixner , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, May 21, 2019 at 06:39:00PM +0200, Geert Uytterhoeven wrote: > Hi Eric, > > On Tue, May 7, 2019 at 5:26 AM Linux Kernel Mailing List > wrote: > > Commit: c4741b23059794bd99beef0f700103b0d983b3fd > > Parent: 40153b10d91c9e25f912344ba6ce1f0874400659 > > Refname: refs/heads/master > > Web: https://git.kernel.org/torvalds/c/c4741b23059794bd99beef0f700103b0d983b3fd > > Author: Eric Biggers > > AuthorDate: Thu Apr 11 21:57:42 2019 -0700 > > Committer: Herbert Xu > > 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 > > Signed-off-by: Herbert Xu > > > --- 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 > Thanks for the bug report. It seems there was no point for my patch to change jitterentropy_rng, since it's not a generic crypto algorithm that has multiple implementations, nor is it testable by the crypto self-tests. So I'll send a patch that changes it back to module_init(). - Eric _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel