Lines Matching refs:map
674 struct bpf_map *map = env->cur_state.regs[regno].map_ptr; in check_map_access() local
676 if (off < 0 || off + size > map->value_size) { in check_map_access()
678 map->value_size, off, size); in check_map_access()
953 static int check_map_func_compatibility(struct bpf_map *map, int func_id) in check_map_func_compatibility() argument
955 if (!map) in check_map_func_compatibility()
959 switch (map->map_type) { in check_map_func_compatibility()
976 if (map->map_type != BPF_MAP_TYPE_PROG_ARRAY) in check_map_func_compatibility()
981 if (map->map_type != BPF_MAP_TYPE_PERF_EVENT_ARRAY) in check_map_func_compatibility()
991 map->map_type, func_id); in check_map_func_compatibility()
1000 struct bpf_map *map = NULL; in check_call() local
1025 err = check_func_arg(env, BPF_REG_1, fn->arg1_type, &map); in check_call()
1028 err = check_func_arg(env, BPF_REG_2, fn->arg2_type, &map); in check_call()
1032 if (map == NULL) { in check_call()
1036 env->insn_aux_data[insn_idx].map_ptr = map; in check_call()
1038 err = check_func_arg(env, BPF_REG_3, fn->arg3_type, &map); in check_call()
1041 err = check_func_arg(env, BPF_REG_4, fn->arg4_type, &map); in check_call()
1044 err = check_func_arg(env, BPF_REG_5, fn->arg5_type, &map); in check_call()
1066 if (map == NULL) { in check_call()
1070 regs[BPF_REG_0].map_ptr = map; in check_call()
1077 err = check_map_func_compatibility(map, func_id); in check_call()
2084 struct bpf_map *map; in replace_map_fd_with_map_ptr() local
2104 map = __bpf_map_get(f); in replace_map_fd_with_map_ptr()
2105 if (IS_ERR(map)) { in replace_map_fd_with_map_ptr()
2108 return PTR_ERR(map); in replace_map_fd_with_map_ptr()
2112 insn[0].imm = (u32) (unsigned long) map; in replace_map_fd_with_map_ptr()
2113 insn[1].imm = ((u64) (unsigned long) map) >> 32; in replace_map_fd_with_map_ptr()
2117 if (env->used_maps[j] == map) { in replace_map_fd_with_map_ptr()
2132 map = bpf_map_inc(map, false); in replace_map_fd_with_map_ptr()
2133 if (IS_ERR(map)) { in replace_map_fd_with_map_ptr()
2135 return PTR_ERR(map); in replace_map_fd_with_map_ptr()
2137 env->used_maps[env->used_map_cnt++] = map; in replace_map_fd_with_map_ptr()
2375 map)->index_mask); in fixup_bpf_calls()