Lines Matching defs:relo

264 			const struct bpf_core_relo *relo,
274 spec_str = btf__name_by_offset(btf, relo->access_str_off);
280 spec->root_type_id = relo->type_id;
281 spec->relo_kind = relo->kind;
284 if (core_relo_is_type_based(relo->kind)) {
305 t = skip_mods_and_typedefs(btf, relo->type_id, &id);
315 if (core_relo_is_enumval_based(relo->kind)) {
326 if (!core_relo_is_field_based(relo->kind))
386 pr_warn("prog '%s': relo for [%u] %s (at idx %d) captures type [%d] of unexpected kind %s\n",
387 prog_name, relo->type_id, spec_str, i, id, btf_kind_str(t));
679 const struct bpf_core_relo *relo,
694 if (relo->kind == BPF_CORE_FIELD_EXISTS) {
707 if (relo->kind == BPF_CORE_FIELD_BYTE_OFFSET) {
715 } else if (relo->kind == BPF_CORE_FIELD_BYTE_SIZE) {
721 pr_warn("prog '%s': relo %d at insn #%d can't be applied to array access\n",
722 prog_name, relo->kind, relo->insn_off / 8);
743 pr_warn("prog '%s': relo %d at insn #%d can't be satisfied for bitfield\n",
744 prog_name, relo->kind, relo->insn_off / 8);
766 switch (relo->kind) {
803 static int bpf_core_calc_type_relo(const struct bpf_core_relo *relo,
819 switch (relo->kind) {
847 static int bpf_core_calc_enumval_relo(const struct bpf_core_relo *relo,
853 switch (relo->kind) {
880 const struct bpf_core_relo *relo,
896 if (core_relo_is_field_based(relo->kind)) {
897 err = bpf_core_calc_field_relo(prog_name, relo, local_spec,
900 err = err ?: bpf_core_calc_field_relo(prog_name, relo, targ_spec,
942 } else if (core_relo_is_type_based(relo->kind)) {
943 err = bpf_core_calc_type_relo(relo, local_spec, &res->orig_val, &res->validate);
944 err = err ?: bpf_core_calc_type_relo(relo, targ_spec, &res->new_val, NULL);
945 } else if (core_relo_is_enumval_based(relo->kind)) {
946 err = bpf_core_calc_enumval_relo(relo, local_spec, &res->orig_val);
947 err = err ?: bpf_core_calc_enumval_relo(relo, targ_spec, &res->new_val);
957 pr_warn("prog '%s': relo #%d: unrecognized CO-RE relocation %s (%d) at insn #%d\n",
958 prog_name, relo_idx, core_relo_kind_str(relo->kind),
959 relo->kind, relo->insn_off / 8);
972 pr_debug("prog '%s': relo #%d: substituting insn #%d w/ invalid insn\n",
982 insn->imm = 195896080; /* => 0xbad2310 => "bad relo" */
1025 int insn_idx, const struct bpf_core_relo *relo,
1053 pr_warn("prog '%s': relo #%d: unexpected insn #%d (ALU/ALU64) value: got %u, exp %llu -> %llu\n",
1061 pr_debug("prog '%s': relo #%d: patched insn #%d (ALU/ALU64) imm %llu -> %llu\n",
1069 pr_warn("prog '%s': relo #%d: unexpected insn #%d (LDX/ST/STX) value: got %u, exp %llu -> %llu\n",
1075 pr_warn("prog '%s': relo #%d: insn #%d (LDX/ST/STX) value too big: %llu\n",
1080 pr_warn("prog '%s': relo #%d: insn #%d (LDX/ST/STX) accesses field incorrectly. "
1088 pr_debug("prog '%s': relo #%d: patched insn #%d (LDX/ST/STX) off %llu -> %llu\n",
1097 pr_warn("prog '%s': relo #%d: insn #%d (LDX/ST/STX) unexpected mem size: got %d, exp %u\n",
1104 pr_warn("prog '%s': relo #%d: insn #%d (LDX/ST/STX) invalid new mem size: %u\n",
1110 pr_debug("prog '%s': relo #%d: patched insn #%d (LDX/ST/STX) mem_sz %u -> %u\n",
1121 pr_warn("prog '%s': relo #%d: insn #%d (LDIMM64) has unexpected form\n",
1128 pr_warn("prog '%s': relo #%d: unexpected insn #%d (LDIMM64) value: got %llu, exp %llu -> %llu\n",
1137 pr_debug("prog '%s': relo #%d: patched insn #%d (LDIMM64) imm64 %llu -> %llu\n",
1143 pr_warn("prog '%s': relo #%d: trying to relocate unrecognized insn #%d, code:0x%x, src:0x%x, dst:0x%x, off:0x%x, imm:0x%x\n",
1281 const struct bpf_core_relo *relo,
1298 local_id = relo->type_id;
1304 err = bpf_core_parse_spec(prog_name, local_btf, relo, local_spec);
1308 spec_str = btf__name_by_offset(local_btf, relo->access_str_off);
1309 pr_warn("prog '%s': relo #%d: parsing [%d] %s %s + %s failed: %d\n",
1317 pr_debug("prog '%s': relo #%d: %s\n", prog_name, relo_idx, spec_buf);
1319 /* TYPE_ID_LOCAL relo is special and doesn't need candidate search */
1320 if (relo->kind == BPF_CORE_TYPE_ID_LOCAL) {
1332 pr_warn("prog '%s': relo #%d: <%s> (%d) relocation doesn't support anonymous types\n",
1333 prog_name, relo_idx, core_relo_kind_str(relo->kind), relo->kind);
1342 pr_warn("prog '%s': relo #%d: error matching candidate #%d %s: %d\n ",
1348 pr_debug("prog '%s': relo #%d: %s candidate #%d %s\n", prog_name,
1354 err = bpf_core_calc_relo(prog_name, relo, relo_idx, local_spec, cand_spec, &cand_res);
1362 /* if there are many field relo candidates, they
1365 pr_warn("prog '%s': relo #%d: field offset ambiguity: %u != %u\n",
1375 pr_warn("prog '%s': relo #%d: relocation decision ambiguity: %s %llu != %s %llu\n",
1388 * For BPF_CORE_FIELD_EXISTS relo or when used BPF program has field
1393 * depending on relo's kind.
1410 pr_debug("prog '%s': relo #%d: no matching targets found\n",
1413 /* calculate single target relo result explicitly */
1414 err = bpf_core_calc_relo(prog_name, relo, relo_idx, local_spec, NULL, targ_res);