freebsd-dev/sys
Andriy Gapon d0c0856f63 emulate illumos membar_producer with atomic_thread_fence_rel
membar_producer is supposed to be a store-store barrier.
Also, in the code that FreeBSD has ported from illumos membar_producer
is used only with regular stores to regular memory (with respect to
caching).

We do not have an MI primitive for the store-store barrier, so
atomic_thread_fence_rel is the closest we have as it provides
(load | store) -> store barrier.

Previously, membar_producer was an empty function call on all 32-bit
arm-s, 32-bit powerpc, riscv and all mips variants.  I think that it was
inadequate.
On other platforms, such as amd64, arm64, i386, powerpc64, sparc64,
membar_producer was implemented using stronger primitives than required
for a store-store barrier with respect to regular memory access.
For example, it used sfence on amd64 and lock-ed nop in i386 (despite TSO).
On powerpc64 we now use recommended lwsync instead of eieio.
On sparc64 FreeBSD uses TSO mode.
On arm64/aarch64 we now use dmb sy instead of dmb ish.  Not sure if this
is an improvement, actually.

After this change we can drop opensolaris_atomic.S for aarch64, amd64,
powerpc64 and sparc64 as all required atomic operations have either
direct or light-weight mapping to FreeBSD native atomic operations.

Discussed with:	kib
MFC after:	4 weeks
2019-10-10 07:39:41 +00:00
..
amd64 This driver attaches to the Intel VMD drive and connects a new PCI domain 2019-10-10 03:12:17 +00:00
arm align use of cp15_pmccntr_get with its availability 2019-10-07 07:37:42 +00:00
arm64 Eliminate an unused declaration. The variable in question is only defined 2019-10-07 04:22:03 +00:00
bsm
cam Add kern.cam.da.X.quirks tunable, similar existing for ada. 2019-09-26 14:48:39 +00:00
cddl emulate illumos membar_producer with atomic_thread_fence_rel 2019-10-10 07:39:41 +00:00
compat Define macro VM_MAP_ENTRY_FOREACH for enumerating the entries in a vm_map. 2019-10-08 07:14:21 +00:00
conf emulate illumos membar_producer with atomic_thread_fence_rel 2019-10-10 07:39:41 +00:00
contrib Widen NET_EPOCH coverage. 2019-10-07 22:40:05 +00:00
crypto Stop using des_cblock * for arguments to DES functions. 2019-08-26 17:25:07 +00:00
ddb ddb(4): Add some support for lexing IPv6 addresses 2019-09-09 16:32:23 +00:00
dev This driver attaches to the Intel VMD drive and connects a new PCI domain 2019-10-10 03:12:17 +00:00
dts dtso: allwinner: Add an overlay for H3 thermal node 2019-08-24 13:26:34 +00:00
fs Define macro VM_MAP_ENTRY_FOREACH for enumerating the entries in a vm_map. 2019-10-08 07:14:21 +00:00
gdb gdb(4): Root a sysctl tree at 'debug.gdb.' 2019-09-08 22:52:47 +00:00
geom Add a "count_until_fail" option to gnop, which says to start failing 2019-09-13 23:03:56 +00:00
gnu arm: dts: ti: Fix mmc3 instance by setting it to disabled 2019-10-07 08:11:49 +00:00
i386 i386: hide more of atomic 64-bit definitions under _KERNEL 2019-10-08 10:50:16 +00:00
isa
kern Don't free the cursor boundary tag during vmem_destroy(). 2019-10-09 21:20:39 +00:00
kgssapi Stop using des_cblock * for arguments to DES functions. 2019-08-26 17:25:07 +00:00
libkern Remove zlib 1.0.4 from kernel. 2019-08-25 17:13:00 +00:00
mips add atomic_load_64 for mipsn32 2019-10-07 07:42:26 +00:00
modules This driver attaches to the Intel VMD drive and connects a new PCI domain 2019-10-10 03:12:17 +00:00
net ifnet_byindex_ref() requires network epoch. 2019-10-09 16:21:50 +00:00
net80211 Enhance the comment ieee80211_add_channel() to avoid a 2019-06-10 14:31:18 +00:00
netgraph Widen NET_EPOCH coverage. 2019-10-07 22:40:05 +00:00
netinet Fix casting error from newer gcc 2019-10-09 21:02:06 +00:00
netinet6 ip6_output() has a complex set of gotos, and some can jump out of 2019-10-09 17:02:28 +00:00
netipsec Widen NET_EPOCH coverage. 2019-10-07 22:40:05 +00:00
netpfil Widen NET_EPOCH coverage. 2019-10-07 22:40:05 +00:00
netsmb Stop using des_cblock * for arguments to DES functions. 2019-08-26 17:25:07 +00:00
nfs
nfsclient
nfsserver
nlm
ofed Widen NET_EPOCH coverage. 2019-10-07 22:40:05 +00:00
opencrypto kTLS support for TLS 1.3 2019-09-27 19:17:40 +00:00
powerpc powerpc: Implement atomic_(f)cmpset_ for short and char 2019-10-08 01:36:34 +00:00
riscv Avoid erroneously clearing PGA_WRITEABLE in riscv's pmap_enter(). 2019-10-08 15:03:48 +00:00
rpc Avoid relying on header pollution from sys/refcount.h. 2019-07-29 20:26:01 +00:00
security Define macro VM_MAP_ENTRY_FOREACH for enumerating the entries in a vm_map. 2019-10-08 07:14:21 +00:00
sparc64 sparc64: use generic sub-word atomic *cmpset 2019-10-02 17:08:20 +00:00
sys Fix the compilation workaround so it's not entirely dead code - clang 2019-10-09 18:46:56 +00:00
teken Adjust teken to allow build as part of loader 2019-09-05 18:07:40 +00:00
tests
tools fw_stub.awk: use @generated tag in generated files 2019-09-11 13:35:22 +00:00
ufs ufs: add root vnode caching 2019-10-06 22:18:03 +00:00
vm Define macro VM_MAP_ENTRY_FOREACH for enumerating the entries in a vm_map. 2019-10-08 07:14:21 +00:00
x86 amd64: plug spurious cld instructions 2019-10-08 21:14:11 +00:00
xdr
xen
Makefile