Lines Matching refs:u32
221 u32 cnt;
228 u32 *resolved_ids;
229 u32 *resolved_sizes;
233 u32 nr_types; /* includes VOID for base BTF */
234 u32 types_size;
235 u32 data_size;
237 u32 id;
244 u32 start_id; /* first type ID in this BTF (0 for base BTF) */
245 u32 start_str_off; /* first string offset (0 for base BTF) */
257 u32 type_id;
278 u32 off;
279 u32 len;
287 u32 log_type_id;
288 u32 top_stack;
392 u32 type_id;
399 u32 size;
409 u32 meta_left);
423 u32 type_id, void *data, u8 bits_offsets,
431 const struct btf_type *t, u32 type_id);
507 u32 btf_nr_types(const struct btf *btf) in btf_nr_types()
509 u32 total = 0; in btf_nr_types()
523 u32 i, total; in btf_find_by_name_kind()
539 static s32 bpf_find_btf_id(const char *name, u32 kind, struct btf **btf_p) in bpf_find_btf_id()
584 u32 id, u32 *res_id) in btf_type_skip_modifiers()
600 u32 id, u32 *res_id) in btf_type_resolve_ptr()
612 u32 id, u32 *res_id) in btf_type_resolve_func_ptr()
692 static u32 btf_type_int(const struct btf_type *t) in btf_type_int()
694 return *(u32 *)(t + 1); in btf_type_int()
727 static bool btf_name_offset_valid(const struct btf *btf, u32 offset) in btf_name_offset_valid()
749 static const char *btf_str_by_offset(const struct btf *btf, u32 offset) in btf_str_by_offset()
761 static bool __btf_name_valid(const struct btf *btf, u32 offset) in __btf_name_valid()
782 static bool btf_name_valid_identifier(const struct btf *btf, u32 offset) in btf_name_valid_identifier()
787 static bool btf_name_valid_section(const struct btf *btf, u32 offset) in btf_name_valid_section()
792 static const char *__btf_name_by_offset(const struct btf *btf, u32 offset) in __btf_name_by_offset()
803 const char *btf_name_by_offset(const struct btf *btf, u32 offset) in btf_name_by_offset()
808 const struct btf_type *btf_type_by_id(const struct btf *btf, u32 type_id) in btf_type_by_id()
827 u32 int_data; in btf_type_int_is_regular()
835 nr_bytes != sizeof(u32) && nr_bytes != sizeof(u64) && in btf_type_int_is_regular()
849 u32 expected_offset, u32 expected_size) in btf_member_is_reg_int()
852 u32 id, int_data; in btf_member_is_reg_int()
863 u32 bitfield_size = BTF_MEMBER_BITFIELD_SIZE(m->offset); in btf_member_is_reg_int()
864 u32 bit_offset = BTF_MEMBER_BIT_OFFSET(m->offset); in btf_member_is_reg_int()
886 u32 id) in btf_type_skip_qualifiers()
920 u32 id = show->state.type_id; in btf_show_name()
1272 u32 type_id, void *data) in btf_show_start_type()
1290 u32 type_id, void *data) in btf_show_start_aggr_type()
1338 u32 type_id, in btf_show_start_array_type()
1356 u32 type_id, in btf_show_start_struct_type()
1522 u32 btf_data_size) in btf_verifier_log_hdr()
1553 u32 expand_by, new_size; in btf_add_type()
1560 expand_by = max_t(u32, btf->types_size >> 2, 16); in btf_add_type()
1561 new_size = min_t(u32, BTF_MAX_TYPE, in btf_add_type()
1689 u32 nr_types = btf->nr_types; in env_resolve_init()
1690 u32 *resolved_sizes = NULL; in env_resolve_init()
1691 u32 *resolved_ids = NULL; in env_resolve_init()
1754 u32 type_id) in env_type_is_resolved()
1764 const struct btf_type *t, u32 type_id) in env_stack_push()
1800 u32 resolved_type_id, in env_stack_pop_resolved()
1801 u32 resolved_size) in env_stack_pop_resolved()
1803 u32 type_id = env->stack[--(env->top_stack)].type_id; in env_stack_pop_resolved()
1839 u32 *type_size, const struct btf_type **elem_type, in __btf_resolve_size()
1840 u32 *elem_id, u32 *total_nelems, u32 *type_id) in __btf_resolve_size()
1844 u32 i, size, nelems = 1, id = 0; in __btf_resolve_size()
1909 u32 *type_size) in btf_resolve_size()
1914 static u32 btf_resolved_type_id(const struct btf *btf, u32 type_id) in btf_resolved_type_id()
1924 u32 *type_id) in btf_type_id_resolve()
1930 static u32 btf_resolved_type_size(const struct btf *btf, u32 type_id) in btf_resolved_type_size()
1939 u32 *type_id, u32 *ret_size) in btf_type_id_size()
1942 u32 size_type_id = *type_id; in btf_type_id_size()
1943 u32 size = 0; in btf_type_id_size()
2031 u32 type_id, void *data, u8 bits_offsets, in btf_df_show()
2042 u32 int_data = btf_type_int(member_type); in btf_int_check_member()
2043 u32 struct_bits_off = member->offset; in btf_int_check_member()
2044 u32 struct_size = struct_type->size; in btf_int_check_member()
2045 u32 nr_copy_bits; in btf_int_check_member()
2046 u32 bytes_offset; in btf_int_check_member()
2080 u32 struct_bits_off, nr_bits, nr_int_data_bits, bytes_offset; in btf_int_check_kflag_member()
2081 u32 int_data = btf_type_int(member_type); in btf_int_check_kflag_member()
2082 u32 struct_size = struct_type->size; in btf_int_check_kflag_member()
2083 u32 nr_copy_bits; in btf_int_check_kflag_member()
2133 u32 meta_left) in btf_int_check_meta()
2135 u32 int_data, nr_bits, meta_needed = sizeof(int_data); in btf_int_check_meta()
2303 u32 int_data = btf_type_int(t); in btf_int_bits_show()
2318 u32 type_id, void *data, u8 bits_offset, in btf_int_show()
2321 u32 int_data = btf_type_int(t); in btf_int_show()
2351 btf_show_type_value(show, "%u", *(u32 *)safe_data); in btf_int_show()
2402 u32 resolved_type_id = member->type; in btf_modifier_check_member()
2427 u32 resolved_type_id = member->type; in btf_modifier_check_kflag_member()
2451 u32 struct_size, struct_bits_off, bytes_offset; in btf_ptr_check_member()
2474 u32 meta_left) in btf_ref_type_check_meta()
2525 u32 next_type_id = t->type; in btf_modifier_resolve()
2567 u32 next_type_id = t->type; in btf_var_resolve()
2582 u32 resolved_type_id; in btf_var_resolve()
2613 u32 next_type_id = t->type; in btf_ptr_resolve()
2636 u32 resolved_type_id; in btf_ptr_resolve()
2667 u32 type_id, void *data, in btf_modifier_show()
2679 u32 type_id, void *data, u8 bits_offset, in btf_var_show()
2688 u32 type_id, void *data, u8 bits_offset, in btf_ptr_show()
2731 u32 meta_left) in btf_fwd_check_meta()
2775 u32 struct_bits_off = member->offset; in btf_array_check_member()
2776 u32 struct_size, bytes_offset; in btf_array_check_member()
2777 u32 array_type_id, array_size; in btf_array_check_member()
2801 u32 meta_left) in btf_array_check_meta()
2804 u32 meta_needed = sizeof(*array); in btf_array_check_meta()
2857 u32 elem_type_id, index_type_id; in btf_array_resolve()
2859 u32 elem_size; in btf_array_resolve()
2927 u32 type_id, void *data, u8 bits_offset, in __btf_array_show()
2933 u32 i, elem_size = 0, elem_type_id; in __btf_array_show()
2942 u32 int_type = btf_type_int(elem_type); in __btf_array_show()
2980 u32 type_id, void *data, u8 bits_offset, in btf_array_show()
3026 u32 struct_bits_off = member->offset; in btf_struct_check_member()
3027 u32 struct_size, bytes_offset; in btf_struct_check_member()
3048 u32 meta_left) in btf_struct_check_meta()
3052 u32 meta_needed, last_offset; in btf_struct_check_meta()
3054 u32 struct_size = t->size; in btf_struct_check_meta()
3055 u32 offset; in btf_struct_check_meta()
3141 u32 last_member_type_id; in btf_struct_resolve()
3164 u32 member_type_id = member->type; in btf_struct_resolve()
3216 u32 type_id;
3217 u32 off;
3222 u32 off, int sz, struct btf_field_info *info) in btf_find_struct()
3233 u32 off, int sz, struct btf_field_info *info) in btf_find_kptr()
3236 u32 res_id; in btf_find_kptr()
3275 u32 i, off; in btf_find_struct_field()
3327 u32 i, off; in btf_find_datasec_var()
3536 u32 type_id, void *data, u8 bits_offset, in __btf_struct_show()
3541 u32 i; in __btf_struct_show()
3551 u32 member_offset, bitfield_size; in __btf_struct_show()
3552 u32 bytes_offset; in __btf_struct_show()
3583 u32 type_id, void *data, u8 bits_offset, in btf_struct_show()
3630 u32 struct_bits_off = member->offset; in btf_enum_check_member()
3631 u32 struct_size, bytes_offset; in btf_enum_check_member()
3655 u32 struct_bits_off, nr_bits, bytes_end, struct_size; in btf_enum_check_kflag_member()
3656 u32 int_bitsize = sizeof(int) * BITS_PER_BYTE; in btf_enum_check_kflag_member()
3687 u32 meta_left) in btf_enum_check_meta()
3693 u32 meta_needed; in btf_enum_check_meta()
3751 u32 type_id, void *data, u8 bits_offset, in btf_enum_show()
3755 u32 i, nr_enums = btf_type_vlen(t); in btf_enum_show()
3795 u32 meta_left) in btf_enum64_check_meta()
3801 u32 meta_needed; in btf_enum64_check_meta()
3854 u32 type_id, void *data, u8 bits_offset, in btf_enum64_show()
3858 u32 i, nr_enums = btf_type_vlen(t); in btf_enum64_show()
3898 u32 meta_left) in btf_func_proto_check_meta()
3900 u32 meta_needed = btf_type_vlen(t) * sizeof(struct btf_param); in btf_func_proto_check_meta()
3985 u32 meta_left) in btf_func_check_meta()
4012 u32 next_type_id = t->type; in btf_func_resolve()
4034 u32 meta_left) in btf_var_check_meta()
4037 u32 meta_needed = sizeof(*var); in btf_var_check_meta()
4098 u32 meta_left) in btf_datasec_check_meta()
4102 u32 i, meta_needed; in btf_datasec_check_meta()
4178 u32 var_type_id = vsi->type, type_id, type_size = 0; in btf_datasec_resolve()
4216 const struct btf_type *t, u32 type_id, in btf_datasec_show()
4222 u32 i; in btf_datasec_show()
4250 u32 meta_left) in btf_float_check_meta()
4325 u32 meta_left) in btf_decl_tag_check_meta()
4328 u32 meta_needed = sizeof(*tag); in btf_decl_tag_check_meta()
4371 u32 next_type_id = t->type; in btf_decl_tag_resolve()
4374 u32 vlen; in btf_decl_tag_resolve()
4401 if ((u32)component_idx >= vlen) { in btf_decl_tag_resolve()
4442 u32 ret_type_id = t->type; in btf_func_proto_check()
4485 u32 arg_type_id; in btf_func_proto_check()
4578 u32 meta_left) in btf_check_meta()
4580 u32 saved_meta_left = meta_left; in btf_check_meta()
4647 u32 type_id) in btf_resolve_valid()
4674 u32 elem_type_id = array->type; in btf_resolve_valid()
4675 u32 elem_size; in btf_resolve_valid()
4687 const struct btf_type *t, u32 type_id) in btf_resolve()
4689 u32 save_log_type_id = env->log_type_id; in btf_resolve()
4723 u32 type_id, i; in btf_check_all_types()
4759 if (hdr->type_off & (sizeof(u32) - 1)) { in btf_parse_type_sec()
4821 u32 btf_data_size) in btf_check_sec_info()
4824 u32 total, expected_total, i; in btf_check_sec_info()
4875 u32 hdr_len, hdr_copy, btf_data_size; in btf_parse_hdr()
4907 hdr_copy = min_t(u32, hdr_len, sizeof(btf->hdr)); in btf_parse_hdr()
4947 u32 cur_id = i; in btf_check_type_tags()
4984 static struct btf *btf_parse(bpfptr_t btf_data, u32 btf_data_size, in btf_parse()
4985 u32 log_level, char __user *log_ubuf, u32 log_size) in btf_parse()
5352 static u32 get_ctx_arg_idx(struct btf *btf, const struct btf_type *func_proto, in get_ctx_arg_idx()
5357 u32 offset = 0, nr_args; in get_ctx_arg_idx()
5391 u32 nr_args, arg; in btf_ctx_access()
5484 u32 type, flag; in btf_ctx_access()
5579 u32 *next_btf_id, enum bpf_type_flag *flag) in btf_struct_walk()
5581 u32 i, moff, mtrue_end, msize = 0, total_nelems = 0; in btf_struct_walk()
5585 u32 vlen, elem_id, mid; in btf_struct_walk()
5643 u32 end_bit = __btf_member_bit_offset(t, member) + in btf_struct_walk()
5696 u32 elem_idx; in btf_struct_walk()
5770 u32 id; in btf_struct_walk()
5821 u32 *next_btf_id, enum bpf_type_flag *flag) in btf_struct_access()
5825 u32 id; in btf_struct_access()
5866 static bool btf_types_are_same(const struct btf *btf1, u32 id1, in btf_types_are_same()
5867 const struct btf *btf2, u32 id2) in btf_types_are_same()
5877 const struct btf *btf, u32 id, int off, in btf_struct_ids_match()
5878 const struct btf *need_btf, u32 need_type_id, in btf_struct_ids_match()
5915 static int __get_type_size(struct btf *btf, u32 btf_id, in __get_type_size()
5946 u32 i, nargs; in btf_distill_func_proto()
6021 u32 nargs1, nargs2, i; in btf_check_func_type_match()
6131 u32 btf_id = 0; in btf_check_type_match()
6149 static u32 *reg2btf_ids[__BPF_REG_TYPE_MAX] = {
6164 u32 i; in __btf_type_is_scalar_struct()
6249 const struct btf *btf, u32 func_id, in btf_check_func_arg_match()
6259 u32 i, nargs, ref_id, ref_obj_id = 0; in btf_check_func_arg_match()
6303 u32 regno = i + 1; in btf_check_func_arg_match()
6449 u32 reg_ref_id; in btf_check_func_arg_match()
6482 u32 type_size; in btf_check_func_arg_match()
6604 u32 btf_id; in btf_check_subprog_arg_match()
6647 u32 btf_id; in btf_check_subprog_call()
6673 const struct btf *btf, u32 func_id, in btf_check_kfunc_arg_match()
6696 u32 i, nargs, btf_id; in btf_prepare_func_args()
6797 static void btf_type_show(const struct btf *btf, u32 type_id, void *obj, in btf_type_show()
6815 int btf_type_seq_show_flags(const struct btf *btf, u32 type_id, in btf_type_seq_show_flags()
6829 void btf_type_seq_show(const struct btf *btf, u32 type_id, void *obj, in btf_type_seq_show()
6865 int btf_type_snprintf_show(const struct btf *btf, u32 type_id, void *obj, in btf_type_snprintf_show()
6972 u32 info_copy, btf_copy; in btf_get_info_by_fd()
6975 u32 uinfo_len, uname_len, name_len; in btf_get_info_by_fd()
6981 info_copy = min_t(u32, uinfo_len, sizeof(info)); in btf_get_info_by_fd()
6988 btf_copy = min_t(u32, btf->data_size, info.btf_size); in btf_get_info_by_fd()
7026 int btf_get_fd_by_id(u32 id) in btf_get_fd_by_id()
7047 u32 btf_obj_id(const struct btf *btf) in btf_obj_id()
7069 bool btf_id_set_contains(const struct btf_id_set *set, u32 id) in btf_id_set_contains()
7071 return bsearch(&id, set->ids, set->cnt, sizeof(u32), btf_id_cmp_func) != NULL; in btf_id_set_contains()
7074 static void *btf_id_set8_contains(const struct btf_id_set8 *set, u32 id) in btf_id_set8_contains()
7287 BPF_CALL_4(bpf_btf_find_by_name_kind, char *, name, int, name_sz, u32, kind, int, flags) in BPF_CALL_4() argument
7336 u32 set_cnt; in BTF_ID_LIST_GLOBAL()
7418 static u32 *__btf_kfunc_id_set_contains(const struct btf *btf, in __btf_kfunc_id_set_contains()
7420 u32 kfunc_btf_id) in __btf_kfunc_id_set_contains()
7423 u32 *id; in __btf_kfunc_id_set_contains()
7465 u32 *btf_kfunc_id_set_contains(const struct btf *btf, in btf_kfunc_id_set_contains()
7467 u32 kfunc_btf_id) in btf_kfunc_id_set_contains()
7503 s32 btf_find_dtor_kfunc(struct btf *btf, u32 btf_id) in btf_find_dtor_kfunc()
7520 static int btf_check_dtor_kfuncs(struct btf *btf, const struct btf_id_dtor_kfunc *dtors, u32 cnt) in btf_check_dtor_kfuncs()
7525 u32 nr_args, i; in btf_check_dtor_kfuncs()
7558 int register_btf_id_dtor_kfuncs(const struct btf_id_dtor_kfunc *dtors, u32 add_cnt, in register_btf_id_dtor_kfuncs()
7563 u32 tab_cnt; in register_btf_id_dtor_kfuncs()
7665 int bpf_core_types_match(const struct btf *local_btf, u32 local_id, in bpf_core_types_match()
7666 const struct btf *targ_btf, u32 targ_id) in bpf_core_types_match()
7694 u32 name_len;
7699 u32 id;
7757 static u32 hash_cands(struct bpf_cand_cache *cands) in hash_cands()
7898 bpf_core_find_cands(struct bpf_core_ctx *ctx, u32 local_type_id) in bpf_core_find_cands()