Commit 16e2011b authored by Glauber de Oliveira Costa's avatar Glauber de Oliveira Costa Committed by Ingo Molnar
Browse files

x86: allow sched clock to be overridden by paravirt

This patch turns the sched_clock into native_sched_clock.
sched clock becomes a weak symbol, which can then give its
place to a paravirt definition.
Signed-off-by: default avatarGlauber de Oliveira Costa <>
Signed-off-by: default avatarIngo Molnar <>
Signed-off-by: default avatarThomas Gleixner <>
parent 751de83c
......@@ -63,7 +63,7 @@ static void set_cyc2ns_scale(unsigned long cpu_khz, int cpu)
unsigned long long sched_clock(void)
unsigned long long native_sched_clock(void)
unsigned long a = 0;
......@@ -77,6 +77,19 @@ unsigned long long sched_clock(void)
return cycles_2_ns(a);
/* We need to define a real function for sched_clock, to override the
weak default version */
unsigned long long sched_clock(void)
return paravirt_sched_clock();
unsigned long long
sched_clock(void) __attribute__((alias("native_sched_clock")));
static int tsc_unstable;
inline int check_tsc_unstable(void)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment