Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1324313rwb; Sun, 6 Nov 2022 23:41:19 -0800 (PST) X-Google-Smtp-Source: AMsMyM7gsiM2XNCD1Jl5RmUvFZwlMxcuXblzcKI55FBHyIECStoJ71aqyGXLY/PIBEmvzbZlZVXs X-Received: by 2002:a17:902:6a86:b0:176:a6bc:54c0 with SMTP id n6-20020a1709026a8600b00176a6bc54c0mr50556356plk.87.1667806879474; Sun, 06 Nov 2022 23:41:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667806879; cv=none; d=google.com; s=arc-20160816; b=EI1KY+qduaIducO60hwTBg2c4piuUv6e3KIPaXkE78Y0rixJTjIev4Cg8A9L0sFOQ3 KW+b1GgejRYBWWF8rzd/4cpojyxs4vUbnNrRK1LxkuhnLV/reUsaXhpEzLiGEBl1JVTp bTzDjSFEhsEpnik5eynjr4cdpRhKEYyBU0PcEop93/5LGHgV3MIl1BKkGmNxsOLN6fIY GOSOz/OH76cB2S7qBr5allHXs5xrQFu0z5Xu73MCitfU0aBkahQB3pBV30+W2wjhFSq9 Bn617azuuHKO0mYJHtRaB6/u1NAEMyNV+GLKbpFkkOvIoNL6aBEXViG/vIeG3kOobtcL vRwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=fK8e7keuCbkWowa2BZDpTCTt1CT+R7iPsAsHVDomo8o=; b=b3B7X4tWGsgUj5VlQn5DEeiIHdFgL5EKEWl4B3IF9pzdbITgbps9QSaO9TbBNUUBY7 vAOb5//LRTOpMYn9VfueXnRKMdtvsmY2dPhgoP0MV26GBtWZSLvrzRe8tOjQt4ixkTRq ZoWxNc+D8/Kp6E9d7tViFeOfoJk+NJD5tExVFMOK34LY67iYYVMdgKVE+n57oyCzE7tN V2yg/8hZi6po1ZVyCuyvWBP3t7nbPr0LAIC6JUNJmWYY8fc3n3d21KgN7gh+ac/ZyCYz y4+3Wj50e/rqZ0HYqsFgTPONty2MrfdYQvvKfH+NiKulSjxYGdsQivoj0aBA1gUyBaYX Ys+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h1-20020a170902704100b001789a178e33si9140627plt.428.2022.11.06.23.40.57; Sun, 06 Nov 2022 23:41:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231152AbiKGHjd (ORCPT + 99 others); Mon, 7 Nov 2022 02:39:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231216AbiKGHjc (ORCPT ); Mon, 7 Nov 2022 02:39:32 -0500 Received: from isilmar-4.linta.de (isilmar-4.linta.de [136.243.71.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C94E6D9A for ; Sun, 6 Nov 2022 23:39:30 -0800 (PST) X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES Received: from owl.dominikbrodowski.net (owl.brodo.linta [10.2.0.111]) by isilmar-4.linta.de (Postfix) with ESMTPSA id D06EC201472; Mon, 7 Nov 2022 07:39:28 +0000 (UTC) Received: by owl.dominikbrodowski.net (Postfix, from userid 1000) id AB650806D5; Mon, 7 Nov 2022 08:37:52 +0100 (CET) Date: Mon, 7 Nov 2022 08:37:52 +0100 From: Dominik Brodowski To: "Jason A. Donenfeld" Cc: herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org Subject: Re: [PATCH v2] hw_random: use add_hwgenerator_randomness() for early entropy Message-ID: References: <20221106015042.98538-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi Jason, Am Sun, Nov 06, 2022 at 03:50:51PM +0100 schrieb Jason A. Donenfeld: > On Sun, Nov 06, 2022 at 08:02:56AM +0100, Dominik Brodowski wrote: > > Am Sun, Nov 06, 2022 at 02:50:42AM +0100 schrieb Jason A. Donenfeld: > > > Rather than calling add_device_randomness(), the add_early_randomness() > > > function should use add_hwgenerator_randomness(), so that the early > > > entropy can be potentially credited, which allows for the RNG to > > > initialize earlier without having to wait for the kthread to come up. > > > > We're already at device_initcall() level here, so that shouldn't be much of > > an additional delay. > > Either the delay is not relevant, in which case we should entirely > remove `add_early_randomness()`, There's another subtlety going on here: add_device_randomness() is called for *all* hw_random devices upon their registration, while the hwrng thread currently only works with the hw_random device with the best quality available. Thanks, Dominik