On Tue, Mar 15, 2022 at 04:31:34PM +0000, Alexandru Elisei wrote: > Well, kvm-unit-tests selects KVM or TCG under the hood without the user > being involved at all. The under the hood aspect isn't great. It's best for testers to know what they're testing. It's pretty obvious, though, that if you choose ARCH != HOST that you'll end up on TCG. And, since KVM has historically been the primary focus of kvm-unit-tests, then it's probably reasonable to assume KVM is used when ARCH == HOST. However, we still silently fall back to TCG, even when ARCH == HOST, if /dev/kvm isn't available! And, the whole AArch32 guest support on AArch64 hosts with KVM requiring a different qemu binary muddies things further... Anyway, I hope serious test runners always specify ACCEL and QEMU to whatever they plan to test. > In my opinion, it's slightly better from an > usability perspective for kvm-unit-tests to do its best to run the tests > based on what the user specifically set (QEMU=qemu-system-arm) than fail to > run the tests because of an internal heuristic of which the user might be > entirely ignorant (if arm64 and /dev/kvm is available, pick ACCEL=kvm). If you'd like to post a patch for it, then I'd prefer something like below, which spells out the condition that the override is applied and also allows $QEMU to be checked by search_qemu_binary() before using it to make decisions. Thanks, drew diff --git a/arm/run b/arm/run index 28a0b4ad2729..128489125dcb 100755 --- a/arm/run +++ b/arm/run @@ -10,16 +10,24 @@ if [ -z "$KUT_STANDALONE" ]; then fi processor="$PROCESSOR" -ACCEL=$(get_qemu_accelerator) || +accel=$(get_qemu_accelerator) || exit $? -if [ "$ACCEL" = "kvm" ]; then +if [ "$accel" = "kvm" ]; then QEMU_ARCH=$HOST fi qemu=$(search_qemu_binary) || exit $? +if [ "$QEMU" ] && [ -z "$ACCEL" ] && + [ "$HOST" = "aarch64" ] && [ "$ARCH" = "arm" ] && + [ "$(basename $QEMU)" = "qemu-system-arm" ]; then + accel=tcg +fi + +ACCEL=$accel + if ! $qemu -machine '?' 2>&1 | grep 'ARM Virtual Machine' > /dev/null; then echo "$qemu doesn't support mach-virt ('-machine virt'). Exiting." exit 2 _______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/mailman/listinfo/kvmarm