Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Feb 2018 17:50:07 +0000 (UTC)
From:      Olivier Houchard <cognet@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r329388 - head/sys/contrib/ck/include
Message-ID:  <201802161750.w1GHo7V0027493@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cognet
Date: Fri Feb 16 17:50:06 2018
New Revision: 329388
URL: https://svnweb.freebsd.org/changeset/base/329388

Log:
  Define CK_MD_TSO for the relevant arches (i386, amd64 and sparc64).
  Defaulting to CK_MD_RMO has the unfortunate side effect of generating
  memory barriers that are useless on those arches, and the even more
  unfortunate side effect of generating lfence/sfence/mfence on i386, even
  if older CPUs don't support it.
  This should fix the panic reported when using IPFW on a Pentium 3.
  Note that mfence and sfence might still be used in a few case, but that
  shouldn't happen in FreeBSD right now, and should be fixed upstream first.
  
  MFC after:	1 week

Modified:
  head/sys/contrib/ck/include/ck_md.h

Modified: head/sys/contrib/ck/include/ck_md.h
==============================================================================
--- head/sys/contrib/ck/include/ck_md.h	Fri Feb 16 17:46:07 2018	(r329387)
+++ head/sys/contrib/ck/include/ck_md.h	Fri Feb 16 17:50:06 2018	(r329388)
@@ -53,10 +53,6 @@
 #define CK_PR_DISABLE_DOUBLE
 #endif /* CK_PR_DISABLE_DOUBLE */
 
-#ifndef CK_MD_RMO
-#define CK_MD_RMO
-#endif /* CK_MD_RMO */
-
 #define CK_VERSION "0.6.0"
 #define CK_GIT_SHA ""
 
@@ -65,11 +61,20 @@
  */
 #if defined(__i386__) && !defined(__x86__)
 #define __x86__
+#define CK_MD_TSO
+#elif defined(__amd64__)
+#define CK_MD_TSO
 #elif defined(__sparc64__) && !defined(__sparcv9__)
 #define __sparcv9__
+#define CK_MD_TSO
 #elif defined(__powerpc64__) && !defined(__ppc64__)
 #define __ppc64__
 #elif defined(__powerpc__) && !defined(__ppc__)
 #define __ppc__
 #endif
+
+#if !defined(CK_MD_RMO) && !defined(CK_MD_TSO) && !defined(CK_MD_PSO)
+#define CK_MD_RMO
+#endif
+
 #endif /* CK_MD_H */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802161750.w1GHo7V0027493>