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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A7503C433FE for ; Tue, 1 Nov 2022 14:06:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=7HS5m87WjwkwXBGpelpQEz2XA2PWOW8wOeDQY46+9zI=; b=igYrvrTtASvJu/ kSqcobVmtEqSOZad9wnJxes1lQ3vSBru/TUROw6pi/SIWNCnXmVKDzORAkjWUnvtI9HLzSNUaYk3t NyeXHUhWT7j80RAzbJH1xWvNjq/DSPwQWJCUFWGPAq36R8aKYrZSDV8jY+ACQAl2d9Bs9UiWUUMek KdlrzYDJBwjJf5iIb8bs/xDyW/oF6wruJX7PSXMtRF1WLqqJbxCkKGva//JeBGOJsC3e7G8Egn7zR 6B2qYx4Vg5nCqCYnCvcWY07TezLHO2wL/YsieJmiXLbUli8GMuWMpk1IKqSBwaPs/EJ84FtsOOWiE gnsS/RmjvnIKbTSqvz+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oprtv-005Nno-LZ; Tue, 01 Nov 2022 14:05:59 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oprtt-005NnC-6r for linux-arm-kernel@lists.infradead.org; Tue, 01 Nov 2022 14:05:58 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C002361218; Tue, 1 Nov 2022 14:05:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC2B0C433D6; Tue, 1 Nov 2022 14:05:54 +0000 (UTC) Date: Tue, 1 Nov 2022 14:05:51 +0000 From: Catalin Marinas To: "Jason A. Donenfeld" Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Will Deacon , Ard Biesheuvel , Jean-Philippe Brucker Subject: Re: [PATCH v5] random: remove early archrandom abstraction Message-ID: References: <20221101115616.232884-1-Jason@zx2c4.com> <20221101122527.323843-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221101122527.323843-1-Jason@zx2c4.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221101_070557_304621_F2473B54 X-CRM114-Status: GOOD ( 16.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Nov 01, 2022 at 01:25:28PM +0100, Jason A. Donenfeld wrote: > The arch_get_random*_early() abstraction is not completely useful and > adds complexity, because it's not a given that there will be no calls to > arch_get_random*() between random_init_early(), which uses > arch_get_random*_early(), and init_cpu_features(). During that gap, > crng_reseed() might be called, which uses arch_get_random*(), since it's > mostly not init code. > > Instead we can test whether we're in the early phase in > arch_get_random*() itself, and in doing so avoid all ambiguity about > where we are. Fortunately, the only architecture that currently > implements arch_get_random*_early() also has an alternatives-based cpu > feature system, one flag of which determines whether the other flags > have been initialized. This makes it possible to do the early check with > zero cost once the system is initialized. > > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Ard Biesheuvel > Cc: Jean-Philippe Brucker > Signed-off-by: Jason A. Donenfeld Reviewed-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel