manjaro-pinephone / phosh

Manjaro Phosh
164 stars 20 forks source link

Enable bpf() syscall (and other BPF config options) #35

Open robster7674 opened 2 years ago

robster7674 commented 2 years ago

While experimenting with Docker on PinePhone (https://github.com/spesmilo/electrum/issues/5159) I hit an error on Docker, most likely the result of not having CONFIG_BPF_SYSCALL enabled on 5.16.16-1-MANJARO-ARM:

[manjaro@manjaro-arm appimage]$ zgrep BPF /proc/config.gz 
CONFIG_BPF=y
CONFIG_HAVE_EBPF_JIT=y
CONFIG_ARCH_WANT_DEFAULT_BPF_JIT=y
# BPF subsystem
# CONFIG_BPF_SYSCALL is not set
CONFIG_BPF_JIT=y
CONFIG_BPF_JIT_DEFAULT_ON=y
# end of BPF subsystem
# CONFIG_NETFILTER_XT_MATCH_BPF is not set
# CONFIG_BPFILTER is not set
# CONFIG_TEST_BPF is not set

I suggest to enable BPF using the config listed on https://github.com/iovisor/bpftrace/blob/master/INSTALL.md#linux-kernel-requirements, perhaps with the addition of CONFIG_CGROUP_BPF=y to enable cgroups v2 support as well (https://www.kernel.org/doc/html/v4.18/admin-guide/cgroup-v2.html, https://www.kernel.org/doc/html/latest/userspace-api/ebpf/syscall.html).

robster7674 commented 2 years ago

Looking at the config for 5.16.16-1 on https://gitlab.manjaro.org/packages/core/linux516/-/blob/master/config#L3 this shows that CONFIG_BPF_SYSCALL is actually enabled. What was the reason for disabling it in Manjaro/PhoSh kernel 5.16.16-1?

robster7674 commented 2 years ago

From https://github.com/manjaro-pinephone/phosh/issues/11#issuecomment-933229374 it appears that not the Manjaro kernel I referred to is used, but the Megi kernel. If so, was disabling CONFIG_BPF_SYSCALL perhaps a workaround for the issue fixed in https://xff.cz/git/linux/commit/?id=330f4c53d3c2d8b11d86ec03a964b86dc81452f5?

cc: @philmmanjaro

philmmanjaro commented 2 years ago

https://gitlab.manjaro.org/manjaro-arm/packages/core/linux-pinephone/-/commit/1ce22db522a514d2c478166a24f2022e0bde6b86 https://gitlab.manjaro.org/manjaro-arm/packages/core/linux-pinephonepro/-/commit/e72f4d8640b29eb5ab4e158ce16114e3d28884ee

robster7674 commented 2 years ago

Thanks @philmmanjaro . How would I go about and update my kernel to 5.17? Could I use https://xff.cz/kernels/5.17/pp.tar.gz? If yes, how? Sorry if asking n00b questions, I am new to Manjaro and PinePhone.