From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org, x86@kernel.org,
virtualization@lists.linux.dev
Cc: Juergen Gross <jgross@suse.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Ajay Kaher <ajay.kaher@broadcom.com>,
Alexey Makhalov <alexey.makhalov@broadcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
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 [thread overview]
Message-ID: <20250911063433.13783-12-jgross@suse.com> (raw)
In-Reply-To: <20250911063433.13783-1-jgross@suse.com>
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 <jgross@suse.com>
---
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/paravirt.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 <linux/static_call_types.h>
#include <asm/frame.h>
-u64 dummy_steal_clock(int cpu);
u64 dummy_sched_clock(void);
-DECLARE_STATIC_CALL(pv_steal_clock, dummy_steal_clock);
DECLARE_STATIC_CALL(pv_sched_clock, dummy_sched_clock);
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);
-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);
}
-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);
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 <linux/slab.h>
#include <linux/pvclock_gtod.h>
#include <linux/timekeeper_internal.h>
+#include <linux/sched/cputime.h>
#include <asm/pvclock.h>
#include <asm/xen/hypervisor.h>
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 <linux/static_call.h>
#include <linux/sched/cputime.h>
-#ifndef CONFIG_HAVE_PV_STEAL_CLOCK_GEN
-#include <asm/paravirt.h>
-#endif
#include <asm/xen/hypervisor.h>
#include <asm/xen/hypercall.h>
--
2.51.0
next prev parent reply other threads:[~2025-09-11 6:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-11 6:34 [PATCH 00/14] paravirt: cleanup and reorg Juergen Gross
2025-09-11 6:34 ` [PATCH 02/14] x86/paravirt: remove some unneeded struct declarations Juergen Gross
2025-09-11 6:34 ` [PATCH 03/14] x86/paravirt: remove PARAVIRT_DEBUG config option Juergen Gross
2025-09-11 6:34 ` [PATCH 04/14] x86/paravirt: move thunk macros to paravirt_types.h Juergen Gross
2025-09-11 6:34 ` [PATCH 05/14] paravirt: remove asm/paravirt_api_clock.h Juergen Gross
2025-09-11 6:34 ` [PATCH 06/14] sched: move clock related paravirt code to kernel/sched Juergen Gross
2025-09-11 6:34 ` [PATCH 07/14] arm/paravirt: use common code for paravirt_steal_clock() Juergen Gross
2025-09-11 6:34 ` [PATCH 08/14] arm64/paravirt: " Juergen Gross
2025-09-11 6:34 ` [PATCH 09/14] loongarch/paravirt: " Juergen Gross
2025-09-11 6:34 ` [PATCH 10/14] riscv/paravirt: " Juergen Gross
2025-09-11 6:34 ` Juergen Gross [this message]
2025-09-11 6:34 ` [PATCH 12/14] x86/paravirt: move paravirt_sched_clock() related code into tsc.c Juergen Gross
2025-09-11 6:34 ` [PATCH 13/14] x86/paravirt: allow pv-calls outside paravirt.h Juergen Gross
2025-09-11 6:34 ` [PATCH 14/14] x86/pvlocks: move paravirt spinlock functions into qspinlock.h Juergen Gross
2025-09-11 7:48 ` [PATCH 00/14] paravirt: cleanup and reorg Peter Zijlstra
2025-09-11 8:00 ` Jürgen Groß
2026-02-20 4:10 ` patchwork-bot+linux-riscv
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250911063433.13783-12-jgross@suse.com \
--to=jgross@suse.com \
--cc=ajay.kaher@broadcom.com \
--cc=alexey.makhalov@broadcom.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=oleksandr_tyshchenko@epam.com \
--cc=sstabellini@kernel.org \
--cc=tglx@linutronix.de \
--cc=virtualization@lists.linux.dev \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox