Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2413144ioo; Sat, 28 May 2022 12:49:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgPiqLXIr4GAs4HsF8UEKO3jI3skmy79zmZNtPEmqcxLtZBND/JBNQZhPZubbpFyj6DzYT X-Received: by 2002:a05:6a00:1a08:b0:510:a1db:1a91 with SMTP id g8-20020a056a001a0800b00510a1db1a91mr49379110pfv.69.1653767382170; Sat, 28 May 2022 12:49:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653767382; cv=none; d=google.com; s=arc-20160816; b=QY3B91/aJj2nZRsFhjUxkAFManD3R8yT1UUWd8KnG03l1G/82vf1/WcYrjw2FyO2Zr t2TllitulQAJz2B/rZXT0iDgVeyYO644TIkj7nnlC1Xv834JR4WkYFl0+q47f4hDGspq k9akjDrVo0niMV15YwSUVWxrHsAD8HVwvVmObgGULSGq7vKo+XdnIs2xcl2dMEw6R+8T 4nYeiNc8ZrH3T6n3EXYIgZMAOyJV3pZqb8jeCAdzu/Vv779tY4mSqEKiYuopnuTapOe/ l0WX8/1i3qcLB3zkRrR29K7V7ZmuGGz9Qmmpg43VxhaeBsGU9Zhc0swKLE1OrlA3pDco jSFw== 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=7G87EeG3UWAS4cbTn2xHlZ+DMkgN8KqVjqkfUDMVwoY=; b=QX8bdkNJfBkZADWM54sGKhvr21cK8Uv2rtiFUBoeXGX0mZk1QdwIkxnROTr2wgKUxb KLuxQRh8iPwkEs3vTtENHIM8PYPOcFcfqLtIDMqtEe6K6evpLg/Yhz7vyA8a0V7MrgAh 4ia+OfDmjeU8hA+X8qS3L7NrtKV/VU/uTIF/hp8g7kFBH1RkGyYEXt9pivd4pZT189Vr sPvH+GfO9315AKjNQectOItmQNOZZHitRWyvRj2jcFTVuPnCaZ6I/yy1qVVQQoPHtDVL GoY/xgCjV97aOSENUCOZ4YUuPJfLYwxAR3CJYZtmZtCoqPyp7+GL0hNUC46/IArnW/zD W+nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VQu1ir+N; 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 r127-20020a632b85000000b003f6229e2eabsi10677030pgr.843.2022.05.28.12.49.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 12:49:42 -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=VQu1ir+N; 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 95A866D397; Sat, 28 May 2022 12:10:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343571AbiE0Izj (ORCPT + 99 others); Fri, 27 May 2022 04:55:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350221AbiE0IyO (ORCPT ); Fri, 27 May 2022 04:54:14 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 931835DA1F; Fri, 27 May 2022 01:53:08 -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 sin.source.kernel.org (Postfix) with ESMTPS id E3618CE23CB; Fri, 27 May 2022 08:53:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0C2DC385B8; Fri, 27 May 2022 08:53:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653641585; bh=o4soIyc1vQYJQ67dGq9GBUeAqDilcx63IcfzN7572IA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VQu1ir+NK8QGLTao0lvihE+UihQHs35Hn/jVrN7b20qsEyVRR6gwZzSFyg0EC9/2F WSHzJU3Uh1dGwKc878Q5r+uCe7MwN3Qfjh6KrdKUpZW+OiakEjxyJ0zv2xvFP1jHcM iazLmVo6vn41CRE8tRfcqENcH0PvG2nVz7pxTQdM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Gleixner , Arnd Bergmann , Max Filippov , "Jason A. Donenfeld" Subject: [PATCH 5.18 19/47] xtensa: use fallback for random_get_entropy() instead of zero Date: Fri, 27 May 2022 10:49:59 +0200 Message-Id: <20220527084804.582353564@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 e10e2f58030c5c211d49042a8c2a1b93d40b2ffb 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 Acked-by: Max Filippov Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman --- arch/xtensa/include/asm/timex.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/arch/xtensa/include/asm/timex.h +++ b/arch/xtensa/include/asm/timex.h @@ -29,10 +29,6 @@ extern unsigned long ccount_freq; -typedef unsigned long long cycles_t; - -#define get_cycles() (0) - void local_timer_setup(unsigned cpu); /* @@ -59,4 +55,6 @@ static inline void set_linux_timer (unsi xtensa_set_sr(ccompare, SREG_CCOMPARE + LINUX_TIMER); } +#include + #endif /* _XTENSA_TIMEX_H */