Module Name: src
Committed By: martin
Date: Wed Oct 16 17:32:17 UTC 2019
Modified Files:
src/sys/arch/x86/include [netbsd-9]: cpufunc.h
Log Message:
Pull up following revision(s) (requested by maxv in ticket #338):
sys/arch/x86/include/cpufunc.h: revision 1.35
Add a memory barrier on wrmsr, because some MSRs control memory access
rights (we don't use them though). Also add barriers on fninit and clts
for safety.
To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.34.2.1 src/sys/arch/x86/include/cpufunc.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/x86/include/cpufunc.h
diff -u src/sys/arch/x86/include/cpufunc.h:1.34 src/sys/arch/x86/include/cpufunc.h:1.34.2.1
--- src/sys/arch/x86/include/cpufunc.h:1.34 Fri Jul 5 17:08:55 2019
+++ src/sys/arch/x86/include/cpufunc.h Wed Oct 16 17:32:17 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: cpufunc.h,v 1.34 2019/07/05 17:08:55 maxv Exp $ */
+/* $NetBSD: cpufunc.h,v 1.34.2.1 2019/10/16 17:32:17 martin Exp $ */
/*
* Copyright (c) 1998, 2007, 2019 The NetBSD Foundation, Inc.
@@ -271,7 +271,7 @@ union savefpu;
static inline void
fninit(void)
{
- __asm volatile ("fninit");
+ __asm volatile ("fninit" ::: "memory");
}
static inline void
@@ -303,7 +303,7 @@ fnstsw(uint16_t *val)
static inline void
clts(void)
{
- __asm volatile ("clts");
+ __asm volatile ("clts" ::: "memory");
}
void stts(void);
@@ -433,6 +433,7 @@ wrmsr(u_int msr, uint64_t val)
"wrmsr"
:
: "a" (low), "d" (high), "c" (msr)
+ : "memory"
);
}