svn commit: r340209 - head/sys/powerpc/include

Justin Hibbits jhibbits at FreeBSD.org
Wed Nov 7 01:42:01 UTC 2018


Author: jhibbits
Date: Wed Nov  7 01:42:00 2018
New Revision: 340209
URL: https://svnweb.freebsd.org/changeset/base/340209

Log:
  powerpc/atomic: Loosen the memory barrier on atomic_load_acq_*()
  
  'sync' is pretty heavy-handed, and is unnecessary for this use case.  It's a
  full barrier, which is applicable for all storage types.  However,
  atomic_load_acq_*() is only expected to operate on physical memory, not
  device memory, so lwsync is sufficient (lwsync provides access ordering on
  memory that is marked as Coherency Required and is not Write Through nor
  Cache Inhibited).  On 32-bit systems, this is a nop, since powerpc_lwsync()
  is defined to use sync, as a workaround for a silicon bug in the Freescale
  e500 core.

Modified:
  head/sys/powerpc/include/atomic.h

Modified: head/sys/powerpc/include/atomic.h
==============================================================================
--- head/sys/powerpc/include/atomic.h	Tue Nov  6 23:41:44 2018	(r340208)
+++ head/sys/powerpc/include/atomic.h	Wed Nov  7 01:42:00 2018	(r340209)
@@ -510,7 +510,7 @@ atomic_load_acq_##TYPE(volatile u_##TYPE *p)			\
 	u_##TYPE v;						\
 								\
 	v = *p;							\
-	mb();							\
+	powerpc_lwsync();					\
 	return (v);						\
 }								\
 								\


More information about the svn-src-all mailing list