selftests/bpf: Update qemu config for riscv64 in vmtest.sh

When running vmtest.sh on riscv64, the kernel panic at boot due to an
illegal instruction. This is because '-cpu rv64' only enables a baseline
set of riscv extensions, whereas the kernel or toolchain requires newer
extensions. Switch to '-cpu max' so qemu enables all supported
extensions, and bump the required qemu version accordingly.

Additionally, qemu's pmu emulation for riscv64 currently has issues,
causing perf_event_open-related tests to fail. Temporarily disable the
sscofpmf extension to bypass these failures for now, and will try to
investigate and address it later.

While at it, update the libbpf/ci branch in INDEX_URL from 'master' to
'main'.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20260930083522.1914145-4-pulehui@huaweicloud.com
This commit is contained in:
Pu Lehui 2026-09-30 08:35:21 +00:00 committed by Alexei Starovoitov
parent 153a855d0b
commit 78142aa07e
No known key found for this signature in database

View File

@ -35,11 +35,11 @@ aarch64)
ARCH="arm64"
;;
riscv64)
# required qemu version v7.2.0+
# required qemu version v8.2.0+
QEMU_BINARY=qemu-system-riscv64
QEMU_CONSOLE="ttyS0,115200"
HOST_FLAGS=(-M virt -cpu host -enable-kvm -smp 8)
CROSS_FLAGS=(-M virt -cpu rv64,sscofpmf=true -smp 8)
CROSS_FLAGS=(-M virt -cpu max,sscofpmf=false -smp 8)
BZIMAGE="arch/riscv/boot/Image"
ARCH="riscv"
;;
@ -65,7 +65,7 @@ OUTPUT_DIR="$HOME/.bpf_selftests"
KCONFIG_REL_PATHS=("tools/testing/selftests/bpf/config"
"tools/testing/selftests/bpf/config.vm"
"tools/testing/selftests/bpf/config.${PLATFORM}")
INDEX_URL="https://raw.githubusercontent.com/libbpf/ci/master/INDEX"
INDEX_URL="https://raw.githubusercontent.com/libbpf/ci/main/INDEX"
NUM_COMPILE_JOBS="$(nproc)"
LOG_FILE_BASE="$(date +"bpf_selftests.%Y-%m-%d_%H-%M-%S")"
LOG_FILE="${LOG_FILE_BASE}.log"