Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/paravirt: Use common code for paravirt_steal_clock()

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

authored by

Juergen Gross and committed by
Borislav Petkov (AMD)
589f41f2 ee9ffcf9

+2 -16
+1
arch/x86/Kconfig
··· 799 799 config PARAVIRT 800 800 bool "Enable paravirtualization code" 801 801 depends on HAVE_STATIC_CALL 802 + select HAVE_PV_STEAL_CLOCK_GEN 802 803 help 803 804 This changes the kernel so it can modify itself when it is run 804 805 under a hypervisor, potentially improving performance significantly
-7
arch/x86/include/asm/paravirt.h
··· 17 17 #include <linux/static_call_types.h> 18 18 #include <asm/frame.h> 19 19 20 - u64 dummy_steal_clock(int cpu); 21 20 u64 dummy_sched_clock(void); 22 21 23 - DECLARE_STATIC_CALL(pv_steal_clock, dummy_steal_clock); 24 22 DECLARE_STATIC_CALL(pv_sched_clock, dummy_sched_clock); 25 23 26 24 void paravirt_set_sched_clock(u64 (*func)(void)); ··· 32 34 bool pv_is_native_spin_unlock(void); 33 35 __visible bool __native_vcpu_is_preempted(long cpu); 34 36 bool pv_is_native_vcpu_is_preempted(void); 35 - 36 - static inline u64 paravirt_steal_clock(int cpu) 37 - { 38 - return static_call(pv_steal_clock)(cpu); 39 - } 40 37 41 38 #ifdef CONFIG_PARAVIRT_SPINLOCKS 42 39 void __init paravirt_set_cap(void);
-6
arch/x86/kernel/paravirt.c
··· 60 60 static_branch_enable(&virt_spin_lock_key); 61 61 } 62 62 63 - static u64 native_steal_clock(int cpu) 64 - { 65 - return 0; 66 - } 67 - 68 - DEFINE_STATIC_CALL(pv_steal_clock, native_steal_clock); 69 63 DEFINE_STATIC_CALL(pv_sched_clock, native_sched_clock); 70 64 71 65 void paravirt_set_sched_clock(u64 (*func)(void))
+1
arch/x86/xen/time.c
··· 16 16 #include <linux/slab.h> 17 17 #include <linux/pvclock_gtod.h> 18 18 #include <linux/timekeeper_internal.h> 19 + #include <linux/sched/cputime.h> 19 20 20 21 #include <asm/pvclock.h> 21 22 #include <asm/xen/hypervisor.h>
-3
drivers/xen/time.c
··· 10 10 #include <linux/static_call.h> 11 11 #include <linux/sched/cputime.h> 12 12 13 - #ifndef CONFIG_HAVE_PV_STEAL_CLOCK_GEN 14 - #include <asm/paravirt.h> 15 - #endif 16 13 #include <asm/xen/hypervisor.h> 17 14 #include <asm/xen/hypercall.h> 18 15