From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E6F3C433EF for ; Wed, 13 Apr 2022 14:32:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234295AbiDMOfJ (ORCPT ); Wed, 13 Apr 2022 10:35:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233994AbiDMOfI (ORCPT ); Wed, 13 Apr 2022 10:35:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DE895676A; Wed, 13 Apr 2022 07:32:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 38CA661BA6; Wed, 13 Apr 2022 14:32:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AA83C385A6; Wed, 13 Apr 2022 14:32:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649860366; bh=y/gFQs+hgHZ3/vvOq41ylGPCtjhP53O/JBKcPRIcQfg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=c6zZdWDOUnHSGNHfBTXEBVZObxER3VgBA/8QflX/jfQ5RRQ8Bxgqk2eFNQ2MXzEuy jSkpa6Jwc1N4IvWLMHH+Zt0+XCE7tpnn8KFoIgvwAN4tQB93mzX7TE3tlvhL6XG/Fr WTnRTPKLKs7TxKy144wJ8pe88A68vmmh5K4rknhCaZes7AxMngvMVG8iLOIfcPhXiw fEpxXUDgzsVLgt2eQn6aeFnaL7eLX0DZMkr1aWcOFtdc0XWBwsSNtD31Y7tfNtZO5t Xo068bQO4+veX4gUup6qM1r8ayg9R8rjAguYKzFRRu+kP9M7+oBWwfwk7CyrX1OCiG araLq0MFphDFg== Received: by mail-io1-f43.google.com with SMTP id 9so2089173iou.5; Wed, 13 Apr 2022 07:32:46 -0700 (PDT) X-Gm-Message-State: AOAM532oM5Vh0Qd7XdCfuH6CoK5N2MVtuwPHjv6/LRkBqhWrj1MlUJYp QYh7hTQdm4Tcv698Oz3OhrZSVXTfqwcWDWchxg== X-Google-Smtp-Source: ABdhPJztV5+8KEJ74WCQvEE2mueV1uP9FdDpJontci3NKw8uFVcyU1+ScsVCAwrzKj/88xIwClDnzYiNbkHkece/VFk= X-Received: by 2002:a05:6638:24d0:b0:326:34d2:5c22 with SMTP id y16-20020a05663824d000b0032634d25c22mr6761858jat.91.1649860365852; Wed, 13 Apr 2022 07:32:45 -0700 (PDT) MIME-Version: 1.0 References: <20220413115411.21489-1-Jason@zx2c4.com> <20220413115411.21489-2-Jason@zx2c4.com> In-Reply-To: <20220413115411.21489-2-Jason@zx2c4.com> From: Rob Herring Date: Wed, 13 Apr 2022 09:32:34 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 01/11] timekeeping: add raw clock fallback for random_get_entropy() To: "Jason A. Donenfeld" Cc: "linux-kernel@vger.kernel.org" , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , 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 , Max Filippov , John Stultz , Stephen Boyd , Dinh Nguyen , linux-arm-kernel , linux-m68k@lists.linux-m68k.org, "open list:MIPS" , linux-riscv , sparclinux , linux-um@lists.infradead.org, X86 ML , linux-xtensa@linux-xtensa.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Apr 13, 2022 at 6:55 AM Jason A. Donenfeld wrote: > > The addition of random_get_entropy_fallback() provides access to > whichever time source has the highest frequency, which is useful for > gathering entropy on platforms without available cycle counters. It's > not necessarily as good as being able to quickly access a cycle counter > that the CPU has, but it's still something, even when it falls back to > being jiffies-based. > > In the event that a given arch does not define get_cycles(), falling > back to the get_cycles() default implementation that returns 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. > > Cc: Thomas Gleixner > Cc: Arnd Bergmann > Cc: Theodore Ts'o > Signed-off-by: Jason A. Donenfeld > --- > include/linux/timex.h | 8 ++++++++ > kernel/time/timekeeping.c | 10 ++++++++++ > 2 files changed, 18 insertions(+) > > diff --git a/include/linux/timex.h b/include/linux/timex.h > index 5745c90c8800..fbbe34226044 100644 > --- a/include/linux/timex.h > +++ b/include/linux/timex.h > @@ -62,6 +62,8 @@ > #include > #include > > +extern unsigned long random_get_entropy_fallback(void); > + > #include > > #ifndef random_get_entropy > @@ -74,8 +76,14 @@ > * > * By default we use get_cycles() for this purpose, but individual > * architectures may override this in their asm/timex.h header file. > + * If a given arch does not have get_cycles(), then we fallback to 'does not have a usable get_cycles(), ...' as clearly some arches have get_cycles() and yet still need a fallback. Why not handle the 'if get_cycles() returns 0 do the fallback' within a weak random_get_entropy() function? Then more arches don't need any random_get_entropy() implementation. Rob From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 12A0CC433F5 for ; Wed, 13 Apr 2022 14:33:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Uf9xt6gpNECnkdfrzv3fyKrM8zQW1Qf15dkVuBEc4g4=; b=0Hv3HzLh4NuRyE tTzl6fwubL+0qskTojTkY3Ngcf9yEiQUEIqXGxRz/IBIwhZkAlzx8y2Y6ZCdz0bsCTQT1KkaDgCs4 Pf78nflRO01/FNLk+NcIX88en2Ar9QDEx53sKrp9G4BbLg4K5Zl7lPXL3bK9aJLptqPATISs6THk/ eTM6QT8d/3vQ4aE0/tUQ2FDHkr48N9MKv1cLCnmZCGhlW+xUekad/Ip2n645Ae6Wijk+PxRC4oh6Q y6g3o1/KLe76LTVYop/2q0N6YQPJHMdEMM1loKUVKlwGjv58DN+Hatvi4s55pizu32q+JR+QOM4sJ TAKc8F7SQx0sHxpUiT8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nee3V-001Pnk-K8; Wed, 13 Apr 2022 14:33:13 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nee3I-001Pju-QK; Wed, 13 Apr 2022 14:33:02 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 677EEB824FB; Wed, 13 Apr 2022 14:32:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B5B3C385A3; Wed, 13 Apr 2022 14:32:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649860377; bh=y/gFQs+hgHZ3/vvOq41ylGPCtjhP53O/JBKcPRIcQfg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=j9z9yWf8zEBxpTdwXTBA42xlV0Br6pgBatJ9sZ+YFz9LeI2saNhT1Bt0zi1X0urlL CI5liYogMUqvV61ey99QW3McYhlY26REm9v2P/huS84KMGI/k9oIyLs8IlEM/0Iovs lj1JN/763Sr2cWqDd3F8GuvqDOU6tjFxjvUJqP8iW1M3p1zSdZLc72xZJgACvgsla4 mtjhKV2l+be+xhGxib4Epqg0KtTxytIlXBxXkybu3Mv8hFLnjnnC38OEhpdvJlPRJa NGtK3aKDybE/aad/0SbJcOL8d4+sP+GaiPIe5izEZKuzZg7b/ZSqROZkcmhqVzhfO8 BvzDu2yEGHOgA== Received: by mail-qt1-f174.google.com with SMTP id a11so1454620qtb.12; Wed, 13 Apr 2022 07:32:57 -0700 (PDT) X-Gm-Message-State: AOAM532LN92xES5oZslGVCgjIydVomRs1QyXeasU2lpNppUGsjTbv+jX 6md+wvANeD6fT25mA3mJ1RHLe9uvWortti2orw== X-Google-Smtp-Source: ABdhPJztV5+8KEJ74WCQvEE2mueV1uP9FdDpJontci3NKw8uFVcyU1+ScsVCAwrzKj/88xIwClDnzYiNbkHkece/VFk= X-Received: by 2002:a05:6638:24d0:b0:326:34d2:5c22 with SMTP id y16-20020a05663824d000b0032634d25c22mr6761858jat.91.1649860365852; Wed, 13 Apr 2022 07:32:45 -0700 (PDT) MIME-Version: 1.0 References: <20220413115411.21489-1-Jason@zx2c4.com> <20220413115411.21489-2-Jason@zx2c4.com> In-Reply-To: <20220413115411.21489-2-Jason@zx2c4.com> From: Rob Herring Date: Wed, 13 Apr 2022 09:32:34 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 01/11] timekeeping: add raw clock fallback for random_get_entropy() To: "Jason A. Donenfeld" Cc: "linux-kernel@vger.kernel.org" , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , 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 , Max Filippov , John Stultz , Stephen Boyd , Dinh Nguyen , linux-arm-kernel , linux-m68k@lists.linux-m68k.org, "open list:MIPS" , linux-riscv , sparclinux , linux-um@lists.infradead.org, X86 ML , linux-xtensa@linux-xtensa.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220413_073301_176665_BE9E5FBA X-CRM114-Status: GOOD ( 28.55 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Wed, Apr 13, 2022 at 6:55 AM Jason A. Donenfeld wrote: > > The addition of random_get_entropy_fallback() provides access to > whichever time source has the highest frequency, which is useful for > gathering entropy on platforms without available cycle counters. It's > not necessarily as good as being able to quickly access a cycle counter > that the CPU has, but it's still something, even when it falls back to > being jiffies-based. > > In the event that a given arch does not define get_cycles(), falling > back to the get_cycles() default implementation that returns 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. > > Cc: Thomas Gleixner > Cc: Arnd Bergmann > Cc: Theodore Ts'o > Signed-off-by: Jason A. Donenfeld > --- > include/linux/timex.h | 8 ++++++++ > kernel/time/timekeeping.c | 10 ++++++++++ > 2 files changed, 18 insertions(+) > > diff --git a/include/linux/timex.h b/include/linux/timex.h > index 5745c90c8800..fbbe34226044 100644 > --- a/include/linux/timex.h > +++ b/include/linux/timex.h > @@ -62,6 +62,8 @@ > #include > #include > > +extern unsigned long random_get_entropy_fallback(void); > + > #include > > #ifndef random_get_entropy > @@ -74,8 +76,14 @@ > * > * By default we use get_cycles() for this purpose, but individual > * architectures may override this in their asm/timex.h header file. > + * If a given arch does not have get_cycles(), then we fallback to 'does not have a usable get_cycles(), ...' as clearly some arches have get_cycles() and yet still need a fallback. Why not handle the 'if get_cycles() returns 0 do the fallback' within a weak random_get_entropy() function? Then more arches don't need any random_get_entropy() implementation. Rob _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 470C1C433EF for ; Wed, 13 Apr 2022 14:34:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1FWUi73fgEPvRILr522g9ODE8VosqTq3YVi8Cw/dsV8=; b=vybIc82DDjDXl3 zj8PmO1gu0qCT3k8UIlC5j39qiG99mfW5YJSHHydzZ1TwcK9N8V7xyd86vKBtTBcMhOUI1pk0Qdki ELUevlpCHgQcsxaEOr4TMrlfzjDGX6xLTbMmNdVga5XDtIpf6dWxU0pIrw391MHGRZ6303AdZWG9x R1Mbnu1lUUFwChIBzBdRYoE5G9kgozXvi5WtUXrZ7LrEUHrkNJfeTI2gddXGqHwA199lHtESaYynp FtRxUU4ywCBVLXYix39UDsFiaxlPI4Jwh/EQ2ZSN/gJO9L81URwTON3GF8bMTfFQiKU/lA+/vYVXx QDF7lDZ6cf8w2ek38VeQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nee3M-001PlE-FN; Wed, 13 Apr 2022 14:33:04 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nee3I-001Pju-QK; Wed, 13 Apr 2022 14:33:02 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 677EEB824FB; Wed, 13 Apr 2022 14:32:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B5B3C385A3; Wed, 13 Apr 2022 14:32:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649860377; bh=y/gFQs+hgHZ3/vvOq41ylGPCtjhP53O/JBKcPRIcQfg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=j9z9yWf8zEBxpTdwXTBA42xlV0Br6pgBatJ9sZ+YFz9LeI2saNhT1Bt0zi1X0urlL CI5liYogMUqvV61ey99QW3McYhlY26REm9v2P/huS84KMGI/k9oIyLs8IlEM/0Iovs lj1JN/763Sr2cWqDd3F8GuvqDOU6tjFxjvUJqP8iW1M3p1zSdZLc72xZJgACvgsla4 mtjhKV2l+be+xhGxib4Epqg0KtTxytIlXBxXkybu3Mv8hFLnjnnC38OEhpdvJlPRJa NGtK3aKDybE/aad/0SbJcOL8d4+sP+GaiPIe5izEZKuzZg7b/ZSqROZkcmhqVzhfO8 BvzDu2yEGHOgA== Received: by mail-qt1-f174.google.com with SMTP id a11so1454620qtb.12; Wed, 13 Apr 2022 07:32:57 -0700 (PDT) X-Gm-Message-State: AOAM532LN92xES5oZslGVCgjIydVomRs1QyXeasU2lpNppUGsjTbv+jX 6md+wvANeD6fT25mA3mJ1RHLe9uvWortti2orw== X-Google-Smtp-Source: ABdhPJztV5+8KEJ74WCQvEE2mueV1uP9FdDpJontci3NKw8uFVcyU1+ScsVCAwrzKj/88xIwClDnzYiNbkHkece/VFk= X-Received: by 2002:a05:6638:24d0:b0:326:34d2:5c22 with SMTP id y16-20020a05663824d000b0032634d25c22mr6761858jat.91.1649860365852; Wed, 13 Apr 2022 07:32:45 -0700 (PDT) MIME-Version: 1.0 References: <20220413115411.21489-1-Jason@zx2c4.com> <20220413115411.21489-2-Jason@zx2c4.com> In-Reply-To: <20220413115411.21489-2-Jason@zx2c4.com> From: Rob Herring Date: Wed, 13 Apr 2022 09:32:34 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 01/11] timekeeping: add raw clock fallback for random_get_entropy() To: "Jason A. Donenfeld" Cc: "linux-kernel@vger.kernel.org" , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , 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 , Max Filippov , John Stultz , Stephen Boyd , Dinh Nguyen , linux-arm-kernel , linux-m68k@lists.linux-m68k.org, "open list:MIPS" , linux-riscv , sparclinux , linux-um@lists.infradead.org, X86 ML , linux-xtensa@linux-xtensa.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220413_073301_176665_BE9E5FBA X-CRM114-Status: GOOD ( 28.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 13, 2022 at 6:55 AM Jason A. Donenfeld wrote: > > The addition of random_get_entropy_fallback() provides access to > whichever time source has the highest frequency, which is useful for > gathering entropy on platforms without available cycle counters. It's > not necessarily as good as being able to quickly access a cycle counter > that the CPU has, but it's still something, even when it falls back to > being jiffies-based. > > In the event that a given arch does not define get_cycles(), falling > back to the get_cycles() default implementation that returns 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. > > Cc: Thomas Gleixner > Cc: Arnd Bergmann > Cc: Theodore Ts'o > Signed-off-by: Jason A. Donenfeld > --- > include/linux/timex.h | 8 ++++++++ > kernel/time/timekeeping.c | 10 ++++++++++ > 2 files changed, 18 insertions(+) > > diff --git a/include/linux/timex.h b/include/linux/timex.h > index 5745c90c8800..fbbe34226044 100644 > --- a/include/linux/timex.h > +++ b/include/linux/timex.h > @@ -62,6 +62,8 @@ > #include > #include > > +extern unsigned long random_get_entropy_fallback(void); > + > #include > > #ifndef random_get_entropy > @@ -74,8 +76,14 @@ > * > * By default we use get_cycles() for this purpose, but individual > * architectures may override this in their asm/timex.h header file. > + * If a given arch does not have get_cycles(), then we fallback to 'does not have a usable get_cycles(), ...' as clearly some arches have get_cycles() and yet still need a fallback. Why not handle the 'if get_cycles() returns 0 do the fallback' within a weak random_get_entropy() function? Then more arches don't need any random_get_entropy() implementation. Rob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel