freebsd-nq/sys/i386
Konstantin Belousov cbb65b7ec5 i386: Do not ever store to other-CPU counter64 slot.
On CPUs supporting cmpxchg8b, fetch is performed by cmpxchg8b on
corresponding CPU slot, which unconditionally write to the slot.  If
for that slot, the owner CPU increments it, then both CPUs might run
the cmpxchg8b instruction concurrently and this might race and
override the incremental write.  So the counter update would be lost.

Fix it by implementing fetch as IPI and accumulation of result.  It is
acceptable for rare counter64 fetch operation to be more expensive.

Diagnosed and tested by:	Andreas Longwitz <longwitz@incore.de>
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2019-02-03 21:28:58 +00:00
..
acpica i386: Merge PAE and non-PAE pmaps into same kernel. 2019-01-30 02:07:13 +00:00
bios Use NULL for SYSINIT's last arg, which is a pointer type 2018-05-18 17:58:09 +00:00
cloudabi32 Use TO_PTR() to convert integers to pointers. 2017-11-26 14:45:56 +00:00
conf Make iflib a loadable module. 2019-01-31 19:05:56 +00:00
i386 Disable boot-time memory test on i386 be default. 2019-02-01 21:09:36 +00:00
include i386: Do not ever store to other-CPU counter64 slot. 2019-02-03 21:28:58 +00:00
linux Fix errno values returned from DUMMY_XATTR linuxulator calls 2019-01-11 07:58:25 +00:00
pci i386: Merge PAE and non-PAE pmaps into same kernel. 2019-01-30 02:07:13 +00:00
Makefile Remove iBCS2, part2: general kernel 2018-12-19 21:57:58 +00:00