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@xxxxxxxxx> >> --- > > 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@xxxxxxxxx> 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. > > [...] >