Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2516253pxb; Mon, 18 Apr 2022 02:03:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzriOmU9A+vRwvC76w0hCcfcsB+T3nnDwa62hxR28gnqxnqnrBkvbwJGMrhElCaSUOzLnqI X-Received: by 2002:a63:67c4:0:b0:3a3:2134:aed7 with SMTP id b187-20020a6367c4000000b003a32134aed7mr9106314pgc.398.1650272585056; Mon, 18 Apr 2022 02:03:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650272585; cv=none; d=google.com; s=arc-20160816; b=WSJ1rtGqS72fC8a8qo1f2babTHNKLQxIMeaTyKy+ewlEi3fLa9CMytWI3PQhG3NJ5O UTFj/Hwn/wcz+Jsrr9Xvy2K9BKF3KDE+vauulOr1jVqlJ3MYX7gwy4K49v/nKyeSbrYz cZsiJsgPV3BC7akhj3Ku8a2SPVyyDlDk/J6p1cxP6KoYkYZEVhLn6nm4rVKHfgBNyyfD kTB3Nxayg7RKkl3O95jsL/MuYtKoOdyBH75MS7fqUU2Y4RQ4iqaDArUxa/kYzQdkumhT U1VTNCUZU3mib9W+P8cbzfYDRndeRZt0LWeiHbWG6LFLsTIDrpJ++qbANI43m2jaSbck Nvjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=LV8O1hp38USUDZCfC4te/SDl4sAg4dkNaqUQx6DnGgM=; b=T7o8+5chmQiBdaL4VXEStYjUtBvOxPFG6oB5mB54lDkQZC8tJv4WhP1uxV4SNz42Q8 cHgWCUDCnk26btTRplIHbId5haSIAy+oaRWKkPTx8D7j7ZyGM8Lz4X0tJzAmecNboguX a4AHvGZTGOPWt8zYEoB8q4F+YSd+9XBbt1qNliZRbM+IJKwG2v68E0r8eswNPUkHjnLn KPvpGDSr3LGwzxy7p/NxwPyyOB4iWk2LPYyNq+3v5SE2r/lJdpIE3DdKRC+wD4TA9LB8 f649zJaGy0eGTl187Rfnq1p1FzQ2cU1loYJRoSVjzZlcXEEtp6/vMzVVb9h0nAPqq3Bp HdRA== 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 g18-20020a056a001a1200b004fb04dde469si5259802pfv.23.2022.04.18.02.02.35; Mon, 18 Apr 2022 02:03:04 -0700 (PDT) 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 S235175AbiDRHNV (ORCPT + 99 others); Mon, 18 Apr 2022 03:13:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230360AbiDRHNU (ORCPT ); Mon, 18 Apr 2022 03:13:20 -0400 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 098C6167E7; Mon, 18 Apr 2022 00:10:41 -0700 (PDT) Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1ngLWo-0008Ga-00; Mon, 18 Apr 2022 09:10:30 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 7A686C0193; Mon, 18 Apr 2022 09:10:05 +0200 (CEST) Date: Mon, 18 Apr 2022 09:10:05 +0200 From: Thomas Bogendoerfer To: "Maciej W. Rozycki" Cc: "Jason A. Donenfeld" , LKML , Linux Crypto Mailing List , Thomas Gleixner , Arnd Bergmann , 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 , linux-m68k , "open list:BROADCOM NVRAM DRIVER" , linux-riscv , sparclinux@vger.kernel.org, linux-um@lists.infradead.org, X86 ML , linux-xtensa@linux-xtensa.org Subject: Re: [PATCH v4 04/11] mips: use fallback for random_get_entropy() instead of zero Message-ID: <20220418071005.GA4075@alpha.franken.de> References: <20220413115411.21489-1-Jason@zx2c4.com> <20220413115411.21489-5-Jason@zx2c4.com> <20220413122546.GA11860@alpha.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On Fri, Apr 15, 2022 at 01:26:48PM +0100, Maciej W. Rozycki wrote: > Hi Jason, > > > > It depends on the exact system. Some have a 32-bit high-resolution > > > counter in the chipset (arch/mips/kernel/csrc-ioasic.c) giving like 25MHz > > > resolution, some have nothing but jiffies. > > > > Alright, so there _are_ machines with no c0 cycles but with a good > > clock. Yet, 25MHz is still less than the cpu cycle, so this c0 random > > ORing trick remains useful perhaps. > > It's not much less than the CPU cycle really, given that the R3k CPUs are > clocked at up to 40MHz in the systems concerned and likewise the buggy R4k > CPUs run at up to 60MHz (and mind that their CP0 Count register increments > at half the clock rate, so the rate is up to 30MHz anyway). The overhead > of the calculation is more than that, let alone the latency and issue rate > of an uncached MMIO access to the chipset register. > > Also the systems I have in mind and that lack a counter in the chipset > actually can make use of the buggy CP0 timer, because it's only when CP0 > timer interrupts are used that the erratum matters, but they use a DS1287 > RTC interrupt instead unconditionally as the clock event (see the comment > at the bottom of arch/mips/dec/time.c). But this has not been factored in > with `can_use_mips_counter' (should it just check for `mips_hpt_frequency' > being zero perhaps, meaning the timer interrupt not being used?). > > Thomas, do you happen to know if any of the SGI systems that we support > had buggy early R4k chips? IP22 has probably seen all buggy MIPS chips produced, so yes I even own Indy/Indigo2 CPU boards with early R4k chips. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]