diff options
author | Dave Thaler <dthaler@microsoft.com> | 2022-09-27 20:59:46 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-09-30 22:41:13 +0200 |
commit | 6c7aaffb24efbd5d1ae067b2b629b3ffcc37e18e (patch) | |
tree | 20036a755328a576149c31295c1604cc980a221b /Documentation/bpf | |
parent | bpf, docs: Linux byteswap note (diff) | |
download | linux-6c7aaffb24efbd5d1ae067b2b629b3ffcc37e18e.tar.xz linux-6c7aaffb24efbd5d1ae067b2b629b3ffcc37e18e.zip |
bpf, docs: Move Clang notes to a separate file
Move Clang notes to a separate file.
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Link: https://lore.kernel.org/r/20220927185958.14995-3-dthaler1968@googlemail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'Documentation/bpf')
-rw-r--r-- | Documentation/bpf/clang-notes.rst | 24 | ||||
-rw-r--r-- | Documentation/bpf/instruction-set.rst | 6 |
2 files changed, 24 insertions, 6 deletions
diff --git a/Documentation/bpf/clang-notes.rst b/Documentation/bpf/clang-notes.rst new file mode 100644 index 000000000000..b15179cb5117 --- /dev/null +++ b/Documentation/bpf/clang-notes.rst @@ -0,0 +1,24 @@ +.. contents:: +.. sectnum:: + +========================== +Clang implementation notes +========================== + +This document provides more details specific to the Clang/LLVM implementation of the eBPF instruction set. + +Versions +======== + +Clang defined "CPU" versions, where a CPU version of 3 corresponds to the current eBPF ISA. + +Clang can select the eBPF ISA version using ``-mcpu=v3`` for example to select version 3. + +Atomic operations +================= + +Clang can generate atomic instructions by default when ``-mcpu=v3`` is +enabled. If a lower version for ``-mcpu`` is set, the only atomic instruction +Clang can generate is ``BPF_ADD`` *without* ``BPF_FETCH``. If you need to enable +the atomics features, while keeping a lower ``-mcpu`` version, you can use +``-Xclang -target-feature -Xclang +alu32``. diff --git a/Documentation/bpf/instruction-set.rst b/Documentation/bpf/instruction-set.rst index 1735b91ec4c7..541483118f65 100644 --- a/Documentation/bpf/instruction-set.rst +++ b/Documentation/bpf/instruction-set.rst @@ -303,12 +303,6 @@ The ``BPF_CMPXCHG`` operation atomically compares the value addressed by value that was at ``dst_reg + off`` before the operation is zero-extended and loaded back to ``R0``. -Clang can generate atomic instructions by default when ``-mcpu=v3`` is -enabled. If a lower version for ``-mcpu`` is set, the only atomic instruction -Clang can generate is ``BPF_ADD`` *without* ``BPF_FETCH``. If you need to enable -the atomics features, while keeping a lower ``-mcpu`` version, you can use -``-Xclang -target-feature -Xclang +alu32``. - 64-bit immediate instructions ----------------------------- |