Skip to content

Commit

Permalink
x86: read_tsc sync
Browse files Browse the repository at this point in the history
make native_read_tsc() always non-speculative.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Ingo Molnar committed Jan 30, 2008
1 parent e402644 commit f06e4ec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/x86/kernel/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,10 @@ unsigned long long __vsyscall_fn native_read_tsc(void)
{
DECLARE_ARGS(val, low, high);

rdtsc_barrier();
asm volatile("rdtsc" : EAX_EDX_RET(val, low, high));
rdtsc_barrier();

return EAX_EDX_VAL(val, low, high);
}
EXPORT_SYMBOL_GPL(native_read_tsc);

0 comments on commit f06e4ec

Please sign in to comment.