Skip to content

Commit 589f41f

Browse files
jgross1bp3tk0v
authored andcommitted
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
1 parent ee9ffcf commit 589f41f

5 files changed

Lines changed: 2 additions & 16 deletions

File tree

arch/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,7 @@ if HYPERVISOR_GUEST
799799
config PARAVIRT
800800
bool "Enable paravirtualization code"
801801
depends on HAVE_STATIC_CALL
802+
select HAVE_PV_STEAL_CLOCK_GEN
802803
help
803804
This changes the kernel so it can modify itself when it is run
804805
under a hypervisor, potentially improving performance significantly

arch/x86/include/asm/paravirt.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@
1717
#include <linux/static_call_types.h>
1818
#include <asm/frame.h>
1919

20-
u64 dummy_steal_clock(int cpu);
2120
u64 dummy_sched_clock(void);
2221

23-
DECLARE_STATIC_CALL(pv_steal_clock, dummy_steal_clock);
2422
DECLARE_STATIC_CALL(pv_sched_clock, dummy_sched_clock);
2523

2624
void paravirt_set_sched_clock(u64 (*func)(void));
@@ -35,11 +33,6 @@ bool pv_is_native_spin_unlock(void);
3533
__visible bool __native_vcpu_is_preempted(long cpu);
3634
bool pv_is_native_vcpu_is_preempted(void);
3735

38-
static inline u64 paravirt_steal_clock(int cpu)
39-
{
40-
return static_call(pv_steal_clock)(cpu);
41-
}
42-
4336
#ifdef CONFIG_PARAVIRT_SPINLOCKS
4437
void __init paravirt_set_cap(void);
4538
#endif

arch/x86/kernel/paravirt.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ void __init native_pv_lock_init(void)
6060
static_branch_enable(&virt_spin_lock_key);
6161
}
6262

63-
static u64 native_steal_clock(int cpu)
64-
{
65-
return 0;
66-
}
67-
68-
DEFINE_STATIC_CALL(pv_steal_clock, native_steal_clock);
6963
DEFINE_STATIC_CALL(pv_sched_clock, native_sched_clock);
7064

7165
void paravirt_set_sched_clock(u64 (*func)(void))

arch/x86/xen/time.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/slab.h>
1717
#include <linux/pvclock_gtod.h>
1818
#include <linux/timekeeper_internal.h>
19+
#include <linux/sched/cputime.h>
1920

2021
#include <asm/pvclock.h>
2122
#include <asm/xen/hypervisor.h>

drivers/xen/time.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
#include <linux/static_call.h>
1111
#include <linux/sched/cputime.h>
1212

13-
#ifndef CONFIG_HAVE_PV_STEAL_CLOCK_GEN
14-
#include <asm/paravirt.h>
15-
#endif
1613
#include <asm/xen/hypervisor.h>
1714
#include <asm/xen/hypercall.h>
1815

0 commit comments

Comments
 (0)