Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp783232pxb; Fri, 22 Apr 2022 11:03:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbsSEhtTwiYhP/D5L3l19NOgaKLjMAgO4CRgaYw7wOI6RyhwcKNpaNjlcIWfg7ksCbaAmD X-Received: by 2002:a17:902:9308:b0:158:da34:ab55 with SMTP id bc8-20020a170902930800b00158da34ab55mr5834777plb.84.1650650606940; Fri, 22 Apr 2022 11:03:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650650606; cv=none; d=google.com; s=arc-20160816; b=a2C/ycYVUu6+m5FNHjz/TXIpMRKaOIKyaOgHUOfTcvBs3HZb8oLvOnJkAWXQCeJToD ZbxQ9ZB7ucscKNLqRA3UsUFI0AUSUYZj0iDYyVV1bvuTJyZ+8nnaIqHFjEiRtv7EfILM cRVv2sBFN1PEppd7dkW7NGLrUk8BtKnjPFJJK7NaExGX5M/7IKfNiTbDUbUaZH/LYURr xVeN6eO1Z64QpiskQIpUBxJiXcdfgLf7h19bTFccurPeE1c9WqidInRqVueeJJmDIYxJ 9Ruc6XvFo4iZvfE3C3IqR48WoFoaqZTJlS1ipDmcrrLGWkbFrSrOluMhnUqQBR3gr3nP oB2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=IvbH4EZL+5AN5QzEHqEkY2O3ivfSAm4vpHw9+hhvBhg=; b=RerxyRVm2FbSq2B9doNcAsguN5chiotL8eXQ1sMypheNFWroSnffRo0hlRJYB/UJEy BFJCpv+jeps338nQSLPDOJlGiJ6pqjfasl3k+B6nbYDUpibqmWNTGjiOWBN+PTRLUoiL 9WBfaT1xZ73rCOCo9/KUZm8ZYES6H3Df3XpidLUyXKHLJsPeO6wiW+IOJw63fjkW4Wrd tJHIoik9/K1u+fe6zWqgIlwfIVn9/9brQmKExf0Owltj2S/d0pAWTPe4Ei+zhNjwczFW KjK0ElXEdQJnCR2ZrSCjTfLNJAldEu7cfE6aXdOzWYsvoLXRcaCPrMWS5f+/F9+/hP5N VuqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=l9A2zxVr; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t1-20020a170902b20100b00153b2d16442si8634158plr.74.2022.04.22.11.03.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 11:03:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=l9A2zxVr; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 03B31118EFB; Fri, 22 Apr 2022 10:43:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386261AbiDUIDj (ORCPT + 99 others); Thu, 21 Apr 2022 04:03:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230260AbiDUIDi (ORCPT ); Thu, 21 Apr 2022 04:03:38 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EA2926F5; Thu, 21 Apr 2022 01:00:49 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id ks6so8381139ejb.1; Thu, 21 Apr 2022 01:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IvbH4EZL+5AN5QzEHqEkY2O3ivfSAm4vpHw9+hhvBhg=; b=l9A2zxVr+iaQxUxYrdl2Ms8QPgKKprVPWu836jDS1a9kDgOF87eiKg/WQ2Pp7p0uU5 2yNRXou7K8UFGozJ+zY/Z4nvAWfNQL2rfMjP+xXVlPOuM9uOjKLpuuReXJ/1yNQdQwuh j0rwMLAJikQsK++NSTkjAZZIpdlqPGGrisobY6AkDBUSn+EF1pPZ26RV1iYw2+CmyG9Z D2LmcczIZ72xeD8VaXUH0mDdLEb2aoTOXjcPu5w7P06BXPfBaOVOvqtrL86fe03Il6B4 EOW8KU+HycFTbAN4tLYJDkZ3tbTG01Z6v9mMOvBRakLpz/3LsxFq95QSfevhyaAXz0Qd bVTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IvbH4EZL+5AN5QzEHqEkY2O3ivfSAm4vpHw9+hhvBhg=; b=mMPZHqY1pPIrpZpVe91YkXlWi42EV943ExfwYrB94+eLM+JHhgYYiLUWa6wjXQg8Al iEdywdl0d4/O85cxNP9CrMfgunEr0so5FPn9VsMvihlhaXyIyGav2w3Pz8hKIdLofSGP sqDCo49Cdf+BMHN2HPtr97VVyWbBbqPEJ51vjmqNa5nTEJyoDhHK7oVQIjqfgp8YpOS0 LjJDFKdb8qC3TPE1ilQsx7xAk6LAWhCVcrvUNOiTVfgGcdBraWzidRBKmqFpwbirl858 dGp206r/ZOscDjBrkHknCvp2iE/lhcx2aDA8S1VQjjmbrXg6u+78a6wIx0xciaoV+8l0 JdHw== X-Gm-Message-State: AOAM533SzGKV58ctiNpXlv1n0+2cwj9xTh4jrMlCnFkSrH+dT2JiUB/6 RCDpVcjScpNVJ8RUvsWJXTffBt0W0YJz/JJvArI= X-Received: by 2002:a17:906:5e17:b0:6e8:b6b8:2b09 with SMTP id n23-20020a1709065e1700b006e8b6b82b09mr20915528eju.477.1650528047664; Thu, 21 Apr 2022 01:00:47 -0700 (PDT) MIME-Version: 1.0 References: <20220419111650.1582274-1-Jason@zx2c4.com> <20220419111650.1582274-11-Jason@zx2c4.com> In-Reply-To: <20220419111650.1582274-11-Jason@zx2c4.com> From: Max Filippov Date: Thu, 21 Apr 2022 01:00:36 -0700 Message-ID: Subject: Re: [PATCH v5 10/11] xtensa: use fallback for random_get_entropy() instead of zero To: "Jason A. Donenfeld" Cc: LKML , linux-crypto@vger.kernel.org, Thomas Gleixner , Arnd Bergmann , "Theodore Ts'o" , Dominik Brodowski , Russell King , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Thomas Bogendoerfer , 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 , Stephen Boyd , Dinh Nguyen , linux-arm-kernel@lists.infradead.org, "open list:M68K ARCHITECTURE" , linux-mips@vger.kernel.org, linux-riscv , "open list:SPARC + UltraSPAR..." , linux-um@lists.infradead.org, "maintainer:X86 ARCHITECTURE..." , "open list:TENSILICA XTENSA PORT (xtensa)" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, FROM_LOCAL_NOVOWEL,HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no 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 Tue, Apr 19, 2022 at 4:18 AM Jason A. Donenfeld wrote: > > In the event that random_get_entropy() can't access a cycle counter or > similar, falling back to returning 0 is really not the best we can do. > Instead, at least calling random_get_entropy_fallback() would be > preferable, because that always needs to return _something_, even > falling back to jiffies eventually. It's not as though > random_get_entropy_fallback() is super high precision or guaranteed to > be entropic, but basically anything that's not zero all the time is > better than returning zero all the time. > > This is accomplished by just including the asm-generic code like on > other architectures, which means we can get rid of the empty stub > function here. > > Cc: Thomas Gleixner > Cc: Arnd Bergmann > Cc: Max Filippov > Signed-off-by: Jason A. Donenfeld > --- > arch/xtensa/include/asm/timex.h | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) Acked-by: Max Filippov -- Thanks. -- Max