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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09E4AC4332F for ; Wed, 13 Apr 2022 12:46:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233195AbiDMMsw (ORCPT ); Wed, 13 Apr 2022 08:48:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231896AbiDMMsv (ORCPT ); Wed, 13 Apr 2022 08:48:51 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A08B31EAF3; Wed, 13 Apr 2022 05:46:30 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 3F3EF92009C; Wed, 13 Apr 2022 14:46:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 2EF4892009B; Wed, 13 Apr 2022 13:46:29 +0100 (BST) Date: Wed, 13 Apr 2022 13:46:29 +0100 (BST) From: "Maciej W. Rozycki" To: Thomas Bogendoerfer cc: "Jason A. Donenfeld" , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, tglx@linutronix.de, arnd@arndb.de, Theodore Ts'o , Dominik Brodowski , Russell King , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Paul Walmsley , Palmer Dabbelt , Albert Ou , "David S . Miller" , Richard Weinberger , Anton Ivanov , Johannes Berg , Ingo Molnar , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , Chris Zankel , Max Filippov , John Stultz , Stephen Boyd , Dinh Nguyen , linux-arm-kernel@lists.infradead.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, x86@kernel.org, linux-xtensa@linux-xtensa.org Subject: Re: [PATCH v4 04/11] mips: use fallback for random_get_entropy() instead of zero In-Reply-To: <20220413122546.GA11860@alpha.franken.de> Message-ID: References: <20220413115411.21489-1-Jason@zx2c4.com> <20220413115411.21489-5-Jason@zx2c4.com> <20220413122546.GA11860@alpha.franken.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, 13 Apr 2022, Thomas Bogendoerfer wrote: > > diff --git a/arch/mips/include/asm/timex.h b/arch/mips/include/asm/timex.h > > index b05bb70a2e46..abc60a6395e3 100644 > > --- a/arch/mips/include/asm/timex.h > > +++ b/arch/mips/include/asm/timex.h > > @@ -94,7 +94,7 @@ static inline unsigned long random_get_entropy(void) > > else if (likely(imp != PRID_IMP_R6000 && imp != PRID_IMP_R6000A)) > > return read_c0_random(); > > else > > - return 0; /* no usable register */ > > + return random_get_entropy_fallback(); /* no usable register */ > > } > > #define random_get_entropy random_get_entropy > > > > -- > > 2.35.1 > > Acked-by: Thomas Bogendoerfer Or we could drop the PRID_IMP_R6000/A check and the final `else' clause entirely, as we don't even pretend to support the R6k at all anymore, and this is the final reference remaining. For one we no longer handle the CPU in `cpu_probe_legacy' so any attempt to boot on such a CPU would inevitably fail as no CPU options would be set (we probably should have a `panic' or suchlike as the default case for the switch statement there). Therefore I'm all for removing this piece instead, complementing commit 3b2db173f012 ("MIPS: Remove unused R6000 support"), where it should have really happened. Maciej 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 46982C433F5 for ; Wed, 13 Apr 2022 12:47:03 +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:MIME-Version:References:Message-ID: In-Reply-To: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=F0pnD0lQcT3JtB/BIqpU+DgBWlbWbGhVxMFg7vak8Cc=; b=FcT1CYsw6w5nh/ Cf/9NWwAX/gw0UC1g3b4MV3iXQ5VCj2VV3G359gTruzQEm3omzQxNj1WCk0f0CfiF2McNWnu9jzff WuHOqIIyNTc6GZDmL4wKj0Q12cI0ghwfoxXtcV7rqRghiPl5sRl2UAP6dCKi4pyZUxoLDJHI12UJK zauIJcF0fl/0R7ABs98wlI/lGw0/fZ8i2OM4vFfMIRFUOt2p63jDcYmIqyF3C6Eyz5XPG+RBM3A7x Hq9bFF1U+W7r1nCL33gEsFtClnmx5bhxtOQvdIkUHvOaB4V1AzKYXJB/fb6XjaE5YoUN3/DBONLdu xpsqwd67gktzNQ82NoSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1necOX-0013aW-QX; Wed, 13 Apr 2022 12:46:49 +0000 Received: from angie.orcam.me.uk ([2001:4190:8020::34]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1necOK-0013W2-3V; Wed, 13 Apr 2022 12:46:37 +0000 Received: by angie.orcam.me.uk (Postfix, from userid 500) id 3F3EF92009C; Wed, 13 Apr 2022 14:46:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 2EF4892009B; Wed, 13 Apr 2022 13:46:29 +0100 (BST) Date: Wed, 13 Apr 2022 13:46:29 +0100 (BST) From: "Maciej W. Rozycki" To: Thomas Bogendoerfer cc: "Jason A. Donenfeld" , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, tglx@linutronix.de, arnd@arndb.de, Theodore Ts'o , Dominik Brodowski , Russell King , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Paul Walmsley , Palmer Dabbelt , Albert Ou , "David S . Miller" , Richard Weinberger , Anton Ivanov , Johannes Berg , Ingo Molnar , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , Chris Zankel , Max Filippov , John Stultz , Stephen Boyd , Dinh Nguyen , linux-arm-kernel@lists.infradead.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, x86@kernel.org, linux-xtensa@linux-xtensa.org Subject: Re: [PATCH v4 04/11] mips: use fallback for random_get_entropy() instead of zero In-Reply-To: <20220413122546.GA11860@alpha.franken.de> Message-ID: References: <20220413115411.21489-1-Jason@zx2c4.com> <20220413115411.21489-5-Jason@zx2c4.com> <20220413122546.GA11860@alpha.franken.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220413_054636_337546_B5A848EB X-CRM114-Status: GOOD ( 14.99 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Wed, 13 Apr 2022, Thomas Bogendoerfer wrote: > > diff --git a/arch/mips/include/asm/timex.h b/arch/mips/include/asm/timex.h > > index b05bb70a2e46..abc60a6395e3 100644 > > --- a/arch/mips/include/asm/timex.h > > +++ b/arch/mips/include/asm/timex.h > > @@ -94,7 +94,7 @@ static inline unsigned long random_get_entropy(void) > > else if (likely(imp != PRID_IMP_R6000 && imp != PRID_IMP_R6000A)) > > return read_c0_random(); > > else > > - return 0; /* no usable register */ > > + return random_get_entropy_fallback(); /* no usable register */ > > } > > #define random_get_entropy random_get_entropy > > > > -- > > 2.35.1 > > Acked-by: Thomas Bogendoerfer Or we could drop the PRID_IMP_R6000/A check and the final `else' clause entirely, as we don't even pretend to support the R6k at all anymore, and this is the final reference remaining. For one we no longer handle the CPU in `cpu_probe_legacy' so any attempt to boot on such a CPU would inevitably fail as no CPU options would be set (we probably should have a `panic' or suchlike as the default case for the switch statement there). Therefore I'm all for removing this piece instead, complementing commit 3b2db173f012 ("MIPS: Remove unused R6000 support"), where it should have really happened. Maciej _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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 6134AC433EF for ; Wed, 13 Apr 2022 12:47:40 +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:MIME-Version:References:Message-ID: In-Reply-To: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=DS8fSnFGVMLiIJu05xUwagQJW4VMM6ZJXo2nSe9sSIY=; b=LTmZOMll5LUPUA 20mjtFvK24uRaZ1JRGOj9iZc6K0xjqgBHFH41SBo7cdl9Ijt2kw1U8tlBJABSLZN5i4Vk7Fhe5bMo /CT2cyru8iV53HXRnr/IUDmitrOmJ+baQZdQpsrdmTn1DnJb49XI+rOHypIqhHpX+FsxV+5EWGDg+ D7lmd9S86vx0h/UdFSDgfVg3csoRJZZY4+uzK2vXYgrNozQ+XAzMS3CnhSN08rQWP9MjrZiqPHbIT 3JW2nKErJUkY2D/6Jwtdt+kUkU/nSxDjWNhcw8uwdlxYlFv+C3mtGU0SHTjHsSdncvywwKyC1ttiZ k7lCdQ5ci3SiELJzx/RQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1necOO-0013YW-Kn; Wed, 13 Apr 2022 12:46:40 +0000 Received: from angie.orcam.me.uk ([2001:4190:8020::34]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1necOK-0013W2-3V; Wed, 13 Apr 2022 12:46:37 +0000 Received: by angie.orcam.me.uk (Postfix, from userid 500) id 3F3EF92009C; Wed, 13 Apr 2022 14:46:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 2EF4892009B; Wed, 13 Apr 2022 13:46:29 +0100 (BST) Date: Wed, 13 Apr 2022 13:46:29 +0100 (BST) From: "Maciej W. Rozycki" To: Thomas Bogendoerfer cc: "Jason A. Donenfeld" , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, tglx@linutronix.de, arnd@arndb.de, Theodore Ts'o , Dominik Brodowski , Russell King , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Paul Walmsley , Palmer Dabbelt , Albert Ou , "David S . Miller" , Richard Weinberger , Anton Ivanov , Johannes Berg , Ingo Molnar , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , Chris Zankel , Max Filippov , John Stultz , Stephen Boyd , Dinh Nguyen , linux-arm-kernel@lists.infradead.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, x86@kernel.org, linux-xtensa@linux-xtensa.org Subject: Re: [PATCH v4 04/11] mips: use fallback for random_get_entropy() instead of zero In-Reply-To: <20220413122546.GA11860@alpha.franken.de> Message-ID: References: <20220413115411.21489-1-Jason@zx2c4.com> <20220413115411.21489-5-Jason@zx2c4.com> <20220413122546.GA11860@alpha.franken.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220413_054636_337546_B5A848EB X-CRM114-Status: GOOD ( 14.99 ) 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 Wed, 13 Apr 2022, Thomas Bogendoerfer wrote: > > diff --git a/arch/mips/include/asm/timex.h b/arch/mips/include/asm/timex.h > > index b05bb70a2e46..abc60a6395e3 100644 > > --- a/arch/mips/include/asm/timex.h > > +++ b/arch/mips/include/asm/timex.h > > @@ -94,7 +94,7 @@ static inline unsigned long random_get_entropy(void) > > else if (likely(imp != PRID_IMP_R6000 && imp != PRID_IMP_R6000A)) > > return read_c0_random(); > > else > > - return 0; /* no usable register */ > > + return random_get_entropy_fallback(); /* no usable register */ > > } > > #define random_get_entropy random_get_entropy > > > > -- > > 2.35.1 > > Acked-by: Thomas Bogendoerfer Or we could drop the PRID_IMP_R6000/A check and the final `else' clause entirely, as we don't even pretend to support the R6k at all anymore, and this is the final reference remaining. For one we no longer handle the CPU in `cpu_probe_legacy' so any attempt to boot on such a CPU would inevitably fail as no CPU options would be set (we probably should have a `panic' or suchlike as the default case for the switch statement there). Therefore I'm all for removing this piece instead, complementing commit 3b2db173f012 ("MIPS: Remove unused R6000 support"), where it should have really happened. Maciej _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel