From nobody Thu Oct 30 22:42:13 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 28C63258EDB for ; Mon, 6 Oct 2025 07:47:18 +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=1759736841; cv=none; b=nXGQi5Pv72bBLkrw1fNk9w/7MA5rVceoSwmhwv5rowYuH/rC6NJ2yoduEcfkSB4yoUMQUDgg0G9nI+OcMm8jw6qFd/zAAIsCnYva45skPIVWjjNBdJ+wzHy8QNyddf7FnEW7ZCaN9e9U992VipK4mVWNlyJBya67cgyu2mtLOQM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759736841; c=relaxed/simple; bh=4cWScvfuVQnfDs7xcWKqjBAiAVxZxd3bH/i77sLeVxU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VIsitELUdCjaNYnrSURCc82kSh47ZjGhSXZl+LqKYjjC9qfnK2TbQZHSMdAW4t0RtfnD04j18iHXgSe+yM63M8fU/Ek1Q6ELpflGRn8Vpd9GDVBmRpGVSMXNgVuTkDoUAaWWbYmab/9sVmdaI1U8Qkk2p0aCrQhAgcRnc2rt4bE= 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=uFnCMbWO; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=uFnCMbWO; 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="uFnCMbWO"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="uFnCMbWO" 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 65F5622501; Mon, 6 Oct 2025 07:47:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1759736837; 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=hHoWMHxjEYxWzXFzwEz4w5llPIGc7b3TxNii6+61XYg=; b=uFnCMbWOTg9okFEV34oW2f3xlMbUYlpZ/oJTX8/Pj7JL8ruBbm28iuXcTv+cSOU6TCGmg6 C2mzX+Ee0TOqknmCf/f7BpqR4ekxMdakngZfA2C36xhspiCDhjc9do4baNyik3Y4Lnm//z RCYjTzuNvd9QK6v//pwysQ2rAH9/M/k= Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1759736837; 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=hHoWMHxjEYxWzXFzwEz4w5llPIGc7b3TxNii6+61XYg=; b=uFnCMbWOTg9okFEV34oW2f3xlMbUYlpZ/oJTX8/Pj7JL8ruBbm28iuXcTv+cSOU6TCGmg6 C2mzX+Ee0TOqknmCf/f7BpqR4ekxMdakngZfA2C36xhspiCDhjc9do4baNyik3Y4Lnm//z RCYjTzuNvd9QK6v//pwysQ2rAH9/M/k= 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 BB7A513A7E; Mon, 6 Oct 2025 07:47:16 +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 +NmgKwR042h/HgAAD6G6ig (envelope-from ); Mon, 06 Oct 2025 07:47:16 +0000 From: Juergen Gross To: linux-kernel@vger.kernel.org, x86@kernel.org, virtualization@lists.linux.dev Cc: Juergen Gross , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Ajay Kaher , Alexey Makhalov , Broadcom internal kernel review list , Boris Ostrovsky , Stefano Stabellini , Oleksandr Tyshchenko , xen-devel@lists.xenproject.org, "Peter Zijlstra (Intel)" Subject: [PATCH v3 11/21] x86/paravirt: Use common code for paravirt_steal_clock() Date: Mon, 6 Oct 2025 09:45:56 +0200 Message-ID: <20251006074606.1266-12-jgross@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251006074606.1266-1-jgross@suse.com> References: <20251006074606.1266-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 [-2.80 / 50.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)[-0.999]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCPT_COUNT_TWELVE(0.00)[17]; DBL_BLOCKED_OPENRESOLVER(0.00)[infradead.org:email,suse.com:mid,suse.com:email,imap1.dmz-prg2.suse.org:helo]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FUZZY_RATELIMITED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; R_RATELIMIT(0.00)[to_ip_from(RLfdszjqhz8kzzb9uwpzdm8png)]; RCVD_TLS_ALL(0.00)[] X-Spam-Flag: NO X-Spam-Level: X-Spam-Score: -2.80 Content-Type: text/plain; charset="utf-8" Remove the arch specific variant of paravirt_steal_clock() and use the common one instead. With all archs supporting Xen now having been switched to the common variant, including paravirt.h can be dropped from drivers/xen/time.c. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- arch/x86/Kconfig | 1 + arch/x86/include/asm/paravirt.h | 7 ------- arch/x86/kernel/paravirt.c | 6 ------ arch/x86/xen/time.c | 1 + drivers/xen/time.c | 3 --- 5 files changed, 2 insertions(+), 16 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 451c3adffacb..f134cfff090b 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -799,6 +799,7 @@ if HYPERVISOR_GUEST config PARAVIRT bool "Enable paravirtualization code" depends on HAVE_STATIC_CALL + 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/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravir= t.h index 0ef797ea8440..766a7cee3d64 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h @@ -17,10 +17,8 @@ #include #include =20 -u64 dummy_steal_clock(int cpu); u64 dummy_sched_clock(void); =20 -DECLARE_STATIC_CALL(pv_steal_clock, dummy_steal_clock); DECLARE_STATIC_CALL(pv_sched_clock, dummy_sched_clock); =20 void paravirt_set_sched_clock(u64 (*func)(void)); @@ -35,11 +33,6 @@ bool pv_is_native_spin_unlock(void); __visible bool __native_vcpu_is_preempted(long cpu); bool pv_is_native_vcpu_is_preempted(void); =20 -static inline u64 paravirt_steal_clock(int cpu) -{ - return static_call(pv_steal_clock)(cpu); -} - #ifdef CONFIG_PARAVIRT_SPINLOCKS void __init paravirt_set_cap(void); #endif diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index a3ba4747be1c..42991d471bf3 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -60,12 +60,6 @@ void __init native_pv_lock_init(void) static_branch_enable(&virt_spin_lock_key); } =20 -static u64 native_steal_clock(int cpu) -{ - return 0; -} - -DEFINE_STATIC_CALL(pv_steal_clock, native_steal_clock); DEFINE_STATIC_CALL(pv_sched_clock, native_sched_clock); =20 void paravirt_set_sched_clock(u64 (*func)(void)) diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 96521b1874ac..e4754b2fa900 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c @@ -16,6 +16,7 @@ #include #include #include +#include =20 #include #include diff --git a/drivers/xen/time.c b/drivers/xen/time.c index 53b12f5ac465..0b18d8a5a2dd 100644 --- a/drivers/xen/time.c +++ b/drivers/xen/time.c @@ -10,9 +10,6 @@ #include #include =20 -#ifndef CONFIG_HAVE_PV_STEAL_CLOCK_GEN -#include -#endif #include #include =20 --=20 2.51.0