-
Notifications
You must be signed in to change notification settings - Fork 130
Allow mmap of /sys/kernel/btf/vmlinux #8976
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
base: bpf-next_base
Are you sure you want to change the base?
Conversation
Upstream branch: b615ce5 |
7b56de2
to
49174bd
Compare
Upstream branch: b615ce5 |
b9dbe3e
to
379746d
Compare
49174bd
to
f3a4188
Compare
Upstream branch: 25b6d5d |
379746d
to
e084a8a
Compare
f3a4188
to
f10d83e
Compare
Upstream branch: 4e2e684 |
e084a8a
to
4d0c3c1
Compare
f10d83e
to
9857a0f
Compare
Upstream branch: d90f0bc |
4d0c3c1
to
830d47c
Compare
9857a0f
to
b93b30b
Compare
Upstream branch: 5ead949 |
830d47c
to
8e4d231
Compare
b93b30b
to
f4bae1b
Compare
Upstream branch: 6888a03 |
8e4d231
to
af5c8a1
Compare
Upstream branch: 6888a03 |
af5c8a1
to
e8d88cf
Compare
f4bae1b
to
b8dcdbb
Compare
User space needs access to kernel BTF for many modern features of BPF. Right now each process needs to read the BTF blob either in pieces or as a whole. Allow mmaping the sysfs file so that processes can directly access the memory allocated for it in the kernel. remap_pfn_range is used instead of vm_insert_page due to aarch64 compatibility issues. Tested-by: Alan Maguire <[email protected]> Signed-off-by: Lorenz Bauer <[email protected]> Reviewed-by: Shakeel Butt <[email protected]>
Add a basic test for the ability to mmap /sys/kernel/btf/vmlinux. Ensure that the data is valid BTF and that it is padded with zero. Tested-by: Alan Maguire <[email protected]> Signed-off-by: Lorenz Bauer <[email protected]>
Upstream branch: 8259eb0 |
Teach libbpf to use mmap when parsing vmlinux BTF from /sys. We don't apply this to fall-back paths on the regular file system because there is no way to ensure that modifications underlying the MAP_PRIVATE mapping are not visible to the process. Acked-by: Andrii Nakryiko <[email protected]> Tested-by: Alan Maguire <[email protected]> Signed-off-by: Lorenz Bauer <[email protected]>
e8d88cf
to
27cbb96
Compare
Pull request for series with
subject: Allow mmap of /sys/kernel/btf/vmlinux
version: 5
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=964584