summaryrefslogtreecommitdiffstats
path: root/include/asm-x86/msr.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge2008-06-25 06:18:59 +0200
committerIngo Molnar2008-07-08 13:10:24 +0200
commitaf2b1c609ff52b6469d8e67696db98c93c348b0e (patch)
tree794e4ebf8a9ed524cfbd01bc9e7f80fd110d3c2c /include/asm-x86/msr.h
parentx86: add memory clobber to save/loadsegment (diff)
downloadkernel-qcow2-linux-af2b1c609ff52b6469d8e67696db98c93c348b0e.tar.gz
kernel-qcow2-linux-af2b1c609ff52b6469d8e67696db98c93c348b0e.tar.xz
kernel-qcow2-linux-af2b1c609ff52b6469d8e67696db98c93c348b0e.zip
x86: add memory barriers to wrmsr
wrmsr is a special instruction which can have arbitrary system-wide effects. We don't want the compiler to reorder it with respect to memory operations, so make it a memory barrier. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Cc: xen-devel <xen-devel@lists.xensource.com> Cc: Stephen Tweedie <sct@redhat.com> Cc: Eduardo Habkost <ehabkost@redhat.com> Cc: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/msr.h')
-rw-r--r--include/asm-x86/msr.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/asm-x86/msr.h b/include/asm-x86/msr.h
index 2b5f2c91db25..ca110ee73f07 100644
--- a/include/asm-x86/msr.h
+++ b/include/asm-x86/msr.h
@@ -66,7 +66,7 @@ static inline unsigned long long native_read_msr_safe(unsigned int msr,
static inline void native_write_msr(unsigned int msr,
unsigned low, unsigned high)
{
- asm volatile("wrmsr" : : "c" (msr), "a"(low), "d" (high));
+ asm volatile("wrmsr" : : "c" (msr), "a"(low), "d" (high) : "memory");
}
static inline int native_write_msr_safe(unsigned int msr,
@@ -81,7 +81,8 @@ static inline int native_write_msr_safe(unsigned int msr,
_ASM_EXTABLE(2b, 3b)
: "=a" (err)
: "c" (msr), "0" (low), "d" (high),
- "i" (-EFAULT));
+ "i" (-EFAULT)
+ : "memory");
return err;
}