Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp2002222lfo; Sat, 28 May 2022 13:26:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzh5ICioRipk9WxRiep1KvKBUl8Eby4OeU5fK73ZI1UefDeu5UVTOI1UqymT4JQsOgHf8j X-Received: by 2002:a17:90b:3a85:b0:1df:f22e:cd9 with SMTP id om5-20020a17090b3a8500b001dff22e0cd9mr14954360pjb.206.1653769593299; Sat, 28 May 2022 13:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653769593; cv=none; d=google.com; s=arc-20160816; b=xIJFAVS88hSx1el1/ddp+/5d+Lg5huZrFWAgWvgZmrU/fzebWt/xXVMyZDKJs63kEN 7p1cWsAGruzQSFsMskFJB7UE/r8vBHmzamoRpojKX0U7QuzjWhNR7/uN0a94VBoinlIP RAVPeP5UUv2raEcb+5wwdGT6bGKKyDhMl7DbmFOfDILtKSFnz5diFZT7zCgx4IBAh9+V F+1e2dgz7f179AObGsudPyS1Vm7OU/oqJUUmWIEDKt8tsCdflGsTKYV986ScdgZPQFng wmnJJlS64OoFB+UsQi7zwf2rah2cOaiatOWgrohiyHlbLP3k3AduCOxjcQUOvAsubzov EyWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ntM/N94tcwRGHQ1txtguZLYFlPXh+Rvgm2+wAVrX5nw=; b=De99NZmBd192O1x1JgoGjFLjgL+kNW8r53U0cFtBOSOza1X2SbwsZjxu3uUSgWqpKC 3+cDGCnIA7CljwdYUKv9mqAHSgjk+D7xnyxyUCyf/wd0C81ZOpTvryUh7WCoY72IBMiH 3jPJ//l3FAgm/A23A60qpv+JF/8CXqIojgQl/PwqqDSefaMZvvoEhVjAATLH08yNiVVN ESv3PJtCHGaEPkmYS9pmNxqoORG6wiMHVsLCJvth6ZCH4Oxck91HFgOSehcpO9PSZXIO L8MGBrpdf41/XVQP5B69CirsVGelo4p4ZOCAOlcHO15q9hQvwwuIZW+8TmGUYlL+x1xx otDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=daBNSY7P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id bi11-20020a170902bf0b00b0015e8daafcb0si8413780plb.239.2022.05.28.13.26.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 13:26:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=daBNSY7P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E9209177053; Sat, 28 May 2022 12:32:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350203AbiE0Iyy (ORCPT + 99 others); Fri, 27 May 2022 04:54:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350202AbiE0IyL (ORCPT ); Fri, 27 May 2022 04:54:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AAB15D666; Fri, 27 May 2022 01:53:02 -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 62CDA61D3D; Fri, 27 May 2022 08:53:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06CB4C385B8; Fri, 27 May 2022 08:53:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653641581; bh=sbrL44tMkKlNhB/ubeCGu9MeR5vV2zIzvhWF5VTfUMs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=daBNSY7PYEjz/zc0HMH85ASTdblQxCWIblU6BxtiqFonpTCgxJ0Ma/QIaT6BYOJqN Ba7mw0XVMHWzKCWa0HhtzO34/23ltjYP0Dri3jEWQObh0QGBzaULktEYBAdKFBIgdd wJjMfHsneyF31jkzhn/osdHKVKY4myL0PTCwAzTE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Gleixner , Arnd Bergmann , "David S. Miller" , "Jason A. Donenfeld" Subject: [PATCH 5.18 18/47] sparc: use fallback for random_get_entropy() instead of zero Date: Fri, 27 May 2022 10:49:58 +0200 Message-Id: <20220527084804.340940050@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220527084801.223648383@linuxfoundation.org> References: <20220527084801.223648383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: "Jason A. Donenfeld" commit ac9756c79797bb98972736b13cfb239fd2cffb79 upstream. 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: David S. Miller Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman --- arch/sparc/include/asm/timex_32.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/arch/sparc/include/asm/timex_32.h +++ b/arch/sparc/include/asm/timex_32.h @@ -9,8 +9,6 @@ #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ -/* XXX Maybe do something better at some point... -DaveM */ -typedef unsigned long cycles_t; -#define get_cycles() (0) +#include #endif