Module Name:    src
Committed By:   snj
Date:           Wed May 13 00:34:12 UTC 2009

Modified Files:
        src/sys/arch/x86/include [netbsd-5]: mutex.h

Log Message:
Pull up following revision(s) (requested by ad in ticket #725):
        sys/arch/x86/include/mutex.h: revision 1.6
A workaround for a bug with some Opteron revisions where locked operations
sometimes do not serve as memory barriers, allowing memory references to
bleed outside of critical sections.  It is possible that this is the
reason for pkgbuild's longstanding crashiness.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.10.1 src/sys/arch/x86/include/mutex.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/mutex.h
diff -u src/sys/arch/x86/include/mutex.h:1.5 src/sys/arch/x86/include/mutex.h:1.5.10.1
--- src/sys/arch/x86/include/mutex.h:1.5	Mon Apr 28 20:23:40 2008
+++ src/sys/arch/x86/include/mutex.h	Wed May 13 00:34:12 2009
@@ -1,7 +1,7 @@
-/*	$NetBSD: mutex.h,v 1.5 2008/04/28 20:23:40 martin Exp $	*/
+/*	$NetBSD: mutex.h,v 1.5.10.1 2009/05/13 00:34:12 snj Exp $	*/
 
 /*-
- * Copyright (c) 2002, 2006 The NetBSD Foundation, Inc.
+ * Copyright (c) 2002, 2006, 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -57,9 +57,12 @@
 #define	__HAVE_SIMPLE_MUTEXES		1
 
 /*
- * MUTEX_RECEIVE: no memory barrier required, as 'ret' implies a load fence.
+ * MUTEX_RECEIVE: technically, no memory barrier is required
+ * as 'ret' implies a load fence.  However we need this to
+ * handle a bug with some Opteron revisions.  See patch.c,
+ * lock_stubs.S.
  */
-#define	MUTEX_RECEIVE(mtx)		/* nothing */
+#define	MUTEX_RECEIVE(mtx)		membar_consumer()
 
 /*
  * MUTEX_GIVE: no memory barrier required, as _lock_cas() will take care of it.

Reply via email to