On Fri, May 7, 2021 at 8:48 PM Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote: > > From: Alexei Starovoitov <ast@xxxxxxxxxx> > > Typical program loading sequence involves creating bpf maps and applying > map FDs into bpf instructions in various places in the bpf program. > This job is done by libbpf that is using compiler generated ELF relocations > to patch certain instruction after maps are created and BTFs are loaded. > The goal of fd_idx is to allow bpf instructions to stay immutable > after compilation. At load time the libbpf would still create maps as usual, > but it wouldn't need to patch instructions. It would store map_fds into > __u32 fd_array[] and would pass that pointer to sys_bpf(BPF_PROG_LOAD). > > Signed-off-by: Alexei Starovoitov <ast@xxxxxxxxxx> > --- Acked-by: Andrii Nakryiko <andrii@xxxxxxxxxx> > include/linux/bpf_verifier.h | 1 + > include/uapi/linux/bpf.h | 16 ++++++++---- > kernel/bpf/syscall.c | 2 +- > kernel/bpf/verifier.c | 47 ++++++++++++++++++++++++++-------- > tools/include/uapi/linux/bpf.h | 16 ++++++++---- > 5 files changed, 61 insertions(+), 21 deletions(-) > [...]