[PATCH bpf-next v2 3/4] selftests/bpf: Update qemu config for riscv64 in vmtest.sh

bot+bpf-ci at kernel.org bot+bpf-ci at kernel.org
Wed Sep 30 00:19:33 PDT 2026


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

TL;DR: The new '-cpu max' riscv64 option in vmtest.sh needs qemu 8.2.0+, so
cross-runs on qemu 7.2 to 8.1 may fail; the "v7.2.0+" comment and commit
message may be stale.

> diff --git a/tools/testing/selftests/bpf/vmtest.sh b/tools/testing/selftests/bpf/vmtest.sh
> --- a/tools/testing/selftests/bpf/vmtest.sh
> +++ b/tools/testing/selftests/bpf/vmtest.sh

[ ... ]

> @@ -36,13 +36,13 @@ aarch64)
>  	;;
>  riscv64)
>  	# required qemu version v7.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"
>  	;;

Is the "required qemu version v7.2.0+" comment still accurate after this
change?

The riscv 'max' CPU model isn't available in qemu before v8.2.0.  In
target/riscv/cpu.c, v7.2.0 and v8.1.0 have no riscv_max_cpu_init() and no
TYPE_RISCV_CPU_MAX, and v8.2.0 is the release that adds:

    DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_MAX, riscv_max_cpu_init)

The previous '-cpu rv64,sscofpmf=true' worked on qemu 7.2 because the
sscofpmf property already exists there.

On a non-riscv host, run-qemu takes the CROSS_FLAGS path and runs
${QEMU_BINARY} with "${QEMU_FLAGS[@]}".  With qemu 7.2 through 8.1 (Debian 12
ships 7.2, for example), qemu-system-riscv64 would fail with "unable to find
CPU model 'max'" and the script would abort under 'set -e'.

The commit message doesn't mention the raised minimum qemu version either.
Should the comment be updated to v8.2.0+, or should the commit message state
the new requirement?

[ ... ]


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/36681333169


More information about the linux-riscv mailing list