From 7a0db2d283be32f7ed061f3e08bef203282d30a6 Mon Sep 17 00:00:00 2001 From: Ihor Solodrai Date: Mon, 9 Nov 2026 16:06:12 -0700 Subject: [PATCH 1/5] Remove test workflow for prepare-incremental-build action The dedicated test workflow is no longer needed. Delete it along with the status badge in the action's README, which linked to it. Signed-off-by: Ihor Solodrai --- .../test-prepare-incremental-build-action.yml | 69 ------------------- prepare-incremental-build/README.md | 2 - 2 files changed, 71 deletions(-) delete mode 100644 .github/workflows/test-prepare-incremental-build-action.yml diff --git a/.github/workflows/test-prepare-incremental-build-action.yml b/.github/workflows/test-prepare-incremental-build-action.yml deleted file mode 100644 index 8137d117..00000000 --- a/.github/workflows/test-prepare-incremental-build-action.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Workflow to test prepare-incremental-build action - -on: - push: - paths: - - 'prepare-incremental-build/**' - - '.github/**' - workflow_dispatch: - inputs: - arch: - required: true - type: string - default: x86_64 - toolchain_full: - required: true - type: string - default: llvm-17 - runs_on: - required: true - type: string - default: ubuntu-24.04 - kernel-repo: - required: true - type: string - default: kernel-patches/bpf - kernel-branch: - required: true - type: string - default: bpf-next - -jobs: - test-job: - name: Test prepare-incremental-build action - runs-on: ${{ inputs.runs_on || 'ubuntu-24.04' }} - timeout-minutes: 100 - env: - ARCH: ${{ inputs.arch || 'x86_64' }} - TOOLCHAIN_FULL: ${{ inputs.toolchain_full || 'llvm-17' }} - KERNEL_REPO: ${{ inputs.kernel-repo || 'kernel-patches/bpf' }} - KERNEL_BRANCH: ${{ inputs.kernel-branch || 'bpf-next' }} - REPO_ROOT: ${{ github.workspace }}/linux - KBUILD_OUTPUT: ${{ github.workspace }}/kbuild-output - steps: - - - uses: actions/checkout@v4 - name: Checkout libbpf/ci - - - uses: actions/checkout@v4 - name: Checkout ${{ env.KERNEL_REPO }} - with: - repository: ${{ env.KERNEL_REPO }} - path: ${{ env.REPO_ROOT }} - - - name: Run prepare-incremental-build action - uses: ./prepare-incremental-build - with: - repo-root: ${{ env.REPO_ROOT }} - base-branch: ${{ env.KERNEL_BRANCH }} - arch: ${{ env.ARCH }} - toolchain_full: ${{ env.TOOLCHAIN_FULL }} - kbuild-output: ${{ env.KBUILD_OUTPUT }} - cache-key-prefix: 'test-prepare-incremental-build-action' - - - name: Put something in KBUILD_OUTPUT to trigger caching - shell: bash - run: | - mkdir -p $KBUILD_OUTPUT/path/to - echo "$ARCH $TOOLCHAIN_FULL $KERNEL" > $KBUILD_OUTPUT/path/to/output.txt - diff --git a/prepare-incremental-build/README.md b/prepare-incremental-build/README.md index 91a91a8a..bb2f6b6f 100644 --- a/prepare-incremental-build/README.md +++ b/prepare-incremental-build/README.md @@ -1,5 +1,3 @@ -[![Action test](https://github.com/libbpf/ci/actions/workflows/test-prepare-incremental-build-action.yml/badge.svg)](https://github.com/libbpf/ci/actions/workflows/test-prepare-incremental-build-action.yml) - # Prepare incremental build This action uses [actions/cache](https://github.com/actions/cache) in combination with custom scripts to save kernel build output from previous workflow runs to faciliate incremental builds. From 55d5a7fb62605ef3643520c3f9187e29884cc596 Mon Sep 17 00:00:00 2001 From: Ihor Solodrai Date: Mon, 9 Nov 2026 15:56:00 -0700 Subject: [PATCH 2/5] SPLAT_ALLOWLIST: ignore KASAN-for-JIT selftests splats Port the block added by kernel-patches/vmtest#520. libbpf/ci carries its own copy of these configs and never received it, so the expected KASAN reports from the `kasan` selftest failed the splat check on libbpf/ci runs (e.g. run 42701280551) even though the test itself passed. Signed-off-by: Ihor Solodrai --- ci/vmtest/configs/SPLAT_ALLOWLIST | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ci/vmtest/configs/SPLAT_ALLOWLIST b/ci/vmtest/configs/SPLAT_ALLOWLIST index 0c23bfb3..ef22209a 100644 --- a/ci/vmtest/configs/SPLAT_ALLOWLIST +++ b/ci/vmtest/configs/SPLAT_ALLOWLIST @@ -19,3 +19,15 @@ WARNING: Unprivileged eBPF is enabled # https://lore.kernel.org/all/20260812-hello_world-v1-1-c3c2ddcb362d@meta.com/ # Delete this entry once that fix reaches the CI kernel. BUG: KASAN: stack-out-of-bounds in (stack_trace_consume_entry|filter_irq_stacks)\+ + +# Ignore the KASAN splats generated by KASAN-for-JIT selftests: those are +# expected to trigger many splats to validate that the KASAN +# instrumentation is properly inserted in JITed programs. +BUG: KASAN: slab-(out-of-bounds|use-after-free) in bpf_prog_([a-f0-9]){16}_(st|ld)(x)?(_not)?_on_stack\+ +BUG: KASAN: slab-(out-of-bounds|use-after-free) in bpf_prog_([a-f0-9]){16}_simple_atomic(_fetch)?(_not)?_on_stack\+ +BUG: KASAN: slab-(out-of-bounds|use-after-free) in bpf_prog_([a-f0-9]){16}_ldx_patched(_not)?_on_stack\+ +BUG: KASAN: slab-(out-of-bounds|use-after-free) in bpf_prog_([a-f0-9]){16}_(load_acquire|store_release)(_not)?_on_stack\+ +BUG: KASAN: slab-(out-of-bounds|use-after-free) in bpf_prog_([a-f0-9]){16}_verifier_paths_stack_and_non_stack\+ +BUG: KASAN: slab-(out-of-bounds|use-after-free) in bpf_prog_([a-f0-9]){16}_ldx_oob\+ +BUG: KASAN: slab-(out-of-bounds|use-after-free) in bpf_prog_([a-f0-9]){16}_st_blinded\+ +BUG: KASAN: slab-(out-of-bounds|use-after-free) in bpf_prog_([a-f0-9]){16}_ldx_self_alias_on_stack\+ From 2e77dfed62c65e8fa54e418855fad7f8cf82974b Mon Sep 17 00:00:00 2001 From: Ihor Solodrai Date: Tue, 10 Nov 2026 14:26:10 -0800 Subject: [PATCH 3/5] ci: run lint and action tests on pushes to main The lint and action test workflows run on pushes to master, but the default branch is main. Changes are checked in pull requests and never again after they land. Filter pushes on main, as the test workflow does. Signed-off-by: Ihor Solodrai --- .github/workflows/lint.yaml | 2 +- .github/workflows/scripts_tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index f2991e19..675c089d 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -4,7 +4,7 @@ on: pull_request: push: branches: - - master + - main jobs: shellcheck: diff --git a/.github/workflows/scripts_tests.yml b/.github/workflows/scripts_tests.yml index 4cac0a1e..9caad9e5 100644 --- a/.github/workflows/scripts_tests.yml +++ b/.github/workflows/scripts_tests.yml @@ -5,7 +5,7 @@ on: pull_request: push: branches: - - master + - main jobs: test_run_vmtest: From de2ee614d4ab32b40bd620c38832dcce621127a7 Mon Sep 17 00:00:00 2001 From: Ihor Solodrai Date: Mon, 9 Nov 2026 11:07:48 -0800 Subject: [PATCH 4/5] run-vmtest: scope selftest setup to its guest Custom VM scripts currently inherit the LATEST bpftool check and selftest JSON reporting. This makes unrelated workloads require the kernel selftest source and can report stale selftest results. Select the guest before preparing BPF selftests and use that selection to gate bpftool checks and summaries. Keep the config hook ability to override the bpftool default. Signed-off-by: Ihor Solodrai --- run-vmtest/README.md | 6 ++++++ run-vmtest/run.sh | 26 +++++++++++++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/run-vmtest/README.md b/run-vmtest/README.md index 2617526d..78b6ab84 100644 --- a/run-vmtest/README.md +++ b/run-vmtest/README.md @@ -19,6 +19,12 @@ In summary the action performs the following: Note that behavior of the running scripts is tunable mostly by the environment variables. +`VMTEST_SCRIPT` selects a custom guest entrypoint. Configuration from +`run-vmtest.env` is loaded before selecting the script. BPF selftest preparation, +bpftool checks, and JSON summaries run only for `run-bpf-selftests.sh`. Custom +scripts share VM setup and exitstatus collection, and provide their own workload +setup and results. + ## Required inputs * `arch` - Target architecture diff --git a/run-vmtest/run.sh b/run-vmtest/run.sh index 3fc30b8e..7f84d2da 100755 --- a/run-vmtest/run.sh +++ b/run-vmtest/run.sh @@ -33,6 +33,7 @@ else exit 2 fi +# Set this default before the config hook so its overrides take precedence. RUN_BPFTOOL_CHECKS=${RUN_BPFTOOL_CHECKS:-} if [[ -z "${RUN_BPFTOOL_CHECKS}" \ && "${KERNEL}" = 'LATEST' \ @@ -53,18 +54,23 @@ then VMTEST_SCRIPT="${GITHUB_ACTION_PATH}/run-scx-selftests.sh" elif [[ -z "$VMTEST_SCRIPT" ]]; then - ${GITHUB_ACTION_PATH}/prepare-bpf-selftests.sh VMTEST_SCRIPT="${GITHUB_ACTION_PATH}/run-bpf-selftests.sh" fi +bpf_selftests=false +if [[ "$VMTEST_SCRIPT" == "${GITHUB_ACTION_PATH}/run-bpf-selftests.sh" ]]; then + bpf_selftests=true + ${GITHUB_ACTION_PATH}/prepare-bpf-selftests.sh +fi + # clear exitstatus file echo -n > exitstatus foldable start bpftool_checks "Running bpftool checks..." # bpftool checks are aimed at checking type names, documentation, shell -# completion etc. against the current kernel, so only run on LATEST. -if [[ -n "${RUN_BPFTOOL_CHECKS}" ]]; then +# completion etc. against the current kernel, so default to LATEST. +if "$bpf_selftests" && [[ -n "${RUN_BPFTOOL_CHECKS:-}" ]]; then bpftool_exitstatus=0 # "&& true" does not change the return code (it is not executed if the # Python script fails), but it prevents the trap on ERR set at the top @@ -143,12 +149,14 @@ fi foldable end collect_status -SUMMARIES=$(find . -maxdepth 1 -name "test_*.json") -for summary in ${SUMMARIES}; do - if [ -f "${summary}" ]; then - "${GITHUB_ACTION_PATH}/print_test_summary.py" -s "${GITHUB_STEP_SUMMARY}" -j "${summary}" - fi -done +if "$bpf_selftests"; then + SUMMARIES=$(find . -maxdepth 1 -name "test_*.json") + for summary in ${SUMMARIES}; do + if [ -f "${summary}" ]; then + "${GITHUB_ACTION_PATH}/print_test_summary.py" -s "${GITHUB_STEP_SUMMARY}" -j "${summary}" + fi + done +fi # Final summary - Don't use a fold, keep it visible echo -e "\033[1;33mTest Results:\033[0m" From 4e2d6fa6bf48bf0b7e8868717c524a46833c439d Mon Sep 17 00:00:00 2001 From: Ihor Solodrai Date: Tue, 10 Nov 2026 14:26:49 -0800 Subject: [PATCH 5/5] run-vmtest: remove the veristat runner BPF CI now measures its veristat corpora with its own guest script, passed through VMTEST_SCRIPT, and no longer selects the run_veristat test. The runner has no other known caller: it is not in the default test list and only works with BPF CI's per-corpus configs. Remove run_veristat and its environment from run-bpf-selftests.sh, along with the run_veristat configs synced from kernel-patches/vmtest, which removed them as well. Signed-off-by: Ihor Solodrai --- ci/vmtest/configs/run_veristat.cilium.cfg | 3 -- ci/vmtest/configs/run_veristat.kernel.cfg | 4 --- ci/vmtest/configs/run_veristat.meta.cfg | 4 --- ci/vmtest/configs/run_veristat.scx.cfg | 3 -- run-vmtest/README.md | 2 +- run-vmtest/run-bpf-selftests.sh | 40 ----------------------- 6 files changed, 1 insertion(+), 55 deletions(-) delete mode 100644 ci/vmtest/configs/run_veristat.cilium.cfg delete mode 100644 ci/vmtest/configs/run_veristat.kernel.cfg delete mode 100644 ci/vmtest/configs/run_veristat.meta.cfg delete mode 100644 ci/vmtest/configs/run_veristat.scx.cfg diff --git a/ci/vmtest/configs/run_veristat.cilium.cfg b/ci/vmtest/configs/run_veristat.cilium.cfg deleted file mode 100644 index a9e78676..00000000 --- a/ci/vmtest/configs/run_veristat.cilium.cfg +++ /dev/null @@ -1,3 +0,0 @@ -VERISTAT_OBJECTS_DIR="${CILIUM_BUILD_OUTPUT}/bpf" -VERISTAT_OBJECTS_GLOB="*.o" -VERISTAT_OUTPUT="veristat-cilium" diff --git a/ci/vmtest/configs/run_veristat.kernel.cfg b/ci/vmtest/configs/run_veristat.kernel.cfg deleted file mode 100644 index 807efc25..00000000 --- a/ci/vmtest/configs/run_veristat.kernel.cfg +++ /dev/null @@ -1,4 +0,0 @@ -VERISTAT_OBJECTS_DIR="${SELFTESTS_BPF}" -VERISTAT_OBJECTS_GLOB="*.bpf.o" -VERISTAT_CFG_FILE="${SELFTESTS_BPF}/veristat.cfg" -VERISTAT_OUTPUT="veristat-kernel" diff --git a/ci/vmtest/configs/run_veristat.meta.cfg b/ci/vmtest/configs/run_veristat.meta.cfg deleted file mode 100644 index 14f08d24..00000000 --- a/ci/vmtest/configs/run_veristat.meta.cfg +++ /dev/null @@ -1,4 +0,0 @@ -VERISTAT_OBJECTS_DIR="${WORKING_DIR}/bpf_objects" -VERISTAT_OBJECTS_GLOB="*.o" -VERISTAT_OUTPUT="veristat-meta" -VERISTAT_CFG_FILE="${VERISTAT_CONFIGS}/veristat_meta.cfg" diff --git a/ci/vmtest/configs/run_veristat.scx.cfg b/ci/vmtest/configs/run_veristat.scx.cfg deleted file mode 100644 index bf289c00..00000000 --- a/ci/vmtest/configs/run_veristat.scx.cfg +++ /dev/null @@ -1,3 +0,0 @@ -VERISTAT_OBJECTS_DIR="${SCX_BUILD_OUTPUT}/bpf" -VERISTAT_OBJECTS_GLOB="*.bpf.o" -VERISTAT_OUTPUT="veristat-scx" diff --git a/run-vmtest/README.md b/run-vmtest/README.md index 78b6ab84..7111385c 100644 --- a/run-vmtest/README.md +++ b/run-vmtest/README.md @@ -41,7 +41,7 @@ setup and results. * if not specified, `$VMLINUZ` var is checked * if `$VMLINUZ` is not set, the script will attempt to run `make -s image_name` to find the image -* `output-dir` - path for test runner summaries and veristat output +* `output-dir` - path for test runner summaries * `kbuild-output` (default: `./kbuild-output`) - path to Linux Kernel binaries, aka `$KBUILD_OUTPUT` * `vmtest-release` - release version name of the vmtest tool diff --git a/run-vmtest/run-bpf-selftests.sh b/run-vmtest/run-bpf-selftests.sh index 151e62c6..d29584d5 100755 --- a/run-vmtest/run-bpf-selftests.sh +++ b/run-vmtest/run-bpf-selftests.sh @@ -94,46 +94,6 @@ test_progs-bpf_gcc() { test_progs_helper "-bpf_gcc" "" } -export VERISTAT_TARGET=${VERISTAT_TARGET:-kernel} -export VERISTAT_CONFIGS=${VERISTAT_CONFIGS:-/mnt/vmtest/ci/vmtest/configs} -export WORKING_DIR=$(pwd) # veristat config expects this variable - -run_veristat() { - foldable start run_veristat_${VERISTAT_TARGET} "Running veristat ${VERISTAT_TARGET}" - # Make veristat commands visible in the log - if [ -o xtrace ]; then - xtrace_was_on="1" - else - xtrace_was_on="" - set -x - fi - - ( - # shellcheck source=ci/vmtest/configs/run_veristat.default.cfg - # shellcheck source=ci/vmtest/configs/run_veristat.meta.cfg - source "${VERISTAT_CONFIGS}/run_veristat.${VERISTAT_TARGET}.cfg" - pushd "${VERISTAT_OBJECTS_DIR}" - - args=() - args+=(-o csv) - args+=(-q) - args+=(-e file,prog,verdict,states) - args+=(${VERISTAT_CFG_FILE:+-f@$VERISTAT_CFG_FILE}) - - "${SELFTESTS_BPF}/veristat" "${args[@]}" ${VERISTAT_OBJECTS_GLOB} > \ - "${OUTPUT_DIR}/${VERISTAT_OUTPUT}" - - echo "run_veristat_${VERISTAT_TARGET}:$?" >> ${STATUS_FILE} - popd - ) - - # Hide commands again - if [ -z "$xtrace_was_on" ]; then - set +x - fi - foldable end run_veristat_${VERISTAT_TARGET} -} - foldable end vm_init foldable start kernel_config "Kconfig"