summaryrefslogtreecommitdiff
path: root/sys/arch/i386/include
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2010-08-19 19:31:54 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2010-08-19 19:31:54 +0000
commitb0821890140f70e9e8358a5d7d1764f182999781 (patch)
tree269754d725155853cce4958e189eb7ddcc5c4547 /sys/arch/i386/include
parent42e8573202cb07e421faa5868d0b14d286d51eda (diff)
Add "memory" clobber to lidt inline asm, to prevent the GCC optimizer from
getting stupid ideas like optimizing away stores to the descriptor that we're setting. This may be overkill, but this code is far from performance critical and it may prevent future surprises. Fixes instant reboots with bsd.rd on Pentiums with the F00F bug. Thanks to espie@, for narrowing the issue down enough for me to find the problem. ok deraadt@
Diffstat (limited to 'sys/arch/i386/include')
-rw-r--r--sys/arch/i386/include/cpufunc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/i386/include/cpufunc.h b/sys/arch/i386/include/cpufunc.h
index 3f37e86627c..0da7c4807a6 100644
--- a/sys/arch/i386/include/cpufunc.h
+++ b/sys/arch/i386/include/cpufunc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpufunc.h,v 1.16 2009/12/09 14:28:46 oga Exp $ */
+/* $OpenBSD: cpufunc.h,v 1.17 2010/08/19 19:31:53 kettenis Exp $ */
/* $NetBSD: cpufunc.h,v 1.8 1994/10/27 04:15:59 cgd Exp $ */
/*
@@ -78,7 +78,7 @@ invlpg(u_int addr)
static __inline void
lidt(void *p)
{
- __asm __volatile("lidt (%0)" : : "r" (p));
+ __asm __volatile("lidt (%0)" : : "r" (p) : "memory");
}
static __inline void