android_kernel_sony_sdm845/tools
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Daniel Borkmann dee4927b46 UPSTREAM: bpf: add BPF_J{LT,LE,SLT,SLE} instructions
Currently, eBPF only understands BPF_JGT (>), BPF_JGE (>=),
BPF_JSGT (s>), BPF_JSGE (s>=) instructions, this means that
particularly *JLT/*JLE counterparts involving immediates need
to be rewritten from e.g. X < [IMM] by swapping arguments into
[IMM] > X, meaning the immediate first is required to be loaded
into a register Y := [IMM], such that then we can compare with
Y > X. Note that the destination operand is always required to
be a register.

This has the downside of having unnecessarily increased register
pressure, meaning complex program would need to spill other
registers temporarily to stack in order to obtain an unused
register for the [IMM]. Loading to registers will thus also
affect state pruning since we need to account for that register
use and potentially those registers that had to be spilled/filled
again. As a consequence slightly more stack space might have
been used due to spilling, and BPF programs are a bit longer
due to extra code involving the register load and potentially
required spill/fills.

Thus, add BPF_JLT (<), BPF_JLE (<=), BPF_JSLT (s<), BPF_JSLE (s<=)
counterparts to the eBPF instruction set. Modifying LLVM to
remove the NegateCC() workaround in a PoC patch at [1] and
allowing it to also emit the new instructions resulted in
cilium's BPF programs that are injected into the fast-path to
have a reduced program length in the range of 2-3% (e.g.
accumulated main and tail call sections from one of the object
file reduced from 4864 to 4729 insns), reduced complexity in
the range of 10-30% (e.g. accumulated sections reduced in one
of the cases from 116432 to 88428 insns), and reduced stack
usage in the range of 1-5% (e.g. accumulated sections from one
of the object files reduced from 824 to 784b).

The modification for LLVM will be incorporated in a backwards
compatible way. Plan is for LLVM to have i) a target specific
option to offer a possibility to explicitly enable the extension
by the user (as we have with -m target specific extensions today
for various CPU insns), and ii) have the kernel checked for
presence of the extensions and enable them transparently when
the user is selecting more aggressive options such as -march=native
in a bpf target context. (Other frontends generating BPF byte
code, e.g. ply can probe the kernel directly for its code
generation.)

  [1] https://github.com/borkmann/llvm/tree/bpf-insns

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sorayukii <sorayukii69@gmail.com>
2026-05-15 17:55:05 +07:00
..
accounting This is the 4.9.219 stable release 2020-04-13 13:00:22 +02:00
arch x86/speculation: Rename RETPOLINE_AMD to RETPOLINE_LFENCE 2022-03-11 10:03:30 +01:00
build UPSTREAM: bpf: Add strict alignment flag for BPF_PROG_LOAD. 2026-05-15 17:54:40 +07:00
cgroup
firewire
gpio tools: gpio-hammer: Avoid potential overflow in main 2020-10-01 20:40:10 +02:00
hv Tools: hv: kvp: eliminate 'may be used uninitialized' warning 2019-09-10 10:31:02 +01:00
iio tools: iio: iio_utils: fix digit calculation 2022-11-03 23:49:16 +09:00
include UPSTREAM: bpf: add BPF_J{LT,LE,SLT,SLE} instructions 2026-05-15 17:55:05 +07:00
kvm/kvm_stat tweewide: Fix most Shebang lines 2021-06-03 08:23:27 +02:00
laptop
lguest
lib UPSTREAM: bpf: Add sparc support to tools and samples. 2026-05-15 17:54:37 +07:00
net
nfsd
objtool objtool: Don't fail on missing symbol table 2021-02-10 09:09:24 +01:00
pcmcia
perf cgroup: make perf_event controller work on cgroup2 hierarchy 2026-05-15 17:50:32 +07:00
power cpupower: avoid multiple definition with gcc -fno-common 2020-04-02 17:20:31 +02:00
scripts tools: Let O= makes handle a relative path with -C option 2020-04-02 17:20:36 +02:00
spi
testing BACKPORT: bpf: testing: fix devmap tests 2026-05-15 17:54:59 +07:00
thermal/tmon tools/thermal: tmon: fix for segfault 2018-05-30 07:50:43 +02:00
time
usb usb: testusb: Fix for showing the connection speed 2021-10-09 13:25:59 +02:00
virtio ptr_ring: fix up after recent ptr_ring changes 2018-11-10 07:42:50 -08:00
vm tools/vm/slabinfo-gnuplot: use "grep -E" instead of "egrep" 2022-12-08 11:15:41 +01:00
Makefile