[kvm-unit-tests PATCH 2/2] riscv: Introduce MACHINE_OVERRIDE
Andrew Jones
andrew.jones at linux.dev
Fri Feb 21 08:27:56 PST 2025
From: Andrew Jones <ajones at ventanamicro.com>
Allow riscv tests to use QEMU machine types other than virt.
Signed-off-by: Andrew Jones <ajones at ventanamicro.com>
---
riscv/run | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/riscv/run b/riscv/run
index 73f2bf54dc32..e2f5a922728c 100755
--- a/riscv/run
+++ b/riscv/run
@@ -10,10 +10,12 @@ if [ -z "$KUT_STANDALONE" ]; then
fi
# Allow user overrides of some config.mak variables
+mach=$MACHINE_OVERRIDE
processor=$PROCESSOR_OVERRIDE
firmware=$FIRMWARE_OVERRIDE
[ "$PROCESSOR" = "$ARCH" ] && PROCESSOR="max"
+: "${mach:=virt}"
: "${processor:=$PROCESSOR}"
: "${firmware:=$FIRMWARE}"
[ "$firmware" ] && firmware="-bios $firmware"
@@ -23,11 +25,11 @@ set_qemu_accelerator || exit $?
acc="-accel $ACCEL$ACCEL_PROPS"
qemu=$(search_qemu_binary) || exit $?
-if ! $qemu -machine '?' | grep -q 'RISC-V VirtIO board'; then
+if [ "$mach" = 'virt' ] && ! $qemu -machine '?' | grep -q 'RISC-V VirtIO board'; then
echo "$qemu doesn't support mach-virt ('-machine virt'). Exiting."
exit 2
fi
-mach='-machine virt'
+mach="-machine $mach"
command="$qemu -nodefaults -nographic -serial mon:stdio"
command+=" $mach $acc $firmware -cpu $processor "
--
2.48.1
More information about the kvm-riscv
mailing list