Lines Matching refs:relo
264 const struct bpf_core_relo *relo, in bpf_core_parse_spec() argument
274 spec_str = btf__name_by_offset(btf, relo->access_str_off); in bpf_core_parse_spec()
280 spec->root_type_id = relo->type_id; in bpf_core_parse_spec()
281 spec->relo_kind = relo->kind; in bpf_core_parse_spec()
284 if (core_relo_is_type_based(relo->kind)) { in bpf_core_parse_spec()
305 t = skip_mods_and_typedefs(btf, relo->type_id, &id); in bpf_core_parse_spec()
315 if (core_relo_is_enumval_based(relo->kind)) { in bpf_core_parse_spec()
326 if (!core_relo_is_field_based(relo->kind)) in bpf_core_parse_spec()
387 prog_name, relo->type_id, spec_str, i, id, btf_kind_str(t)); in bpf_core_parse_spec()
679 const struct bpf_core_relo *relo, in bpf_core_calc_field_relo() argument
694 if (relo->kind == BPF_CORE_FIELD_EXISTS) { in bpf_core_calc_field_relo()
707 if (relo->kind == BPF_CORE_FIELD_BYTE_OFFSET) { in bpf_core_calc_field_relo()
715 } else if (relo->kind == BPF_CORE_FIELD_BYTE_SIZE) { in bpf_core_calc_field_relo()
722 prog_name, relo->kind, relo->insn_off / 8); in bpf_core_calc_field_relo()
744 prog_name, relo->kind, relo->insn_off / 8); in bpf_core_calc_field_relo()
766 switch (relo->kind) { in bpf_core_calc_field_relo()
803 static int bpf_core_calc_type_relo(const struct bpf_core_relo *relo, in bpf_core_calc_type_relo() argument
819 switch (relo->kind) { in bpf_core_calc_type_relo()
847 static int bpf_core_calc_enumval_relo(const struct bpf_core_relo *relo, in bpf_core_calc_enumval_relo() argument
853 switch (relo->kind) { in bpf_core_calc_enumval_relo()
880 const struct bpf_core_relo *relo, in bpf_core_calc_relo() argument
896 if (core_relo_is_field_based(relo->kind)) { in bpf_core_calc_relo()
897 err = bpf_core_calc_field_relo(prog_name, relo, local_spec, in bpf_core_calc_relo()
900 err = err ?: bpf_core_calc_field_relo(prog_name, relo, targ_spec, in bpf_core_calc_relo()
942 } else if (core_relo_is_type_based(relo->kind)) { in bpf_core_calc_relo()
943 err = bpf_core_calc_type_relo(relo, local_spec, &res->orig_val, &res->validate); in bpf_core_calc_relo()
944 err = err ?: bpf_core_calc_type_relo(relo, targ_spec, &res->new_val, NULL); in bpf_core_calc_relo()
945 } else if (core_relo_is_enumval_based(relo->kind)) { in bpf_core_calc_relo()
946 err = bpf_core_calc_enumval_relo(relo, local_spec, &res->orig_val); in bpf_core_calc_relo()
947 err = err ?: bpf_core_calc_enumval_relo(relo, targ_spec, &res->new_val); in bpf_core_calc_relo()
958 prog_name, relo_idx, core_relo_kind_str(relo->kind), in bpf_core_calc_relo()
959 relo->kind, relo->insn_off / 8); in bpf_core_calc_relo()
1025 int insn_idx, const struct bpf_core_relo *relo, in bpf_core_patch_insn() argument
1281 const struct bpf_core_relo *relo, in bpf_core_calc_relo_insn() argument
1298 local_id = relo->type_id; in bpf_core_calc_relo_insn()
1304 err = bpf_core_parse_spec(prog_name, local_btf, relo, local_spec); in bpf_core_calc_relo_insn()
1308 spec_str = btf__name_by_offset(local_btf, relo->access_str_off); in bpf_core_calc_relo_insn()
1320 if (relo->kind == BPF_CORE_TYPE_ID_LOCAL) { in bpf_core_calc_relo_insn()
1333 prog_name, relo_idx, core_relo_kind_str(relo->kind), relo->kind); in bpf_core_calc_relo_insn()
1354 err = bpf_core_calc_relo(prog_name, relo, relo_idx, local_spec, cand_spec, &cand_res); in bpf_core_calc_relo_insn()
1414 err = bpf_core_calc_relo(prog_name, relo, relo_idx, local_spec, NULL, targ_res); in bpf_core_calc_relo_insn()