Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp560901pxb; Wed, 13 Apr 2022 07:49:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+wvFuV0wMzauEJcJVhRy7oXxVaM8fVjMI8WYCzKDHps/SGgqZS7/pMEqFck9aJyEhqGJL X-Received: by 2002:a05:6a00:b53:b0:4fa:ecb7:1deb with SMTP id p19-20020a056a000b5300b004faecb71debmr43203202pfo.80.1649861345636; Wed, 13 Apr 2022 07:49:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649861345; cv=none; d=google.com; s=arc-20160816; b=rOxwxFFmCdoA0kR2ohROrZ87lKmKJFB0QK5kMvO00IHkiLx90vDeoqpNHZWSgiBX15 Wk14qv+FdaRnSdr5Scb7d0ql6ibnqUoN25KV/khVMKedqs7YqtyJOmS1HcjbQcHoMQrB yj3zGBUpEBIE7rfWgh7t96k6b/5TS1XWJewbdsmtxdiFc8ZuPMoBeUQGyeEuvnPhgjh5 A2XeifzHIWbHBPzF3hN2kAXE9T5lkY9lOIUwYD6PZTRz6f7tZ4q9UP3OEFdPoaoKqbFh /oMK+JeCshiawAlFXqfoh4wrQ2/mO0whHr/aESi2jyxfWuLmidebjaSkgP4T/rY+VGQZ ziGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=WQ8tSjBCZnlHfpbIldTC7awM6xQAAePyp5LvhjRtABM=; b=D2ZuCJpMVnnZ7psdDl3dq0E8mpgyIkVmPcG8g64G+0A3iXG7bShU8eSUywvBso5Uk6 Tn6Cnk9NBd4BkMH3/DTU4F38S1JCSgQ7vIlSEMfwvRira+75fsiq98bFsGkzHobPUvmN 9qSx905Nxj9DOAtrxNxZdoJ9scEyLRu1X2RL4qNF1NV/iWdnN6DiFu68dsUCW/fOUHvt 3ejwsl97J6K0MX+ZUwJOGHRptwIPOuQMVYxIwpnoFSmbouPNAojvuiSZT4siY78dQS13 woUxtJRUDgK41Yiz+FA0DYgfxar99eAjoWBGZ/WUHYUEfMjyeeKAwL/RZL4ItX08k76H QWVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 f9-20020a636a09000000b003847a033b69si5861327pgc.296.2022.04.13.07.48.49; Wed, 13 Apr 2022 07:49:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233281AbiDMMsy (ORCPT + 99 others); Wed, 13 Apr 2022 08:48:54 -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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-kernel@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