]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/paravirt: Use common code for paravirt_steal_clock()
authorJuergen Gross <jgross@suse.com>
Mon, 5 Jan 2026 11:05:10 +0000 (12:05 +0100)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 12 Jan 2026 15:48:26 +0000 (16:48 +0100)
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 <jgross@suse.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260105110520.21356-12-jgross@suse.com
arch/x86/Kconfig
arch/x86/include/asm/paravirt.h
arch/x86/kernel/paravirt.c
arch/x86/xen/time.c
drivers/xen/time.c

index 1f30358dfecd6408cdf4a6f8102ea1b4530ceb6a..62e11572da27700847c2df9eb497b6c6e3bbc00b 100644 (file)
@@ -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
index 0ef797ea84400b53aeaf3e71b2ece3aea46e0e65..766a7cee3d646c168d84254a0047a0e1ae5ec604 100644 (file)
 #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));
@@ -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);
 
-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
index a3ba4747be1cfc4f547f95c2d78006ac0d02552d..42991d471bf3c0e1fc9222a56c3dc6924a36729b 100644 (file)
@@ -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))
index 96521b1874acfc39995f3b9a138783341097be27..e4754b2fa900506ef3966c06e42e66239212e448 100644 (file)
@@ -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>
index 53b12f5ac465393b58afe2d8e1413df9b3e82bdb..0b18d8a5a2dd36f0a39ef439b00f6ecd1c42bb2f 100644 (file)
@@ -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>