Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4285180pxu; Tue, 1 Dec 2020 00:42:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJypJ8FStgYq3VQbH0ZDgLfHId8xWdhFcYP/ubMlzKzFRAWKN0YIC7FWIT8TrVqOKq1/EGw7 X-Received: by 2002:a17:906:af83:: with SMTP id mj3mr1868934ejb.243.1606812170184; Tue, 01 Dec 2020 00:42:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606812170; cv=none; d=google.com; s=arc-20160816; b=1C9RmgeIk8LPBA0lESleNHzHMVSHoWoef5qkBc8qZyBImTlHKGtpzZj1L3LPN3i4GG vgnuhal90Kd9KfnZGNaY4zcvrb4A9NB/kHVLa5UesxWTJa5OxbfQCXeOIfugBlEguvXs B3AXAoYciyzCj/PSVvmMrRLPH6K+nez/I8EsyyWYYMxEZFjLf8+OpcLetAZta5QWSX77 LrfC8RMraMRYN8Wdm22oOsSQsIv2uIMtMzZrFofbI126y+MX/CBNAwMRq0O9g39qWJvT ws+ikxAjDHMhKv9uoXTZuMqwXtjM/uT3TiWIA0CK1eT0zL+0HdIijUx8ULuypkiXeN/Y V6Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=lI7g5f2qy21NMjDs40ii6Rk2yqnFrfv1k7bpl8TRJNY=; b=EIBgCsCIIwJMZBhSfD4rZoB9TsDfRXnlrvQn2mHSOl8XNQ7zb70/c1BnhDqBq7BABO s0C/nw7TPlmr6E0lr95NdIGA7JpNcWC3esHqvLsXnd+CsggVo48nnwhzYUFHUtFUdHLk W/etU+A/AjYNdVGmeCHLJlstm6bmybkxDjcwh/NY3ZG/EvMN7lU5CMeYd7j1RyI8NUDW DzxzpSWrsbXOdEVqj/mKgtXvXuF7yGI6LgOVdwsEwffB8EdJb+h7olv09p4McVBoUmvU pP3+tcQ/LLybttpEGTYX2rknsMAdRF3QkNIv3hf6fQ5yZ0fIBSOiL5Rgz8XXz48pmo4K xxUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=E5hLKCNP; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y7si482662ejw.546.2020.12.01.00.42.21; Tue, 01 Dec 2020 00:42:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=E5hLKCNP; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728014AbgLAIhz (ORCPT + 99 others); Tue, 1 Dec 2020 03:37:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:52088 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727253AbgLAIhy (ORCPT ); Tue, 1 Dec 2020 03:37:54 -0500 Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F1A47216C4; Tue, 1 Dec 2020 08:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606811834; bh=e8JrzJWeuIo1NZeYPMcOvF7yCpKy+jzFNIQUQ88Bvqg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=E5hLKCNPzPZ8UenenX+jbkaIda/JRuJ7VSF0RevT/+xfrHF2faxfp8xLuVAxyXxAc rfqHpbl+TXREjuhdw4SBWeqJ/Hu4vH2V8q/6vK+sF2tAuCpDxA9/PtyTaUoZ06xH8K yhlEXBBSkurzj6jqVS2UrXOwYXzAm3ZaSGPI0h1U= Received: by mail-oi1-f182.google.com with SMTP id w15so933159oie.13; Tue, 01 Dec 2020 00:37:13 -0800 (PST) X-Gm-Message-State: AOAM532vpzVYN+cv2vBEWVTMlGCq0dkUDCmX0X2sVbi/xBCzlSUyRuaS EvbDzuLhoVIZqrrwH6oQMpBUHRgmXDF6+VYxkaQ= X-Received: by 2002:aca:b809:: with SMTP id i9mr1080357oif.174.1606811832882; Tue, 01 Dec 2020 00:37:12 -0800 (PST) MIME-Version: 1.0 References: <20201015110241.89676-1-tianjia.zhang@linux.alibaba.com> <20201015120504.GA12976@gondor.apana.org.au> <20201130022422.GA21049@gondor.apana.org.au> In-Reply-To: From: Ard Biesheuvel Date: Tue, 1 Dec 2020 09:37:02 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] crypto: ecrdsa - use subsys_initcall instead of module_init To: Tianjia Zhang Cc: Herbert Xu , Vitaly Chikunov , "David S. Miller" , Linux Crypto Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Mon, 30 Nov 2020 at 07:58, Tianjia Zhang wrote: > > > > On 11/30/20 10:24 AM, Herbert Xu wrote: > > On Mon, Nov 30, 2020 at 10:21:56AM +0800, Tianjia Zhang wrote: > >> > >>> That is true only if there are non-generic implementations of > >>> the algorithms, which is not the case here. Please explain the > >>> real reason why this is needed. > >> > >> This is a generic algorithm, the author Vitaly Chikunov has also confi= rmed > >> it, please consider this patch again. > > > > As I said, the generic algorithm only needs to be loaded early *if* > > there are non-generic implementations. > > > > Cheers, > > > > For ecrdsa, there is no reason to advance the initialization to > subsys_init, this is just to make code clean up to have algorithm > initialization uniform with other implementations. > > It=E2=80=99s just that I think that in the commit c4741b230597 ("crypto: = run > initcalls for generic implementations earlier"), the modification to > ecrdsa happened to be omitted, because from the point of commit time, it > was submitted at the same time as the ecrdsa commits, and it may happen > to be omitted for ecrdsa. > Whether or not it is a generic algorithm is irrelevant. What is relevant is whether any other implementations exist of the same algorithm, because in this case, the generic implementation must be available earlier, so that it can be used for testing the other implementation. This concern does not apply for ecrdsa, so this patch is unnecessary.