From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A1EA3C1417; Fri, 10 Apr 2026 12:21:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775823682; cv=none; b=U7pWkCNq4oGDHrgrUdZk/jY61v5lQuHQS93RD9CFzHO92cvHVGActrsdxi1h33NlOzY2pWeeXha+6EuojUcXkmH+o8haO4MUgQamjRCqDThhORUWzfHLwr9glfdeudPlzZioZ63pr95SDJxuCywWaGMAhDK1ulJIBwwoya5zqWI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775823682; c=relaxed/simple; bh=OPcZi/R5r87GvmWT5SIJxVBbPPoFFtvzuT/73U4xw6M=; h=Date:Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=rsIkB7SEdvmLWARbVz/J4f/C4uInieKNzapFfI0N6yLMX40rs68D1EoXCgb1hvsmsm38CvWFpK7a1apyijTLDlbt19zLWFwuAqOMWG9ufnT66o1Cgdix6DVe05yLhu8Y2wDi8/T7Hllpvh4eZqgldJ5JJwV7bzRYKipW5d+Swzg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nXK4IjII; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nXK4IjII" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DC20C2BCAF; Fri, 10 Apr 2026 12:21:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775823681; bh=OPcZi/R5r87GvmWT5SIJxVBbPPoFFtvzuT/73U4xw6M=; h=Date:From:To:Cc:Subject:References:From; b=nXK4IjIIYC4xFxjX1itXAh56E7vQfZ/FFg1BbCs9BTXZuysjAps9x9bTN1xwZq3nZ nGcIQtUczMHcNVAOXl3hUPdL+RNfqdz89/sEUMpghyMK10SkqIQqjoKkLYlZIDgGQg 6k/60XarMgLYO/edAAklc4cY8bckLykp1FNwUtHWQrXz6RHvG4M2KbuAE5KrJ4anwq KM/F3nJU8E8F/VqEi0tPDyEpicMuyuDi9K4xS5dK75o3zu+aRbSw7hWtA0AaEaHPPT N9wVjGhL4hXB+rfUE/x4Qggo67acuAQqBh4RtUYL+MOxGvNcfvlrnmgwbgp5vSVReB QZ733oHdFO0vw== Date: Fri, 10 Apr 2026 14:21:19 +0200 Message-ID: <20260410120319.924028412@kernel.org> User-Agent: quilt/0.68 From: Thomas Gleixner To: LKML Cc: Heiko Carstens , 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: [patch 35/38] s390: Select ARCH_HAS_RANDOM_ENTROPY References: <20260410120044.031381086@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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(-) --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -108,6 +108,7 @@ config S390 select ARCH_HAS_PREEMPT_LAZY select ARCH_HAS_PTDUMP select ARCH_HAS_PTE_SPECIAL + select ARCH_HAS_RANDOM_ENTROPY select ARCH_HAS_SCALED_CPUTIME select ARCH_HAS_SET_DIRECT_MAP select ARCH_HAS_SET_MEMORY --- /dev/null +++ b/arch/s390/include/asm/random.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_S390_RANDOM_H +#define _ASM_S390_RANDOM_H + +#include + +static inline unsigned long random_get_entropy(void) +{ + return (unsigned long)get_tod_clock_monotonic() >> 2; +} + +#endif --- a/arch/s390/include/asm/timex.h +++ b/arch/s390/include/asm/timex.h @@ -219,12 +219,6 @@ static inline unsigned long get_tod_cloc return tod; } -static inline cycles_t get_cycles(void) -{ - return (cycles_t)get_tod_clock_monotonic() >> 2; -} -#define get_cycles get_cycles - /** * tod_to_ns - convert a TOD format value to nanoseconds * @todval: to be converted TOD format value --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include "entry.h" --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include