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

[WIP] Enable bpf-next tree build and test #2064

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 42 additions & 1 deletion config/core/build-configs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ trees:
arnd:
url: "https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git"

bpf-next:
url: "https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git"

broonie-misc:
url: "https://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc.git"

Expand Down Expand Up @@ -145,7 +148,6 @@ trees:
weiny2:
url: "https://github.com/weiny2/linux-kernel"


fragments:

amdgpu:
Expand Down Expand Up @@ -360,6 +362,31 @@ fragments:
mediatek/mt8195/scp.img
"'

bpf:
path: "kernel/configs/bpf.config"
configs:
- "CONFIG_BPF=y"
- "CONFIG_HAVE_EBPF_JIT=y"
- "CONFIG_ARCH_WANT_DEFAULT_BPF_JIT=y"
- "CONFIG_BPF_SYSCALL=y"
- "CONFIG_BPF_JIT=y"
- "CONFIG_BPF_JIT_DEFAULT_ON=y"
- "CONFIG_BPF_PRELOAD=y"
- "CONFIG_BPF_PRELOAD_UMD=m"
- "CONFIG_BPF_LSM=y"
- "CONFIG_CGROUP_BPF=y"
- "CONFIG_IPV6_SEG6_BPF=y"
- "CONFIG_NETFILTER_XT_MATCH_BPF=y"
- "CONFIG_BPFILTER=y"
- "CONFIG_BPFILTER_UMH=m"
- "CONFIG_NET_CLS_BPF=m"
- "CONFIG_NET_ACT_BPF=y"
- "CONFIG_BPF_STREAM_PARSER=y"
- "CONFIG_LWTUNNEL_BPF=y"
- "CONFIG_BPF_LIRC_MODE2=y"
- "CONFIG_BPF_EVENTS=y"
- "CONFIG_BPF_KPROBE_OVERRIDE=y"
- "CONFIG_TEST_BPF=m"

crypto:
path: "kernel/configs/crypto.config"
Expand Down Expand Up @@ -936,6 +963,15 @@ chrome_platform_variants: &chrome_platform_variants
<<: *x86_64_defconfig
fragments: [x86-chromebook]

bpf_variants: &bpf_variants
clang-17:
build_environment: clang-17
architectures:
x86_64:
<<: *x86_64_defconfig
extra_configs:
- "allnoconfig"
fragments: [bpf]

build_configs:

Expand Down Expand Up @@ -983,6 +1019,11 @@ build_configs:
branch: 'to-build'
variants: *minimal_variants

bpf-next:
tree: bpf-next
branch: 'for-next'
variants: *bpf_variants
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to directly declare the variants here rather than elsewhere in the file with an anchor as it's only used with the BPF tree.


broonie-misc:
tree: broonie-misc
branch: 'for-kernelci'
Expand Down
6 changes: 6 additions & 0 deletions config/core/test-configs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ test_plans:
kselftest_collections: "arm64"
filters: *kselftest_no_fragment

kselftest-bpf:
<<: *kselftest
params:
job_timeout: '10'
kselftest_collections: "bpf"
Comment on lines +288 to +292
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can actually do this because, like you mentioned, BPF requires an unreasonably cutting-edge toolchain. It's actually one of the reasons why it got disabled by default:

commit 7a6eb7c34a78498742b5f82543b7a68c1c443329 (tag: linux-kselftest-fixes-5.11-rc4)
Author: Mark Brown <broonie@kernel.org>
Date:   Thu Dec 10 18:52:33 2020 +0000

    selftests: Skip BPF seftests by default

So a prerequisite before being able to run this test automatically would be to have a dedicated job to build a custom toolchain Docker image. This sounds like something to do with the new API, at some point in 2024 I guess.


kselftest-capabilities:
<<: *kselftest
params:
Expand Down
19 changes: 19 additions & 0 deletions config/docker/fragment/pahole.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ARG PAHOLE_VER=1.25
ARG SHA256SUM=db31d13c3dad8d9f4e38296bd35c4586e98b9c950e07dabba212985e6d051631
ARG PAHOLE_TRIPLE=dwarves-${PAHOLE_VER}

RUN apt-get update && apt-get install -y elfutils libelf-dev libdw-dev cmake

# https://lwn.net/Articles/928617/
RUN wget https://fedorapeople.org/~acme/dwarves/${PAHOLE_TRIPLE}.tar.xz && \
wget https://fedorapeople.org/~acme/dwarves/${PAHOLE_TRIPLE}.tar.sign && \
tar -xf ${PAHOLE_TRIPLE}.tar.xz -C /tmp/ && \
cd /tmp/${PAHOLE_TRIPLE} && \
ls /tmp/${PAHOLE_TRIPLE} && \
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -D__LIB=lib . && \
make -j$(nproc) && \
make install && \
rm -rf /tmp/${PAHOLE_TRIPLE} && \
rm /${PAHOLE_TRIPLE}*

ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:/usr/local/lib