lkml.org 
[lkml]   [2020]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH bpf-next v1 2/8] bpf: Propagate BPF_PSEUDO_BTF_ID to uapi headers in /tools
From
Date


On 8/19/20 3:40 PM, Hao Luo wrote:
> Propagate BPF_PSEUDO_BTF_ID from include/linux/uapi/bpf.h to
> tools/include/linux/uapi/bpf.h.

This can be folded into the previous patch.

>
> Signed-off-by: Hao Luo <haoluo@google.com>
> ---
> tools/include/uapi/linux/bpf.h | 38 ++++++++++++++++++++++++++--------
> 1 file changed, 29 insertions(+), 9 deletions(-)
>
> diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
> index 0480f893facd..468376f2910b 100644
> --- a/tools/include/uapi/linux/bpf.h
> +++ b/tools/include/uapi/linux/bpf.h
> @@ -346,18 +346,38 @@ enum bpf_link_type {
> #define BPF_F_TEST_STATE_FREQ (1U << 3)
>
> /* When BPF ldimm64's insn[0].src_reg != 0 then this can have
> - * two extensions:
> - *
> - * insn[0].src_reg: BPF_PSEUDO_MAP_FD BPF_PSEUDO_MAP_VALUE
> - * insn[0].imm: map fd map fd
> - * insn[1].imm: 0 offset into value
> - * insn[0].off: 0 0
> - * insn[1].off: 0 0
> - * ldimm64 rewrite: address of map address of map[0]+offset
> - * verifier type: CONST_PTR_TO_MAP PTR_TO_MAP_VALUE
> + * the following extensions:
> + *
> + * insn[0].src_reg: BPF_PSEUDO_MAP_FD
> + * insn[0].imm: map fd
> + * insn[1].imm: 0
> + * insn[0].off: 0
> + * insn[1].off: 0
> + * ldimm64 rewrite: address of map
> + * verifier type: CONST_PTR_TO_MAP
> */
> #define BPF_PSEUDO_MAP_FD 1
> +/*
> + * insn[0].src_reg: BPF_PSEUDO_MAP_VALUE
> + * insn[0].imm: map fd
> + * insn[1].imm: offset into value
> + * insn[0].off: 0
> + * insn[1].off: 0
> + * ldimm64 rewrite: address of map[0]+offset
> + * verifier type: PTR_TO_MAP_VALUE
> + */
> #define BPF_PSEUDO_MAP_VALUE 2
> +/*
> + * insn[0].src_reg: BPF_PSEUDO_BTF_ID
> + * insn[0].imm: kernel btd id of VAR
> + * insn[1].imm: 0
> + * insn[0].off: 0
> + * insn[1].off: 0
> + * ldimm64 rewrite: address of the kernel variable
> + * verifier type: PTR_TO_BTF_ID or PTR_TO_MEM, depending on whether the var
> + * is struct/union.
> + */
> +#define BPF_PSEUDO_BTF_ID 3
>
> /* when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative
> * offset to another bpf function
>

\
 
 \ /
  Last update: 2020-08-20 18:47    [W:0.440 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site