From: Daniel Borkmann Date: Mon, 4 Nov 2019 15:06:56 +0000 (+0100) Subject: Merge branch 'bpf-libbpf-bitfield-size-relo' X-Git-Tag: v5.15~5092^2~49^2~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f23c7ce341c2dfd187d4e3712ba6c110969463a0;p=platform%2Fkernel%2Flinux-starfive.git Merge branch 'bpf-libbpf-bitfield-size-relo' Andrii Nakryiko says: ==================== This patch set adds support for reading bitfields in a relocatable manner through a set of relocations emitted by Clang, corresponding libbpf support for those relocations, as well as abstracting details into BPF_CORE_READ_BITFIELD/BPF_CORE_READ_BITFIELD_PROBED macro. We also add support for capturing relocatable field size, so that BPF program code can adjust its logic to actual amount of data it needs to operate on, even if it changes between kernels. New convenience macro is added to bpf_core_read.h (bpf_core_field_size(), in the same family of macro as bpf_core_read() and bpf_core_field_exists()). Corresponding set of selftests are added to excercise this logic and validate correctness in a variety of scenarios. Some of the overly strict logic of matching fields is relaxed to support wider variety of scenarios. See patch #1 for that. Patch #1 removes few overly strict test cases. Patch #2 adds support for bitfield-related relocations. Patch #3 adds some further adjustments to support generic field size relocations and introduces bpf_core_field_size() macro. Patch #4 tests bitfield reading. Patch #5 tests field size relocations. v1 -> v2: - added direct memory read-based macro and tests for bitfield reads. ==================== Signed-off-by: Daniel Borkmann --- f23c7ce341c2dfd187d4e3712ba6c110969463a0