File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414#ifndef __ASSEMBLER__
1515#include <linux/types.h>
1616#include <linux/cpumask.h>
17- #include <linux/static_call_types.h>
1817#include <asm/frame.h>
1918
20- u64 dummy_sched_clock (void );
21-
22- DECLARE_STATIC_CALL (pv_sched_clock , dummy_sched_clock );
23-
24- void paravirt_set_sched_clock (u64 (* func )(void ));
25-
26- static __always_inline u64 paravirt_sched_clock (void )
27- {
28- return static_call (pv_sched_clock )();
29- }
30-
3119__visible void __native_queued_spin_unlock (struct qspinlock * lock );
3220bool pv_is_native_spin_unlock (void );
3321__visible bool __native_vcpu_is_preempted (long cpu );
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ extern void recalibrate_cpu_khz(void);
1212extern int no_timer_check ;
1313
1414extern bool using_native_sched_clock (void );
15+ void paravirt_set_sched_clock (u64 (* func )(void ));
1516
1617/*
1718 * We use the full linear equation: f(x) = a + b*x, in order to allow
Original file line number Diff line number Diff line change 1919#include <linux/cc_platform.h>
2020
2121#include <asm/hypervisor.h>
22+ #include <asm/timer.h>
2223#include <asm/x86_init.h>
2324#include <asm/kvmclock.h>
2425
Original file line number Diff line number Diff line change @@ -60,13 +60,6 @@ void __init native_pv_lock_init(void)
6060 static_branch_enable (& virt_spin_lock_key );
6161}
6262
63- DEFINE_STATIC_CALL (pv_sched_clock , native_sched_clock );
64-
65- void paravirt_set_sched_clock (u64 (* func )(void ))
66- {
67- static_call_update (pv_sched_clock , func );
68- }
69-
7063static noinstr void pv_native_safe_halt (void )
7164{
7265 native_safe_halt ();
Original file line number Diff line number Diff line change @@ -267,19 +267,27 @@ u64 native_sched_clock_from_tsc(u64 tsc)
267267/* We need to define a real function for sched_clock, to override the
268268 weak default version */
269269#ifdef CONFIG_PARAVIRT
270+ DEFINE_STATIC_CALL (pv_sched_clock , native_sched_clock );
271+
270272noinstr u64 sched_clock_noinstr (void )
271273{
272- return paravirt_sched_clock ();
274+ return static_call ( pv_sched_clock ) ();
273275}
274276
275277bool using_native_sched_clock (void )
276278{
277279 return static_call_query (pv_sched_clock ) == native_sched_clock ;
278280}
281+
282+ void paravirt_set_sched_clock (u64 (* func )(void ))
283+ {
284+ static_call_update (pv_sched_clock , func );
285+ }
279286#else
280287u64 sched_clock_noinstr (void ) __attribute__((alias ("native_sched_clock" )));
281288
282289bool using_native_sched_clock (void ) { return true; }
290+ void paravirt_set_sched_clock (u64 (* func )(void )) { }
283291#endif
284292
285293notrace u64 sched_clock (void )
Original file line number Diff line number Diff line change 1919#include <linux/sched/cputime.h>
2020
2121#include <asm/pvclock.h>
22+ #include <asm/timer.h>
2223#include <asm/xen/hypervisor.h>
2324#include <asm/xen/hypercall.h>
2425#include <asm/xen/cpuid.h>
Original file line number Diff line number Diff line change @@ -535,6 +535,8 @@ static __always_inline void hv_setup_sched_clock(void *sched_clock)
535535 sched_clock_register (sched_clock , 64 , NSEC_PER_SEC );
536536}
537537#elif defined CONFIG_PARAVIRT
538+ #include <asm/timer.h>
539+
538540static __always_inline void hv_setup_sched_clock (void * sched_clock )
539541{
540542 /* We're on x86/x64 *and* using PV ops */
You can’t perform that action at this time.
0 commit comments