Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next
[linux-2.6-microblaze.git] / include / linux / bpf_verifier.h
index 3930c96..2e3bad8 100644 (file)
@@ -344,6 +344,14 @@ struct bpf_verifier_state_list {
        int miss_cnt, hit_cnt;
 };
 
+struct bpf_loop_inline_state {
+       unsigned int initialized:1; /* set to true upon first entry */
+       unsigned int fit_for_inline:1; /* true if callback function is the same
+                                       * at each call and flags are always zero
+                                       */
+       u32 callback_subprogno; /* valid when fit_for_inline is true */
+};
+
 /* Possible states for alu_state member. */
 #define BPF_ALU_SANITIZE_SRC           (1U << 0)
 #define BPF_ALU_SANITIZE_DST           (1U << 1)
@@ -373,6 +381,10 @@ struct bpf_insn_aux_data {
                                u32 mem_size;   /* mem_size for non-struct typed var */
                        };
                } btf_var;
+               /* if instruction is a call to bpf_loop this field tracks
+                * the state of the relevant registers to make decision about inlining
+                */
+               struct bpf_loop_inline_state loop_inline_state;
        };
        u64 map_key_state; /* constant (32 bit) key tracking for maps */
        int ctx_field_size; /* the ctx field size for load insn, maybe 0 */