summaryrefslogtreecommitdiff
path: root/lib/debugobjects.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2021-10-26 15:01:47 +0300
committerPeter Zijlstra <peterz@infradead.org>2021-10-29 00:25:29 +0300
commitdceba0817ca329868a15e2e1dd46eb6340b69206 (patch)
treedb2c78fdc514cad884fa8f21a2ce7a1abd7b76b4 /lib/debugobjects.c
parentf8a66d608a3e471e1202778c2a36cbdc96bae73b (diff)
downloadlinux-dceba0817ca329868a15e2e1dd46eb6340b69206.tar.xz
bpf,x86: Simplify computing label offsets
Take an idea from the 32bit JIT, which uses the multi-pass nature of the JIT to compute the instruction offsets on a prior pass in order to compute the relative jump offsets on a later pass. Application to the x86_64 JIT is slightly more involved because the offsets depend on program variables (such as callee_regs_used and stack_depth) and hence the computed offsets need to be kept in the context of the JIT. This removes, IMO quite fragile, code that hard-codes the offsets and tries to compute the length of variable parts of it. Convert both emit_bpf_tail_call_*() functions which have an out: label at the end. Additionally emit_bpt_tail_call_direct() also has a poke table entry, for which it computes the offset from the end (and thus already relies on the previous pass to have computed addrs[i]), also convert this to be a forward based offset. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Borislav Petkov <bp@suse.de> Acked-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Tested-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/r/20211026120310.552304864@infradead.org
Diffstat (limited to 'lib/debugobjects.c')
0 files changed, 0 insertions, 0 deletions