summaryrefslogtreecommitdiffstats
path: root/tools/include/uapi
diff options
context:
space:
mode:
authorDaniel Borkmann2019-04-09 23:20:09 +0200
committerAlexei Starovoitov2019-04-10 02:05:46 +0200
commit1dc92851849cc2235a1efef8f8d5a9255efc5f13 (patch)
tree9e1de91732e04a14dfcf5cec8398c257a1f7ff27 /tools/include/uapi
parentbpf: add specification for BTF Var and DataSec kinds (diff)
downloadkernel-qcow2-linux-1dc92851849cc2235a1efef8f8d5a9255efc5f13.tar.gz
kernel-qcow2-linux-1dc92851849cc2235a1efef8f8d5a9255efc5f13.tar.xz
kernel-qcow2-linux-1dc92851849cc2235a1efef8f8d5a9255efc5f13.zip
bpf: kernel side support for BTF Var and DataSec
This work adds kernel-side verification, logging and seq_show dumping of BTF Var and DataSec kinds which are emitted with latest LLVM. The following constraints apply: BTF Var must have: - Its kind_flag is 0 - Its vlen is 0 - Must point to a valid type - Type must not resolve to a forward type - Size of underlying type must be > 0 - Must have a valid name - Can only be a source type, not sink or intermediate one - Name may include dots (e.g. in case of static variables inside functions) - Cannot be a member of a struct/union - Linkage so far can either only be static or global/allocated BTF DataSec must have: - Its kind_flag is 0 - Its vlen cannot be 0 - Its size cannot be 0 - Must have a valid name - Can only be a source type, not sink or intermediate one - Name may include dots (e.g. to represent .bss, .data, .rodata etc) - Cannot be a member of a struct/union - Inner btf_var_secinfo array with {type,offset,size} triple must be sorted by offset in ascending order - Type must always point to BTF Var - BTF resolved size of Var must be <= size provided by triple - DataSec size must be >= sum of triple sizes (thus holes are allowed) btf_var_resolve(), btf_ptr_resolve() and btf_modifier_resolve() are on a high level quite similar but each come with slight, subtle differences. They could potentially be a bit refactored in future which hasn't been done here to ease review. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/include/uapi')
0 files changed, 0 insertions, 0 deletions