Commit 87908ef
s390/bpf: Fully order atomic "add", "and", "or" and "xor"
BPF_ATOMIC_OP() macro documentation states that "BPF_ADD | BPF_FETCH"
should be the same as atomic_fetch_add(), which is currently not the
case on s390x: the synchronization instruction "bcr 14,0" is missing.
This should not be a problem in practice, because s390x is allowed to
reorder only stores with subsequent fetches from different addresses.
Still, just to be on the safe side, and also for consistency, emit the
synchronization instruction.
Note that it's not required to do this for BPF_XCHG and BPF_CMPXCHG,
because COMPARE AND SWAP performs serialization itself.
Fixes: ba3b86b ("s390/bpf: Implement new atomic ops")
Reported-by: Puranjay Mohan <[email protected]>
Closes: https://lore.kernel.org/bpf/[email protected]/
Signed-off-by: Ilya Leoshkevich <[email protected]>1 parent 459d932 commit 87908ef
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1427 | 1427 | | |
1428 | 1428 | | |
1429 | 1429 | | |
| 1430 | + | |
| 1431 | + | |
1430 | 1432 | | |
1431 | 1433 | | |
1432 | 1434 | | |
| |||
0 commit comments