FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 06-06-2008, 07:46 PM
Alok Kataria
 
Default 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--
 

Thread Tools




All times are GMT. The time now is 09:41 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org