-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BTF: arbitrary __attribute__ encoding #8417
base: bpf-next_base
Are you sure you want to change the base?
Conversation
Upstream branch: 0fc5ddd |
e65d1a6
to
dbbbca0
Compare
Upstream branch: c03320a |
d51b7a4
to
8e3998a
Compare
dbbbca0
to
71beb23
Compare
Upstream branch: c03320a |
8e3998a
to
ab19114
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=928677 expired. Closing PR. |
Upstream branch: 9af5c78 |
ab19114
to
623adde
Compare
Add the following functions to libbpf API: * btf__add_type_attr() * btf__add_decl_attr() These functions allow to add to BTF the type tags and decl tags with info->kflag set to 1. The kflag indicates that the tag directly encodes an __attribute__ and not a normal tag. See Documentation/bpf/btf.rst changes in the subsequent patch for details on the semantics. Suggested-by: Andrii Nakryiko <[email protected]> Signed-off-by: Ihor Solodrai <[email protected]> Reviewed-by: Alan Maguire <[email protected]> Acked-by: Andrii Nakryiko <[email protected]>
Explain the meaning of kind_flag in BTF type_tags and decl_tags. Update uapi btf.h kind_flag comment to reflect the changes. Signed-off-by: Ihor Solodrai <[email protected]>
If the kflag is set for a BTF type tag, then the tag represents an arbitrary __attribute__. Change btf_dump accordingly. Signed-off-by: Ihor Solodrai <[email protected]> Reviewed-by: Alan Maguire <[email protected]> Acked-by: Andrii Nakryiko <[email protected]>
Factor out common routines handling custom BTF from test_btf_dump_incremental. Then use them in the test_btf_dump_type_tags. test_btf_dump_type_tags verifies that a type tag is dumped correctly with respect to its kflag. Signed-off-by: Ihor Solodrai <[email protected]> Acked-by: Eduard Zingerman <[email protected]>
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 <[email protected]> Acked-by: Eduard Zingerman <[email protected]>
Add a BTF verification test case for a type_tag with a kflag set. Type tags with a kflag are now valid. Add BTF_DECL_ATTR_ENC and BTF_TYPE_ATTR_ENC test helper macros, corresponding to *_TAG_ENC. Signed-off-by: Ihor Solodrai <[email protected]>
Upstream branch: 9af5c78 |
623adde
to
6833b30
Compare
Pull request for series with
subject: BTF: arbitrary attribute encoding
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=928677