Lines Matching refs:insn_idx
193 int insn_idx;
3337 __u32 insn_idx, const char *sym_name,
3340 struct bpf_insn *insn = &prog->insns[insn_idx];
3369 reloc_desc->insn_idx = insn_idx;
3376 prog->name, sym_name, insn_idx, insn->code);
3396 prog->name, i, ext->name, ext->sym_idx, insn_idx);
3398 reloc_desc->insn_idx = insn_idx;
3427 map->sec_offset, insn_idx);
3436 reloc_desc->insn_idx = insn_idx;
3454 map->sec_offset, insn_idx);
3464 reloc_desc->insn_idx = insn_idx;
3470 static bool prog_contains_insn(const struct bpf_program *prog, size_t insn_idx)
3472 return insn_idx >= prog->sec_insn_off &&
3473 insn_idx < prog->sec_insn_off + prog->sec_insn_cnt;
3477 size_t sec_idx, size_t insn_idx)
3490 (prog->sec_idx == sec_idx && prog->sec_insn_off <= insn_idx))
3499 if (prog->sec_idx == sec_idx && prog_contains_insn(prog, insn_idx))
3514 __u32 insn_idx;
3543 insn_idx = rel.r_offset / BPF_INSN_SZ;
3557 relo_sec_name, i, insn_idx, sym_name);
3559 prog = find_prog_by_sec_insn(obj, sec_idx, insn_idx);
3562 relo_sec_name, i, sec_name, insn_idx);
3572 /* adjust insn_idx to local BPF program frame of reference */
3573 insn_idx -= prog->sec_insn_off;
3575 insn_idx, sym_name, &sym, &rel);
5412 int insn_idx, struct bpf_insn *insn)
5415 prog->name, relo_idx, insn_idx);
5478 int insn_idx;
5483 insn_idx = relo->insn_off / BPF_INSN_SZ;
5484 /* adjust insn_idx from section frame of reference to the local
5488 insn_idx = insn_idx - prog->sec_insn_off;
5489 insn = &prog->insns[insn_idx];
5498 bpf_core_poison_insn(prog, relo_idx, insn_idx + 1, insn + 1);
5499 bpf_core_poison_insn(prog, relo_idx, insn_idx, insn);
5514 insn_idx, insn->imm, orig_val, new_val);
5520 prog->name, relo_idx, insn_idx,
5528 prog->name, relo_idx, insn_idx, insn->off, orig_val, new_val);
5533 prog->name, relo_idx, insn_idx, new_val);
5539 prog->name, relo_idx, insn_idx);
5546 prog->name, relo_idx, insn_idx, orig_val, new_val);
5554 prog->name, relo_idx, insn_idx, insn_bytes_sz, res->orig_sz);
5561 prog->name, relo_idx, insn_idx, res->new_sz);
5567 prog->name, relo_idx, insn_idx, res->orig_sz, res->new_sz);
5575 insn_idx + 1 >= prog->insns_cnt ||
5579 prog->name, relo_idx, insn_idx);
5587 insn_idx, (unsigned long long)imm,
5595 prog->name, relo_idx, insn_idx,
5601 prog->name, relo_idx, insn_idx, insn->code,
5904 int i, err = 0, insn_idx, sec_idx;
5954 insn_idx = rec->insn_off / BPF_INSN_SZ;
5955 prog = find_prog_by_sec_insn(obj, sec_idx, insn_idx);
5966 sec_name, i, insn_idx);
6010 struct bpf_insn *insn = &prog->insns[relo->insn_idx];
6198 size_t insn_idx = *(const size_t *)key;
6201 if (insn_idx == relo->insn_idx)
6203 return insn_idx < relo->insn_idx ? -1 : 1;
6206 static struct reloc_desc *find_prog_insn_relo(const struct bpf_program *prog, size_t insn_idx)
6208 return bsearch(&insn_idx, prog->reloc_desc, prog->nr_reloc,
6216 size_t sub_insn_idx, insn_idx, new_cnt;
6226 for (insn_idx = 0; insn_idx < prog->sec_insn_cnt; insn_idx++) {
6227 insn = &main_prog->insns[prog->sub_insn_off + insn_idx];
6231 relo = find_prog_insn_relo(prog, insn_idx);
6234 prog->name, insn_idx, relo->type);
6253 sub_insn_idx = prog->sec_insn_off + insn_idx + insn->imm + 1;
6300 insn = &main_prog->insns[prog->sub_insn_off + insn_idx];
6306 insn->imm = subprog->sub_insn_off - (prog->sub_insn_off + insn_idx) - 1;
6312 prog->name, insn_idx, insn->imm, subprog->name, subprog->sub_insn_off);
6605 if (a->insn_idx != b->insn_idx)
6606 return a->insn_idx < b->insn_idx ? -1 : 1;
6608 /* no two relocations should have the same insn_idx, but ... */
8567 unsigned int moff, insn_idx;
8617 insn_idx = sym.st_value / BPF_INSN_SZ;
8634 prog = find_prog_by_sec_insn(obj, shdr_idx, insn_idx);