Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2243012pxb; Sun, 24 Apr 2022 08:49:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDMYNDkYnMmPtfWcwOeOVHSGs+Fy+M9Z27toIZJHBIBa7kFwJwi84nbCOeFs6XpFZyEk+b X-Received: by 2002:a63:d64b:0:b0:382:6aff:3e43 with SMTP id d11-20020a63d64b000000b003826aff3e43mr11603763pgj.438.1650815381141; Sun, 24 Apr 2022 08:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650815381; cv=none; d=google.com; s=arc-20160816; b=KUgCw1zrELeOjB/uY2gR8Vb5NWGkQb0sw1G1hkD/iQJFRznF4KZHLyN1z3XaurPpw6 3GXD/xCcy8vd4AviVRh91I9GfLn1/ZBqHTck2w8EyDj1YClqtIyq82v7Fsmza4nVdo6o VMkXfmGiTYO+4BPEiMg2RCpKUFI2MMJ3U1vS8QreQwg0GwW3TiHN+wvW2+588oDIRBxl CYaH/qhbiGMQBkyCEJ97wmfcJX3orDBJbfUsLYEL3xqyqkWJNf9PIUl7KSCE2xpmYP5X Q9sfwqcJX7SWuGaJGzXVfA2nhnJTWDmP9p0m3VNwi21rMI5W3/GUfO2z1MXaCWjwG7qF lMAA== 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=GXJktJXhkNQ7TU3M1aq9CV5eICZ4RSYdofp4JI6o1nI=; b=sZbNsui126oUpNI2r6MncOVSP+lphVqcz/6q5pD0EitdOV8FT51hXPzNW2Mqr7sBqZ zhwXEDNoiKNOSjdSpnKgRRkYd7y90ryMom/9brgjQsXG9k4KnxWTtc5Sf8pZtUdyDzqy obP39L70HBsm9PvT8RD6EKQ1P51CfytoehPz3QbwGQrSd45sydLh9ESwR6bjFbGuGSRz 3zx3knF2Hqgyv2xzPSJ3qgfZdKTuON10j+duCdQSdFujMEKSkynIVLp4/n1Wo4ggYRS/ GeLWpySCjvmrDNKE6u0Kjm0tq75UMCjuEhEn3wkQgmX+E5teV0ift7sLmmYBOFK1SIQk 3wKw== 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 p20-20020a170902ead400b0015d04e10579si1667038pld.352.2022.04.24.08.49.13; Sun, 24 Apr 2022 08:49:40 -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 S239152AbiDXKym (ORCPT + 99 others); Sun, 24 Apr 2022 06:54:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236640AbiDXKyl (ORCPT ); Sun, 24 Apr 2022 06:54:41 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 578D22494F; Sun, 24 Apr 2022 03:51:40 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id EFE3992009C; Sun, 24 Apr 2022 12:51:38 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id E14B792009B; Sun, 24 Apr 2022 11:51:38 +0100 (BST) Date: Sun, 24 Apr 2022 11:51:38 +0100 (BST) From: "Maciej W. Rozycki" To: "Jason A. Donenfeld" cc: Thomas Bogendoerfer , 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 In-Reply-To: Message-ID: References: <20220413115411.21489-1-Jason@zx2c4.com> <20220413115411.21489-5-Jason@zx2c4.com> <20220413122546.GA11860@alpha.franken.de> <20220418071005.GA4075@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 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 Sun, 24 Apr 2022, Jason A. Donenfeld wrote: > > unconditionally. I think this discovery asks for code optimisation, which > > I'll try to cook up sometime. > > At some point too, by the way, we might also consider putting that into > a .c file rather than a static inline in the .h, since that function is > starting to get sort of big. This code is supposed to produce one to a couple of machine instructions for the majority of configurations. This is because the conditionals used are usually compile-time constants. Therefore I think it will be good to continue having it as `static inline' functions. Cf. the analysis in commit 06947aaaf9bf ("MIPS: Implement random_get_entropy with CP0 Random"). If this code does expand to a longer sequence for some platforms, then either they need to be verified whether they can be optimised (just as I note here for the DEC systems) or we can consider making these functions `extern inline' instead, with out-of-line code available from a .a file in case the compiler decides the code is too large for inlining to be worth doing after all. Though I don't expect the latter case to be required really. Maciej