From 3937a9e90d502451ef8555e1ed1eca08dd50da7b Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Thu, 10 Oct 2024 00:13:40 +0200 Subject: sys/linux: fix linkage field of BTF_KIND_VAR type The linkage field of BTF type BTF_KIND_VAR isn't actually a boolean, but a flag. Given it can now take three different values [1], it doesn't match the boolean type and needs to be fixed. This commit defines it as a proper flags type. 1 - https://docs.kernel.org/bpf/btf.html#btf-kind-var Signed-off-by: Paul Chaignon --- sys/linux/bpf.txt | 3 ++- sys/linux/bpf.txt.const | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/linux/bpf.txt b/sys/linux/bpf.txt index b373afbd1..9f856d70c 100644 --- a/sys/linux/bpf.txt +++ b/sys/linux/bpf.txt @@ -777,7 +777,7 @@ btf_type_var { info_pad const[0, int8] info_typ const[BTF_KIND_VAR, int8] type btf_type_id - linkage bool32 + linkage flags[btf_linkage_values, int32] } btf_type_datasec { @@ -841,3 +841,4 @@ nf_dev_hooks = NF_NETDEV_INGRESS, NF_NETDEV_EGRESS bpf_link_create_netfilter_flags = BPF_F_NETFILTER_IP_DEFRAG bpf_link_create_uprobe_multi_flags = BPF_F_UPROBE_MULTI_RETURN btf_load_flags = BPF_F_TOKEN_FD +btf_linkage_values = BTF_VAR_STATIC, BTF_VAR_GLOBAL_ALLOCATED, BTF_VAR_GLOBAL_EXTERN diff --git a/sys/linux/bpf.txt.const b/sys/linux/bpf.txt.const index 7b2885431..608d7bf3e 100644 --- a/sys/linux/bpf.txt.const +++ b/sys/linux/bpf.txt.const @@ -241,6 +241,9 @@ BTF_KIND_UNION = 5 BTF_KIND_VAR = 14 BTF_KIND_VOLATILE = 9 BTF_MAGIC = 60319 +BTF_VAR_GLOBAL_ALLOCATED = 1 +BTF_VAR_GLOBAL_EXTERN = 2 +BTF_VAR_STATIC = 0 BTF_VERSION = 1 EXP_CGROUP = 63 EXP_MAP = 39 -- cgit mrf-deployment