Commit f705ec76 authored by Jiri Olsa's avatar Jiri Olsa Committed by Daniel Borkmann

Revert "bpf: Add support to inline bpf_get_func_ip helper on x86"

This reverts commit 97ee4d20.

Following change is adding more complexity to bpf_get_func_ip
helper for kprobe_multi programs, which can't be inlined easily.
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220321070113.1449167-2-jolsa@kernel.org
parent 583669ab
......@@ -13698,7 +13698,7 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
continue;
}
/* Implement tracing bpf_get_func_ip inline. */
/* Implement bpf_get_func_ip inline. */
if (prog_type == BPF_PROG_TYPE_TRACING &&
insn->imm == BPF_FUNC_get_func_ip) {
/* Load IP address from ctx - 16 */
......@@ -13713,25 +13713,6 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
continue;
}
#ifdef CONFIG_X86
/* Implement kprobe_multi bpf_get_func_ip inline. */
if (prog_type == BPF_PROG_TYPE_KPROBE &&
eatype == BPF_TRACE_KPROBE_MULTI &&
insn->imm == BPF_FUNC_get_func_ip) {
/* Load IP address from ctx (struct pt_regs) ip */
insn_buf[0] = BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_1,
offsetof(struct pt_regs, ip));
new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, 1);
if (!new_prog)
return -ENOMEM;
env->prog = prog = new_prog;
insn = new_prog->insnsi + i + delta;
continue;
}
#endif
patch_call_imm:
fn = env->ops->get_func_proto(insn->imm, env->prog);
/* all functions that have prototype and verifier allowed
......
......@@ -1042,7 +1042,6 @@ static const struct bpf_func_proto bpf_get_func_ip_proto_kprobe = {
BPF_CALL_1(bpf_get_func_ip_kprobe_multi, struct pt_regs *, regs)
{
/* This helper call is inlined by verifier on x86. */
return instruction_pointer(regs);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment