Re: [PATCH bpf-next v5 04/11] bpf: Rename BPF_XADD and prepare to encode other atomics in .imm

From: Björn Töpel
Date: Tue Dec 15 2020 - 09:07:08 EST


On Tue, 15 Dec 2020 at 13:25, Brendan Jackman <jackmanb@xxxxxxxxxx> wrote:
>
> A subsequent patch will add additional atomic operations. These new
> operations will use the same opcode field as the existing XADD, with
> the immediate discriminating different operations.
>
> In preparation, rename the instruction mode BPF_ATOMIC and start
> calling the zero immediate BPF_ADD.
>
> This is possible (doesn't break existing valid BPF progs) because the
> immediate field is currently reserved MBZ and BPF_ADD is zero.
>
> All uses are removed from the tree but the BPF_XADD definition is
> kept around to avoid breaking builds for people including kernel
> headers.
>
> Signed-off-by: Brendan Jackman <jackmanb@xxxxxxxxxx>
> ---
> Documentation/networking/filter.rst | 30 +++++++-----
> arch/arm/net/bpf_jit_32.c | 7 ++-
> arch/arm64/net/bpf_jit_comp.c | 16 +++++--
> arch/mips/net/ebpf_jit.c | 11 +++--
> arch/powerpc/net/bpf_jit_comp64.c | 25 ++++++++--
> arch/riscv/net/bpf_jit_comp32.c | 20 ++++++--
> arch/riscv/net/bpf_jit_comp64.c | 16 +++++--

For RISC-V:

Acked-by: Björn Töpel <bjorn.topel@xxxxxxxxx>