Add barriers to native_read_tsc
Need barriers in native_read_tsc for 586 or higher
Signed-off-by: Alok N Kataria <akataria@vmware.com>
---
include/asm-x86/msr.h | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/include/asm-x86/msr.h b/include/asm-x86/msr.h
index c571c6b..cfe1694 100644
--- a/include/asm-x86/msr.h
+++ b/include/asm-x86/msr.h
@@ -174,6 +174,7 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
#ifndef __ASSEMBLY__
#include <linux/errno.h>
+#include <asm/system.h>
/*
* Access to machine-specific registers (available on 586 and better only)
* Note: the rd* operations modify the parameters directly (without using
@@ -228,7 +229,11 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
static inline unsigned long long native_read_tsc(void)
{
unsigned long long val;
+
+ rdtsc_barrier();
rdtscll(val);
+ rdtsc_barrier();
+
return val;
}
--
1.5.4
--=-vQoIgoXmyr30mGQhdyBY
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
--=-vQoIgoXmyr30mGQhdyBY--
|