diff options
| author | Hari Bathini <[email protected]> | 2022-06-10 21:25:50 +0530 |
|---|---|---|
| committer | Michael Ellerman <[email protected]> | 2022-06-29 19:37:08 +1000 |
| commit | 1e82dfaa7819f03f0b0022be7ca15bbc83090da1 (patch) | |
| tree | 37f5857b32825463b5deb8ca7875339d9dfe9412 /tools/perf/scripts/python | |
| parent | dbe6e2456fb0263a5a961a92836d2cebdbca979c (diff) | |
powerpc/bpf/64: Add instructions for atomic_[cmp]xchg
This adds two atomic opcodes BPF_XCHG and BPF_CMPXCHG on ppc64, both
of which include the BPF_FETCH flag. The kernel's atomic_cmpxchg
operation fundamentally has 3 operands, but we only have two register
fields. Therefore the operand we compare against (the kernel's API
calls it 'old') is hard-coded to be BPF_REG_R0. Also, kernel's
atomic_cmpxchg returns the previous value at dst_reg + off. JIT the
same for BPF too with return value put in BPF_REG_0.
BPF_REG_R0 = atomic_cmpxchg(dst_reg + off, BPF_REG_R0, src_reg);
Signed-off-by: Hari Bathini <[email protected]>
Tested-by: Naveen N. Rao <[email protected]> (ppc64le)
Reviewed-by: Naveen N. Rao <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions