Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80152
b: refs/heads/master
c: fde1b3f
h: refs/heads/master
v: v3
  • Loading branch information
Andi Kleen authored and Ingo Molnar committed Jan 30, 2008
1 parent c14d98f commit 2aedbbc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2a10e7c41254941cac87be1eccdcb6379ce097f5
refs/heads/master: fde1b3fa947c2512e3715962ebb1d3a6a9b9bb7d
13 changes: 13 additions & 0 deletions trunk/include/asm-x86/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <asm/segment.h>
#include <asm/cpufeature.h>
#include <asm/cmpxchg.h>
#include <asm/nops.h>

#include <linux/kernel.h>
#include <linux/irqflags.h>
Expand Down Expand Up @@ -395,5 +396,17 @@ void default_idle(void);
#define set_mb(var, value) do { var = value; barrier(); } while (0)
#endif

/*
* Stop RDTSC speculation. This is needed when you need to use RDTSC
* (or get_cycles or vread that possibly accesses the TSC) in a defined
* code region.
*
* (Could use an alternative three way for this if there was one.)
*/
static inline void rdtsc_barrier(void)
{
alternative(ASM_NOP3, "mfence", X86_FEATURE_MFENCE_RDTSC);
alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC);
}

#endif

0 comments on commit 2aedbbc

Please sign in to comment.