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 4F13FF8A179 for ; Thu, 16 Apr 2026 13:43:38 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=73o3ijHAtIHL94gZccKZZXupSDn1P6W1jdSeuZbygfE=; b=RPmt1zqwsbvBMf kJpC8+ii8Kt2GMLkrE8lwRlpec+eq0wWE9E1jVPXCD2bEAd+xNmeXFz0EEL4XH4ZQGoSUONEuBAnW 3GaZ0wYO6gYs+XnKlfyHZXJKhgXF5D2+dQwitTgqOzd0xxZZ0S98EBN3HF/rHsVyBOco3hSjVKue8 Ge/OlJ+/SVQtgucJNemu+s+jg7WMD66jlajO+Xs1Jf6C6bhksUDwO1biC5uiwqDMWLaPHOKd4samS 2jllNxG5EKACppVsoDWwrsvD89PFuC2vw/s+1sAH7LNMClCraGU4RgOExQOgj7F/HgW5RvoWeVNiy xH/kbLxG3kxDfl5BN7Fw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1wDN0E-00000002WIx-0PKV; Thu, 16 Apr 2026 13:43:30 +0000 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1wDN0B-00000002WI7-0P9Q; Thu, 16 Apr 2026 13:43:28 +0000 Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63G7sGgI1833152; Thu, 16 Apr 2026 13:42:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=pp1; bh=f/UjitU2IRDQkjyHmpVEhuknZxwT4y OWmcb/zMeZnjE=; b=oxq0L3dyylrzBDUlyV4jJBA8jSxvo6zyTFu2eZGBSWIf1F 0ksXNAaZF1WFKO90vuj3ti8LrXkR4WMFD+veRWCanALiSvqIPx5mj6AiZqVUTeh6 tnOUDFD8eG7uVm2ujOQXyKpmzLTf5Owa4nae6JyebU1il+cvOG4GPAishf31nirE QHj8T3NZ/YPFd6hNRv9PVtfbIxtnQmC5vDBXeXZfk1L1NOqO7IX91VEsi/on5hTf swPZjWAsNymtPrfj22h1nP6023klHtGdpOwHkZzHB+qFWDGTjvfilGSiiCmKXonp ZKuwp6xlgpdmgU9LP0G+HpY0nEqSmz/YWYI5xffQ== Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4dh89rnpks-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Apr 2026 13:42:45 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 63GCrstO003393; Thu, 16 Apr 2026 13:42:44 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4djbh94p47-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Apr 2026 13:42:44 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 63GDggEf46530868 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Apr 2026 13:42:42 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6D9BD20040; Thu, 16 Apr 2026 13:42:42 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E411920043; Thu, 16 Apr 2026 13:42:41 +0000 (GMT) Received: from osiris (unknown [9.52.214.206]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTPS; Thu, 16 Apr 2026 13:42:41 +0000 (GMT) Date: Thu, 16 Apr 2026 15:42:38 +0200 From: Heiko Carstens To: Thomas Gleixner Cc: LKML , linux-s390@vger.kernel.org, Arnd Bergmann , x86@kernel.org, Lu Baolu , iommu@lists.linux.dev, Michael Grzeschik , netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Herbert Xu , linux-crypto@vger.kernel.org, Vlastimil Babka , linux-mm@kvack.org, David Woodhouse , Bernie Thompson , linux-fbdev@vger.kernel.org, Theodore Tso , linux-ext4@vger.kernel.org, Andrew Morton , Uladzislau Rezki , Marco Elver , Dmitry Vyukov , kasan-dev@googlegroups.com, Andrey Ryabinin , Thomas Sailer , linux-hams@vger.kernel.org, "Jason A. Donenfeld" , Richard Henderson , linux-alpha@vger.kernel.org, Russell King , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Huacai Chen , loongarch@lists.linux.dev, Geert Uytterhoeven , linux-m68k@lists.linux-m68k.org, Dinh Nguyen , Jonas Bonn , linux-openrisc@vger.kernel.org, Helge Deller , linux-parisc@vger.kernel.org, Michael Ellerman , linuxppc-dev@lists.ozlabs.org, Paul Walmsley , linux-riscv@lists.infradead.org, "David S. Miller" , sparclinux@vger.kernel.org Subject: Re: [patch 35/38] s390: Select ARCH_HAS_RANDOM_ENTROPY Message-ID: <20260416134238.9230Ba6-hca@linux.ibm.com> References: <20260410120044.031381086@kernel.org> <20260410120319.924028412@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260410120319.924028412@kernel.org> X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE2MDEyNyBTYWx0ZWRfX8JpaMjFpMFNj wT/gcAkcZviN6PAKMrtow2zaUGLfcmRJE1Hmlajk6nmzRCOPN3b0RjfUSbBfZ4kcpBQKzFkFpH2 rBdoNFGP+ENma7o4H4KbJVfdl551lLtrUhXHjq9OwNJzXZ+me9M1v1uiIYgnebcgn173Z5tfoDR wlQdz0La24p7XZm2254oSjajXGSASA40rSmgRE/jrWjf8LX+uVSsnpdh3XNIiRv8V/PTkKj6EBp iBYTVRyCnznRY5uSBKmAQ36JyfUCJkrEoSNgw47/6thxuZYcD3Vho/t2EjbWxo9/yoIVwBhLMiA KDHNz3gXJ52J3z8Lw3ApjdhxznJ9LyQJp5nCQBfITC+W8sZcyql8UU+3NCgtkDEKALiOvDUmzX8 cTJk9dj+/qvxdwTfyZTWoW7vy+HckV57wQs+QYABEOJZttft9F9OCKr+PfGIpmBZixsJntlLk+Y lz3L+7/h8eZbcTrAKmg== X-Proofpoint-ORIG-GUID: rje87_dJEfU9HQ1lSMRsbGj9D9EjeiT6 X-Proofpoint-GUID: mvWCwZrNw9W7TL82vJ98uT3DrwWfuFPP X-Authority-Analysis: v=2.4 cv=fYidDUQF c=1 sm=1 tr=0 ts=69e0e756 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=kj9zAlcOel0A:10 a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=VwQbUJbxAAAA:8 a=VnNF1IyMAAAA:8 a=1gfdoSPoDaBUdwTi8XQA:9 a=CjuIK1q_8ugA:10 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-16_03,2026-04-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 impostorscore=0 clxscore=1011 malwarescore=0 phishscore=0 bulkscore=0 priorityscore=1501 spamscore=0 suspectscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604160127 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260416_064327_152327_BA0651DD X-CRM114-Status: GOOD ( 24.75 ) 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 Fri, Apr 10, 2026 at 02:21:19PM +0200, Thomas Gleixner wrote: > The only remaining non-architecture usage of get_cycles() is to provide > random_get_entropy(). > > Switch s390 over to the new scheme of selecting ARCH_HAS_RANDOM_ENTROPY and > providing random_get_entropy() in asm/random.h. > > Add 'asm/timex.h' includes to the relevant files, so the global include can > be removed once all architectures are converted over. > > Signed-off-by: Thomas Gleixner > Cc: Heiko Carstens > Cc: linux-s390@vger.kernel.org > --- > arch/s390/Kconfig | 1 + > arch/s390/include/asm/random.h | 12 ++++++++++++ > arch/s390/include/asm/timex.h | 6 ------ > arch/s390/kernel/time.c | 1 + > arch/s390/kernel/vtime.c | 1 + > 5 files changed, 15 insertions(+), 6 deletions(-) Acked-by: Heiko Carstens Thomas, would you mind adding the below as minor improvement to this series? >From 7072e5d66b99a7fa666d17c6ad8cb254f2d8f473 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Thu, 16 Apr 2026 15:08:15 +0200 Subject: [PATCH] s390: Use get_tod_clock_fast() for random_get_entropy() Use get_tod_clock_fast() instead of get_tod_clock_monotonic() to implement random_get_entropy(). There is no need for random_get_entropy() to provide monotonic increasing values, nor is there any need to provide (close to) nanosecond granularity timestamps by shifting the result. This slightly reduces the execution time of random_get_entropy() and adds two bits of randomness. Signed-off-by: Heiko Carstens --- arch/s390/include/asm/random.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/include/asm/random.h b/arch/s390/include/asm/random.h index 7daf42dbed32..f6d9312efdbf 100644 --- a/arch/s390/include/asm/random.h +++ b/arch/s390/include/asm/random.h @@ -6,7 +6,7 @@ static inline unsigned long random_get_entropy(void) { - return (unsigned long)get_tod_clock_monotonic() >> 2; + return get_tod_clock_fast(); } #endif -- 2.51.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv