Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp340780pxm; Fri, 25 Feb 2022 09:00:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbSht6JQ1vHvd4mDjde4bxVLBH2TparFovFb4OR8VmRKGXdBjX4xH+lVr22p/dIP0p3T4W X-Received: by 2002:a05:6a00:10c8:b0:4e1:7e17:9ca0 with SMTP id d8-20020a056a0010c800b004e17e179ca0mr8500488pfu.72.1645808451185; Fri, 25 Feb 2022 09:00:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645808451; cv=none; d=google.com; s=arc-20160816; b=Shva5bA5uOVIx0g9KVBvcInuOcWMpBxjA2HWzKtZro9Owsmsbx2i6RT1JZWuxMEsUQ 7n0KG2IzTxeUz8lgqz6H/CvPTGQNG3JLkFsmkJLN3+lrwxJOiv1LLBEBVpeofchFvvna LpAk3g4hSsLpb4b6mCryPeFeIch3MZxSrPSaSbtDDOKrFTWH0/0oEX355sRsxKrtKJnD jOJldfxFHmeJxjL0IVsqgbaN7SiLIEHc1bpTkZoCssJSesSicSexD6cjtnYREucAnK/8 +MG1tChmN+7e4atc4gVs4BRZ71zqT3nlzf0u+thS9XXY7yQr/prhgTZCg18yPByYymxS YGTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=MaFSDw8Vcte5ms3JBp2ACZkyYv5P9Ls38as6DwgEmdw=; b=uhAhn0xBcO1yosscLm1vwtJL3805RogSfHCZ8f1MVRcvPv27FfQSIarp1q6bu45YEi ZWpu9YOJlmPHX0pzfBAvGj+mDM5j5U/GgoiJCSAZRJO4g70xq4k1U5dhCdac92GjxLso kE8fNVYNvH4hDUXDWeB22//jxUEU0GVHgYTdhWu3bCyZMORqbnu2Pyvt0fYzdH9DQ8ip o+R+6FlIHfhzEUeqJ/uGGYVc+Cm2x/kbx5AGSDDF0hXrXAMdSRxpH/Me4J+Ls+TSRnOA y4XJ5Ou81jMNEm7NmFE5hObmWbWi6yBN3p8AhAucUcLLvAK9scMK3YjywBQAIJwy1ona LRgQ== 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 n7-20020a654507000000b0034d90a847c6si2165220pgq.571.2022.02.25.09.00.33; Fri, 25 Feb 2022 09:00:50 -0800 (PST) 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 S241719AbiBYORV (ORCPT + 99 others); Fri, 25 Feb 2022 09:17:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241605AbiBYORT (ORCPT ); Fri, 25 Feb 2022 09:17:19 -0500 Received: from isilmar-4.linta.de (isilmar-4.linta.de [136.243.71.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8618034653 for ; Fri, 25 Feb 2022 06:16:43 -0800 (PST) X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES Received: from owl.dominikbrodowski.net (owl.brodo.linta [10.2.0.111]) by isilmar-4.linta.de (Postfix) with ESMTPSA id F248F200230; Fri, 25 Feb 2022 14:16:40 +0000 (UTC) Received: by owl.dominikbrodowski.net (Postfix, from userid 1000) id 38FF5802B3; Fri, 25 Feb 2022 15:16:34 +0100 (CET) Date: Fri, 25 Feb 2022 15:16:34 +0100 From: Dominik Brodowski To: "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, Theodore Ts'o Subject: Re: [PATCH v3] random: unify cycles_t and jiffies usage and types Message-ID: References: <20220225134408.933305-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220225134408.933305-1-Jason@zx2c4.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, 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-kernel@vger.kernel.org Am Fri, Feb 25, 2022 at 02:44:08PM +0100 schrieb Jason A. Donenfeld: > random_get_entropy() returns a cycles_t, not an unsigned long, which is > sometimes 64 bits on various 32-bit platforms, including x86. > Conversely, jiffies is always unsigned long. This commit fixes things to > use cycles_t for fields that use random_get_entropy(), named "cycles", > and unsigned long for fields that use jiffies, named "now". It's also > good to mix in a cycles_t and a jiffies in the same way for both > add_device_randomness and add_timer_randomness, rather than using xor in > one case. Finally, we unify the order of these volatile reads, always > reading the more precise cycles counter, and then jiffies, so that the > cycle counter is as close to the event as possible. > > Cc: Theodore Ts'o > Cc: Dominik Brodowski > Signed-off-by: Jason A. Donenfeld Reviewed-by: Dominik Brodowski Thanks, Dominik