the release write becomes globally visible only after any writes
of the critical section are globally visible. In practice, the
reordering has not happened because the kernel runs in the total
store order mode.
Tested by and OK kettenis@
-/* $OpenBSD: lock_machdep.c,v 1.12 2017/03/07 14:41:57 visa Exp $ */
+/* $OpenBSD: lock_machdep.c,v 1.13 2017/04/04 12:30:04 visa Exp $ */
/*
* Copyright (c) 2007 Artur Grabowski <art@openbsd.org>
s = intr_disable();
if (--cpu->mplc_depth == 0) {
- mpl->mpl_ticket++;
sparc_membar(StoreStore | LoadStore);
+ mpl->mpl_ticket++;
}
intr_restore(s);
}
s = intr_disable();
rv = cpu->mplc_depth;
cpu->mplc_depth = 0;
- mpl->mpl_ticket++;
sparc_membar(StoreStore | LoadStore);
+ mpl->mpl_ticket++;
intr_restore(s);
return (rv);