Skip to content
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

bpf: define KF_ARENA_* flags for bpf_arena kfuncs #4952

Open
wants to merge 1 commit into
base: bpf-next_base
Choose a base branch
from

Conversation

kernel-patches-daemon-bpf-rc[bot]
Copy link

Pull request for series with
subject: bpf: define KF_ARENA_* flags for bpf_arena kfuncs
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=931020

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 03f3aa4
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=931020
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 12befeb
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=931020
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 0abff46
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=931020
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 003be25
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=931020
version: 1

bpf_arena_alloc_pages() and bpf_arena_free_pages() work with the
bpf_arena pointers [1], which is indicated by the __arena macro in the
kernel source code:

    #define __arena __attribute__((address_space(1)))

However currently this information is absent from the debug data in
the vmlinux binary. As a consequence, bpf_arena_* kfuncs declarations
in vmlinux.h (produced by bpftool) do not match prototypes expected by
the BPF programs attempting to use these functions.

Introduce a set of kfunc flags to mark relevant types as bpf_arena
pointers. The flags then can be detected by pahole when generating BTF
from vmlinux's DWARF, allowing it to emit corresponding BTF type tags
for the marked kfuncs.

With recently proposed BTF extension [2], these type tags will be
processed by bpftool when dumping vmlinux.h, and corresponding
compiler attributes will be added to the declarations.

[1] https://lwn.net/Articles/961594/
[2] https://lore.kernel.org/bpf/[email protected]/

Suggested-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Ihor Solodrai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant