aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/bpf/syscall.c
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2017-07-01 20:13:28 -0400
committerDavid S. Miller <davem@davemloft.net>2017-07-03 05:22:52 -0400
commit9780c0ab1a4e64ef6998c4d83f9df5be806a02dc (patch)
tree168d31b1e9d40945fb859b2de1950cc4d2c6851f /kernel/bpf/syscall.c
parentf96da09473b52c09125cc9bf7d7d4576ae8229e0 (diff)
bpf: export whether tail call has jited owner
We do export through fdinfo already whether a prog is JITed or not, given a program load can fail in case of either prog or tail call map has JITed property, but neither both are JITed or not JITed, we can facilitate error reporting in loaders like iproute2 through exporting owner_jited of tail call map. We already do export owner_prog_type through this facility, so parser can pick up both for comparison. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: John Fastabend <john.fastabend@gmail.com> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/bpf/syscall.c')
-rw-r--r--kernel/bpf/syscall.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index d4d47de75bba..18980472f5b0 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -216,10 +216,12 @@ static void bpf_map_show_fdinfo(struct seq_file *m, struct file *filp)
216 const struct bpf_map *map = filp->private_data; 216 const struct bpf_map *map = filp->private_data;
217 const struct bpf_array *array; 217 const struct bpf_array *array;
218 u32 owner_prog_type = 0; 218 u32 owner_prog_type = 0;
219 u32 owner_jited = 0;
219 220
220 if (map->map_type == BPF_MAP_TYPE_PROG_ARRAY) { 221 if (map->map_type == BPF_MAP_TYPE_PROG_ARRAY) {
221 array = container_of(map, struct bpf_array, map); 222 array = container_of(map, struct bpf_array, map);
222 owner_prog_type = array->owner_prog_type; 223 owner_prog_type = array->owner_prog_type;
224 owner_jited = array->owner_jited;
223 } 225 }
224 226
225 seq_printf(m, 227 seq_printf(m,
@@ -236,9 +238,12 @@ static void bpf_map_show_fdinfo(struct seq_file *m, struct file *filp)
236 map->map_flags, 238 map->map_flags,
237 map->pages * 1ULL << PAGE_SHIFT); 239 map->pages * 1ULL << PAGE_SHIFT);
238 240
239 if (owner_prog_type) 241 if (owner_prog_type) {
240 seq_printf(m, "owner_prog_type:\t%u\n", 242 seq_printf(m, "owner_prog_type:\t%u\n",
241 owner_prog_type); 243 owner_prog_type);
244 seq_printf(m, "owner_jited:\t%u\n",
245 owner_jited);
246 }
242} 247}
243#endif 248#endif
244 249