diff options
author | Alexei Starovoitov <ast@kernel.org> | 2020-10-08 04:50:27 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-10-08 04:59:40 +0300 |
commit | 1e9259eca8fdf04b8d12ec093711a73cde19aed5 (patch) | |
tree | 52172b5918a4b75107c00ecc8d4a9cd9943e9553 /tools/testing/selftests/bpf/progs/connect4_prog.c | |
parent | 80348d8867c65e2c64ca78d82326e889550a24b6 (diff) | |
parent | 888d83b961f6057aa377065b60c5206fd8bff97c (diff) | |
download | linux-1e9259eca8fdf04b8d12ec093711a73cde19aed5.tar.xz |
Merge branch 'libbpf: auto-resize relocatable LOAD/STORE instructions'
Andrii Nakryiko says:
====================
Patch set implements logic in libbpf to auto-adjust memory size (1-, 2-, 4-,
8-bytes) of load/store (LD/ST/STX) instructions which have BPF CO-RE field
offset relocation associated with it. In practice this means transparent
handling of 32-bit kernels, both pointer and unsigned integers. Signed
integers are not relocatable with zero-extending loads/stores, so libbpf
poisons them and generates a warning. If/when BPF gets support for
sign-extending loads/stores, it would be possible to automatically relocate
them as well.
All the details are contained in patch #2 comments and commit message.
Patch #3 is a simple change in libbpf to make advanced testing with custom BTF
easier. Patch #4 validates correct uses of auto-resizable loads, as well as
check that libbpf fails invalid uses. Patch #1 skips CO-RE relocation for
programs that had bpf_program__set_autoload(prog, false) set on them, reducing
warnings and noise.
v2->v3:
- fix copyright (Alexei);
v1->v2:
- more consistent names for instruction mem size convertion routines (Alexei);
- extended selftests to use relocatable STX instructions (Alexei);
- added a fix for skipping CO-RE relocation for non-loadable programs.
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Tony Ambardar <tony.ambardar@gmail.com>
====================
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/connect4_prog.c')
0 files changed, 0 insertions, 0 deletions