From nobody Mon Dec 1 22:34:55 2025 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76E563161B2 for ; Thu, 27 Nov 2025 07:09:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764227378; cv=none; b=MKtkA5TqdIi+Zw8XeIs7or+xwlXsTMX7w888xfy/LxOCIxjMkeYGrDm5bK8DWcDVKNE913x8ZYEUfG/K3lnyBqPNdtZc9PFxOliJz1RPrBxM1j+PCATP1FotZlgTeE/7Pcv/4/U5G01zQodJTTewLFA1IHB1T4It8sr+Q3kO7zw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764227378; c=relaxed/simple; bh=fHqm14iYlNovZ6vQyZ22kdXQKopoOJeILLWCCZGGfv8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aVa//Ps9w2+J4AdrdJ/L6uw996E8lCE6O2aCVmN25lpEVNFJVAJgN4YZky59xuVwmg3N9iNHEtsmZ3TRguQ9gfhag2tBSYZm1Cp8+rxAwHAM6ax6EVjGyUzaL4v7BsnDiDOxSRjReWWTlLH8ZmJypww6gRP9BXYe2fHmI9kh8vw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=ao7wIiJn; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=ao7wIiJn; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="ao7wIiJn"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="ao7wIiJn" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B316333695; Thu, 27 Nov 2025 07:09:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1764227370; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ShwVu/aGM+otOgaiOO5Lhf110Pxs/+JU1IYdiK72Mko=; b=ao7wIiJnbdf862h4OkyJ/MQsywhD42ZN6tn3rZHugaoN0vm7Tu50h8jzAGg6YtZArS/qr8 nM0CWrdpjO6gI2xp/FnLuC5LTvlRgYuIvz62oC2DvffWzqdpqFmP43C4OZoUWt0OeNjveu bkZz6WSCyofcHpgPykZaqvFP5MRDa8U= Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1764227370; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ShwVu/aGM+otOgaiOO5Lhf110Pxs/+JU1IYdiK72Mko=; b=ao7wIiJnbdf862h4OkyJ/MQsywhD42ZN6tn3rZHugaoN0vm7Tu50h8jzAGg6YtZArS/qr8 nM0CWrdpjO6gI2xp/FnLuC5LTvlRgYuIvz62oC2DvffWzqdpqFmP43C4OZoUWt0OeNjveu bkZz6WSCyofcHpgPykZaqvFP5MRDa8U= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 465513EA65; Thu, 27 Nov 2025 07:09:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id MAO1Dyr5J2mXXAAAD6G6ig (envelope-from ); Thu, 27 Nov 2025 07:09:30 +0000 From: Juergen Gross To: linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, x86@kernel.org Cc: Juergen Gross , Russell King , Ajay Kaher , Alexey Makhalov , Broadcom internal kernel review list , Stefano Stabellini , Oleksandr Tyshchenko , linux-arm-kernel@lists.infradead.org, xen-devel@lists.xenproject.org, "Peter Zijlstra (Intel)" Subject: [PATCH v4 07/21] arm/paravirt: Use common code for paravirt_steal_clock() Date: Thu, 27 Nov 2025 08:08:30 +0100 Message-ID: <20251127070844.21919-8-jgross@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251127070844.21919-1-jgross@suse.com> References: <20251127070844.21919-1-jgross@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-6.80 / 50.00]; REPLY(-4.00)[]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; RCPT_COUNT_TWELVE(0.00)[13]; RCVD_TLS_ALL(0.00)[] X-Spam-Level: X-Spam-Score: -6.80 X-Spam-Flag: NO Content-Type: text/plain; charset="utf-8" Remove the arch specific variant of paravirt_steal_clock() and use the common one instead. This allows to remove paravirt.c and paravirt.h from arch/arm. Until all archs supporting Xen have been switched to the common code of paravirt_steal_clock(), drivers/xen/time.c needs to include asm/paravirt.h for those archs, while this is not necessary for arm any longer. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- arch/arm/Kconfig | 1 + arch/arm/include/asm/paravirt.h | 18 ------------------ arch/arm/kernel/Makefile | 1 - arch/arm/kernel/paravirt.c | 20 -------------------- drivers/xen/time.c | 2 ++ 5 files changed, 3 insertions(+), 39 deletions(-) delete mode 100644 arch/arm/include/asm/paravirt.h delete mode 100644 arch/arm/kernel/paravirt.c diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 4fb985b76e97..4a3044acebd6 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1322,6 +1322,7 @@ config UACCESS_WITH_MEMCPY =20 config PARAVIRT bool "Enable paravirtualization code" + select HAVE_PV_STEAL_CLOCK_GEN help This changes the kernel so it can modify itself when it is run under a hypervisor, potentially improving performance significantly diff --git a/arch/arm/include/asm/paravirt.h b/arch/arm/include/asm/paravir= t.h deleted file mode 100644 index 69da4bdcf856..000000000000 --- a/arch/arm/include/asm/paravirt.h +++ /dev/null @@ -1,18 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_ARM_PARAVIRT_H -#define _ASM_ARM_PARAVIRT_H - -#ifdef CONFIG_PARAVIRT -#include - -u64 dummy_steal_clock(int cpu); - -DECLARE_STATIC_CALL(pv_steal_clock, dummy_steal_clock); - -static inline u64 paravirt_steal_clock(int cpu) -{ - return static_call(pv_steal_clock)(cpu); -} -#endif - -#endif diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index afc9de7ef9a1..b36cf0cfd4a7 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -83,7 +83,6 @@ AFLAGS_iwmmxt.o :=3D -Wa,-mcpu=3Diwmmxt obj-$(CONFIG_ARM_CPU_TOPOLOGY) +=3D topology.o obj-$(CONFIG_VDSO) +=3D vdso.o obj-$(CONFIG_EFI) +=3D efi.o -obj-$(CONFIG_PARAVIRT) +=3D paravirt.o =20 obj-y +=3D head$(MMUEXT).o obj-$(CONFIG_DEBUG_LL) +=3D debug.o diff --git a/arch/arm/kernel/paravirt.c b/arch/arm/kernel/paravirt.c deleted file mode 100644 index 3895a5578852..000000000000 --- a/arch/arm/kernel/paravirt.c +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * - * Copyright (C) 2013 Citrix Systems - * - * Author: Stefano Stabellini - */ - -#include -#include -#include -#include -#include - -static u64 native_steal_clock(int cpu) -{ - return 0; -} - -DEFINE_STATIC_CALL(pv_steal_clock, native_steal_clock); diff --git a/drivers/xen/time.c b/drivers/xen/time.c index d360ded2ef39..53b12f5ac465 100644 --- a/drivers/xen/time.c +++ b/drivers/xen/time.c @@ -10,7 +10,9 @@ #include #include =20 +#ifndef CONFIG_HAVE_PV_STEAL_CLOCK_GEN #include +#endif #include #include =20 --=20 2.51.0