[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201218235614.2284956-1-andrii@kernel.org>
Date: Fri, 18 Dec 2020 15:56:11 -0800
From: Andrii Nakryiko <andrii@...nel.org>
To: <bpf@...r.kernel.org>, <netdev@...r.kernel.org>, <ast@...com>,
<daniel@...earbox.net>
CC: <andrii@...nel.org>, <kernel-team@...com>
Subject: [PATCH bpf-next 0/3] Add user-space and non-CO-RE variants of BPF_CORE_READ()
Add two sets of BPF_CORE_READ()-like macros. One is for reading kernel data
from user address space (e.g., UAPI data structs for syscalls). Another one is
non-CO-RE variants, which don't emit CO-RE relocations and thus won't fail on
kernels without BTF. The latter one still provides much shorter way to write
reads that needs to chase few pointers.
Andrii Nakryiko (3):
libbpf: add user-space variants of BPF_CORE_READ() family of macros
libbpf: add non-CO-RE variants of BPF_CORE_READ() macro family
selftests/bpf: add tests for user- and non-CO-RE BPF_CORE_READ()
variants
tools/lib/bpf/bpf_core_read.h | 136 +++++++++++++-----
.../bpf/prog_tests/core_read_macros.c | 64 +++++++++
.../bpf/progs/test_core_read_macros.c | 51 +++++++
3 files changed, 212 insertions(+), 39 deletions(-)
create mode 100644 tools/testing/selftests/bpf/prog_tests/core_read_macros.c
create mode 100644 tools/testing/selftests/bpf/progs/test_core_read_macros.c
--
2.24.1
Powered by blists - more mailing lists