BPF List
 help / color / mirror / Atom feed
From: "Ihor Solodrai" <ihor.solodrai@linux.dev>
To: "Eduard Zingerman" <eddyz87@gmail.com>, bpf@vger.kernel.org
Cc: andrii@kernel.org, ast@kernel.org, daniel@iogearbox.net,
	mykolal@fb.com, jose.marchesi@oracle.com
Subject: Re: [PATCH bpf-next v3 5/6] bpf: allow kind_flag for BTF type and decl tags
Date: Fri, 31 Jan 2025 03:55:02 +0000	[thread overview]
Message-ID: <73a6da135f042c06a8646627078e2699d6bdf2a2@linux.dev> (raw)
In-Reply-To: <18d4d2c22ae66601fee7a604c1b0c8185ce9f430.camel@gmail.com>

On 1/30/25 6:55 PM, Eduard Zingerman wrote:
> On Thu, 2025-01-30 at 12:12 -0800, Ihor Solodrai wrote:
>> BTF type tags and decl tags now may have info->kflag set to 1,
>> changing the semantics of the tag.
>>
>> Change BTF verification to permit BTF that makes use of this feature:
>>   * remove kflag check in btf_decl_tag_check_meta(), as both values
>>     are valid
>>   * allow kflag to be set for BTF_KIND_TYPE_TAG type in
>>     btf_ref_type_check_meta()
>>
>> Make sure kind_flag is NOT set when checking for specific BTF tags,
>> such as "kptr", "user" etc.
>>
>> Modify a selftest checking for kflag in decl_tag accordingly.
>>
>> Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
>> ---
>
> Double checked all places where btf_type_is_type_tag() and
> btf_type_kflag() are used. The changes look correct.
>
> btf_type_is_type_tag() is used in 7 places, in 4 such places it is
> used in conjunction with !btf_type_kflag(t). Not sure if embedding
> btf_type_kflag(t) in btf_type_is_type_tag() makes sense.
>
> Acked-by: Eduard Zingerman <eddyz87@gmail.com>

Yeah, I briefly entertained a thought of checking the flag directly in
btf_type_is_type_tag(), but decided it'll be too confusing.

btf_type_is_type_tag() currently just checks for the type kind, which
is an obvious behavior. If we check for a flag there, then we have to
introduce btf_type_is_type_attr() or something like that, except that
it would not correspond to a type kind.

A complication of API with no benefits IMO.

>
> [...]
>

  reply	other threads:[~2025-01-31  3:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-30 20:12 [PATCH bpf-next v3 0/6] BTF: arbitrary __attribute__ encoding Ihor Solodrai
2025-01-30 20:12 ` [PATCH bpf-next v3 1/6] libbpf: introduce kflag for type_tags and decl_tags in BTF Ihor Solodrai
2025-01-30 20:12 ` [PATCH bpf-next v3 2/6] docs/bpf: document the semantics of BTF tags with kind_flag Ihor Solodrai
2025-01-30 20:12 ` [PATCH bpf-next v3 3/6] libbpf: check the kflag of type tags in btf_dump Ihor Solodrai
2025-01-30 20:12 ` [PATCH bpf-next v3 4/6] selftests/bpf: add a btf_dump test for type_tags Ihor Solodrai
2025-01-30 20:12 ` [PATCH bpf-next v3 5/6] bpf: allow kind_flag for BTF type and decl tags Ihor Solodrai
2025-01-31  2:55   ` Eduard Zingerman
2025-01-31  3:55     ` Ihor Solodrai [this message]
2025-01-30 20:12 ` [PATCH bpf-next v3 6/6] selftests/bpf: add a BTF verification test for kflagged type_tag Ihor Solodrai
2025-02-06  1:00 ` [PATCH bpf-next v3 0/6] BTF: arbitrary __attribute__ encoding patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73a6da135f042c06a8646627078e2699d6bdf2a2@linux.dev \
    --to=ihor.solodrai@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=jose.marchesi@oracle.com \
    --cc=mykolal@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox