函数逻辑报告 |
Source Code:kernel\bpf\verifier.c |
Create Date:2022-07-27 14:19:49 |
| Last Modify:2022-05-19 20:02:10 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:jit_subprogs
函数原型:static int jit_subprogs(struct bpf_verifier_env *env)
返回类型:int
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| struct bpf_verifier_env * | env |
| 8929 | subprog_end等于0 |
| 8934 | 如果subprog_cnt小于等于1则返回:0 |
| 8937 | 以i小于 Number of filter blocks 循环 |
| 8938 | 如果 opcode 不等于BPF_JMP按位或unction call 的值或 source register 不等于when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative* offset to another bpf function则继续下一循环 |
| 8945 | subprog等于find_subprog(env, i + signed immediate constant + 1) |
| 8946 | 如果subprog小于0则 |
| 8947 | WARN_ONCE(1, "verifier bug. No program starts at insn %d\n", i + signed immediate constant + 1) |
| 8949 | 返回:负EFAULT |
| 8954 | signed offset 等于subprog |
| 8960 | signed immediate constant 等于1 |
| 8963 | err等于bpf_prog_alloc_jited_linfo(prog) |
| 8964 | 如果err则转到:out_undo_insn |
| 8969 | 如果非func则转到:out_undo_insn |
| 8972 | 以i小于subprog_cnt循环 |
| 8973 | subprog_start等于subprog_end |
| 8976 | len等于subprog_end减subprog_start |
| 8982 | func[i]等于bpf_prog_alloc_no_stats(bpf_prog_size(len), GFP_USER) |
| 8988 | Number of filter blocks 等于len |
| 8989 | 如果bpf_prog_calc_tag(func[i])则转到:out_free |
| 8991 | program is a bpf function 等于1 |
| 9000 | name[0]等于'F' |
| 9002 | archs need to JIT the prog 等于1 |
| 9006 | subprog can use linfo_idx to access its first linfo and * jited_linfo. * main prog always has linfo_idx == 0等于 The idx to the main_prog->aux->linfo |
| 9007 | func[i]等于Stub for JITs that only support cBPF. eBPF programs are interpreted.* It is encouraged to implement bpf_int_jit_compile() instead, so that* eBPF and implicitly also cBPF can get JITed! |
| 9008 | 如果非 Is our filter JIT'ed? 则 |
| 9009 | err等于负Operation is not supported |
| 9010 | 转到:out_free |
| 9012 | cond_resched() |
| 9018 | 以i小于subprog_cnt循环 |
| 9020 | 以j小于 Number of filter blocks 循环 |
| 9021 | 如果 opcode 不等于BPF_JMP按位或unction call 的值或 source register 不等于when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative* offset to another bpf function则继续下一循环 |
| 9024 | subprog等于 signed offset |
| 9043 | 以i小于subprog_cnt循环 |
| 9044 | old_bpf_func等于bpf_func |
| 9045 | tmp等于Stub for JITs that only support cBPF. eBPF programs are interpreted.* It is encouraged to implement bpf_int_jit_compile() instead, so that* eBPF and implicitly also cBPF can get JITed! |
| 9046 | 如果tmp不等于func[i]或bpf_func不等于old_bpf_func则 |
| 9048 | err等于负Operation is not supported |
| 9049 | 转到:out_free |
| 9051 | cond_resched() |
| 9057 | 以i小于subprog_cnt循环 |
| 9058 | bpf_prog_lock_ro(func[i]) |
| 9059 | bpf_prog_kallsyms_add(func[i]) |
| 9066 | 以i小于 Number of filter blocks 循环 |
| 9067 | 如果 opcode 不等于BPF_JMP按位或unction call 的值或 source register 不等于when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative* offset to another bpf function则继续下一循环 |
| 9071 | subprog等于find_subprog(env, i + signed offset + 1) |
| 9072 | signed immediate constant 等于subprog |
| 9075 | Is our filter JIT'ed? 等于1 |
| 9080 | 返回:0 |
| 9081 | out_free : |
| 9082 | 以i小于subprog_cnt循环如果func[i]则 |
| 9084 | bpf_jit_free(func[i]) |
| 9086 | out_undo_insn : |
| 9088 | archs need to JIT the prog 等于0 |
| 9089 | 以i小于 Number of filter blocks 循环 |
| 9090 | 如果 opcode 不等于BPF_JMP按位或unction call 的值或 source register 不等于when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative* offset to another bpf function则继续下一循环 |
| 9093 | signed offset 等于0 |
| 9097 | 返回:err |
| 名称 | 描述 |
|---|---|
| fixup_call_args |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |