mirror of
https://github.com/torvalds/linux.git
synced 2026-12-04 20:34:05 +00:00
bpf, docs: Move Clang notes to a separate file
Move Clang notes to a separate file. Signed-off-by: Dave Thaler <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
This commit is contained in:
committed by
Alexei Starovoitov
parent
9a0bf21337
commit
6c7aaffb24
@@ -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``.
|
||||
@@ -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
|
||||
-----------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user