From nobody Sun Sep 14 08:21:39 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1757572581; cv=none; d=zohomail.com; s=zohoarc; b=HQLoXvGGUqmqSDUxspze+euztogoBHm8kMrFRgio9XajcGUIdSwmagyWJrWjhLGrnU46CMVK1ibmWCQRyS1jUJEcdfTgFMz7t8GeO1RrZSANmu95vcwtq6R/yKg9QRU2O8XXvMhwKPrD0R4kS2G2l1fceF6OaxxmYKAihPejNF4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757572581; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mwbRHLALg5lwBc9OgVUB+3usz/LNGiagF/bxFj43cyE=; b=dnrKwHy7cObDxan279/7I43O33vN8k7oHI4k0/M7vD2jNmtpLVEU26NEJQjr13M0BA2NobTTIgU5u1Wc/ft/L327L1C+rhh+CA0GY7U78v7D6V+ZbkrO95afva9CVuzaFZJVAmm31PI3gLe8zSQMS4bn87AUf90VknLVNWvR0uw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757572581884920.0389728061989; Wed, 10 Sep 2025 23:36:21 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1119382.1464773 (Exim 4.92) (envelope-from ) id 1uwaua-0007La-Pu; Thu, 11 Sep 2025 06:36:04 +0000 Received: by outflank-mailman (output) from mailman id 1119382.1464773; Thu, 11 Sep 2025 06:36:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwaua-0007LH-MF; Thu, 11 Sep 2025 06:36:04 +0000 Received: by outflank-mailman (input) for mailman id 1119382; Thu, 11 Sep 2025 06:36:03 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwauI-0005JR-QI for xen-devel@lists.xenproject.org; Thu, 11 Sep 2025 06:35:46 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8ba45cfb-8ed9-11f0-9809-7dc792cee155; Thu, 11 Sep 2025 08:35:45 +0200 (CEST) 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 CD4D03FA7F; Thu, 11 Sep 2025 06:35:44 +0000 (UTC) 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 416601372E; Thu, 11 Sep 2025 06:35:44 +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 w5NADsBtwmhHTQAAD6G6ig (envelope-from ); Thu, 11 Sep 2025 06:35:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8ba45cfb-8ed9-11f0-9809-7dc792cee155 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1757572544; 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=mwbRHLALg5lwBc9OgVUB+3usz/LNGiagF/bxFj43cyE=; b=iIKZ32INl/ZYXAkpgDfbZ1kv7upRSYUWCbvcI02xFi4NYMTYL6p3WVeZpIILKEMMWX/ulI lW2wbz0/I2wRtO2xLTIH49uobGMLrdjNBpB/PZq60XmRSlaf4/Fy8/AbTHYfp19QOJD8xR /4leIyIhyow/2KKDzj1HsLpCJnTwI+A= Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1757572544; 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=mwbRHLALg5lwBc9OgVUB+3usz/LNGiagF/bxFj43cyE=; b=iIKZ32INl/ZYXAkpgDfbZ1kv7upRSYUWCbvcI02xFi4NYMTYL6p3WVeZpIILKEMMWX/ulI lW2wbz0/I2wRtO2xLTIH49uobGMLrdjNBpB/PZq60XmRSlaf4/Fy8/AbTHYfp19QOJD8xR /4leIyIhyow/2KKDzj1HsLpCJnTwI+A= 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 Subject: [PATCH 11/14] x86/paravirt: use common code for paravirt_steal_clock() Date: Thu, 11 Sep 2025 08:34:30 +0200 Message-ID: <20250911063433.13783-12-jgross@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250911063433.13783-1-jgross@suse.com> References: <20250911063433.13783-1-jgross@suse.com> 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%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:mid,suse.com:email]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCPT_COUNT_TWELVE(0.00)[16]; RCVD_VIA_SMTP_AUTH(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; R_RATELIMIT(0.00)[to_ip_from(RLfdszjqhz8kzzb9uwpzdm8png)]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; RCVD_TLS_ALL(0.00)[] X-Spam-Flag: NO X-Spam-Level: X-Spam-Score: -6.80 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1757572584248116600 Content-Type: text/plain; charset="utf-8" Remove the arch specific variant of paravirt_steal_clock() and use the common one instead. With alol 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 --- 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 07bf67b849b7..0f8abf96cc39 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -784,6 +784,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 491cb7e037bf..37d7494ce146 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h @@ -21,10 +21,8 @@ struct mm_struct; #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)); @@ -39,11 +37,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