aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/bpf/arraymap.c
diff options
context:
space:
mode:
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>2020-09-16 23:10:05 +0200
committerAlexei Starovoitov <ast@kernel.org>2020-09-17 12:59:31 -0700
commita748c6975dea325da540610c2ba9b5f332c603e6 (patch)
tree9d380f6dab08bd114fb3a6328a16fc407e9d16c2 /kernel/bpf/arraymap.c
parentbpf, x64: use %rcx instead of %rax for tail call retpolines (diff)
downloadlinux-dev-a748c6975dea325da540610c2ba9b5f332c603e6.tar.xz
linux-dev-a748c6975dea325da540610c2ba9b5f332c603e6.zip
bpf: propagate poke descriptors to subprograms
Previously, there was no need for poke descriptors being present in subprogram's bpf_prog_aux struct since tailcalls were simply not allowed in them. Each subprog is JITed independently so in order to enable JITing subprograms that use tailcalls, do the following: - in fixup_bpf_calls() store the index of tailcall insn onto the generated poke descriptor, - in case when insn patching occurs, adjust the tailcall insn idx from bpf_patch_insn_data, - then in jit_subprogs() check whether the given poke descriptor belongs to the current subprog by checking if that previously stored absolute index of tail call insn is in the scope of the insns of given subprog, - update the insn->imm with new poke descriptor slot so that while JITing the proper poke descriptor will be grabbed This way each of the main program's poke descriptors are distributed across the subprograms poke descriptor array, so main program's descriptors can be untracked out of the prog array map. Add also subprog's aux struct to the BPF map poke_progs list by calling on it map_poke_track(). In case of any error, call the map_poke_untrack() on subprog's aux structs that have already been registered to prog array map. Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/bpf/arraymap.c')
0 files changed, 0 insertions, 0 deletions