From 12c9b837546c3dfe6d9c8617a0401f01f41a069d Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Mon, 26 Oct 2020 18:46:05 +0100 Subject: sys/linux: add PSEUDO_BTF_ID ld_imm BPF instruction This new ld_imm instruction was introduced in commit 4976b71 ("bpf: Introduce pseudo_btf_id") upstream. Signed-off-by: Paul Chaignon --- sys/linux/bpf.txt | 13 +++++++++++++ sys/linux/bpf.txt.const | 1 + 2 files changed, 14 insertions(+) (limited to 'sys/linux') diff --git a/sys/linux/bpf.txt b/sys/linux/bpf.txt index d1050edf3..268f8d7c9 100644 --- a/sys/linux/bpf.txt +++ b/sys/linux/bpf.txt @@ -228,6 +228,7 @@ bpf_insn [ initr0 bpf_insn_init_r0 map bpf_insn_map map_val bpf_insn_map_value + btf_id bpf_insn_btf_id ] [varlen] bpf_insn_generic { @@ -381,6 +382,18 @@ bpf_insn_map_value { imm2 int32 } +bpf_insn_btf_id { + code const[bpf_insn_load_imm_dw, int8] + dst flags[bpf_reg, int8:4] + src const[BPF_PSEUDO_BTF_ID, int8:4] + off const[0, int16] + imm btf_type_id + code2 const[0, int8] + regs2 const[0, int8] + off2 const[0, int16] + imm2 const[0, int32] +} + define bpf_insn_load_imm_dw BPF_LD | BPF_DW | BPF_IMM # Slightly prune state space, these values frequently must be 0. diff --git a/sys/linux/bpf.txt.const b/sys/linux/bpf.txt.const index 7f8e0defd..f5f566d5b 100644 --- a/sys/linux/bpf.txt.const +++ b/sys/linux/bpf.txt.const @@ -179,6 +179,7 @@ BPF_PROG_TYPE_STRUCT_OPS = 27 BPF_PROG_TYPE_TRACEPOINT = 5 BPF_PROG_TYPE_TRACING = 26 BPF_PROG_TYPE_XDP = 6 +BPF_PSEUDO_BTF_ID = 3 BPF_PSEUDO_CALL = 1 BPF_PSEUDO_MAP_FD = 1 BPF_PSEUDO_MAP_VALUE = 2 -- cgit mrf-deployment