acrn-kernel/include/asm-generic/bitops
Mikulas Patocka 8238b45798 wait_on_bit: add an acquire memory barrier
There are several places in the kernel where wait_on_bit is not followed
by a memory barrier (for example, in drivers/md/dm-bufio.c:new_read).

On architectures with weak memory ordering, it may happen that memory
accesses that follow wait_on_bit are reordered before wait_on_bit and
they may return invalid data.

Fix this class of bugs by introducing a new function "test_bit_acquire"
that works like test_bit, but has acquire memory ordering semantics.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-by: Will Deacon <will@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-08-26 09:30:25 -07:00
..
__ffs.h
__fls.h
arch_hweight.h
atomic.h locking/atomic: Make test_and_*_bit() ordered on failure 2022-08-16 09:19:43 -07:00
builtin-__ffs.h
builtin-__fls.h
builtin-ffs.h
builtin-fls.h
const_hweight.h
ext2-atomic-setbit.h
ext2-atomic.h
ffs.h
ffz.h
fls.h
fls64.h
generic-non-atomic.h wait_on_bit: add an acquire memory barrier 2022-08-26 09:30:25 -07:00
hweight.h
instrumented-atomic.h asm-generic/bitops: Always inline all bit manipulation helpers 2022-01-25 22:30:28 +01:00
instrumented-lock.h
instrumented-non-atomic.h wait_on_bit: add an acquire memory barrier 2022-08-26 09:30:25 -07:00
le.h
lock.h
non-atomic.h wait_on_bit: add an acquire memory barrier 2022-08-26 09:30:25 -07:00
non-instrumented-non-atomic.h wait_on_bit: add an acquire memory barrier 2022-08-26 09:30:25 -07:00
sched.h