* [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script
@ 2025-06-25 15:48 Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 01/13] run_tests.sh: Document --probe-maxsmp argument Alexandru Elisei
` (15 more replies)
0 siblings, 16 replies; 26+ messages in thread
From: Alexandru Elisei @ 2025-06-25 15:48 UTC (permalink / raw)
To: andrew.jones, eric.auger, lvivier, thuth, frankja, imbrenda, nrb,
david, pbonzini
Cc: kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
v3 can be found here [1]. Based on top of the series that add qemu_params and
test_args [2].
To goal is to allow the user to do:
$ ./configure --target=kvmtool
$ make clean && make
$ ./run_tests.sh
to run all the tests automatically with kvmtool.
Reasons to use kvmtool:
* kvmtool is smaller and a lot easier to modify compared to qemu, which
means developers may prefer it when adding or prototyping new features to
KVM, and being able to run all the tests reliably and automatically is very
useful.
* kvmtool is faster to run the tests (a couple of times faster on
my rockpro64), making for a quick turnaround. But do keep in mind that not
all tests work on kvmtool because of missing features compared to qemu.
* kvmtool does things differently than qemu: different memory layout,
different uart, PMU emulation is disabled by default, etc. This makes it a
good testing vehicule for kvm-unit-tests itself.
Changes v3->v4
--------------
Overview of the changes:
* Gathered Reviewed-by tags - thanks for the review!
* Sent patches #1 ("scripts: unittests.cfg: Rename 'extra_params' to
'qemu_params'") and #2 ("scripts: Add 'test_args' test definition parameter")
as a separate series.
* Fixed the typos reported during the review.
* Ran shellcheck on the patches, this resulted in minor changes.
* Dropped patch "configure: Export TARGET unconditionally" - now the functions
in vmm.bash will check if TARGET is set, instead of having the other scripts use
$TARGET to directly index the vmm_opts array.
* Direct reads of $TARGET have been replaced with vmm_get_target(), to account
for the fact that most architectures don't configure $TARGET (only arm and
arm64 do that).
* Renamed check_vmm_supported() to vmm_check_supported() to match the
function names introduced in subsequent patches.
* Renamed vmm_opts->vmm_optname to match the new function names.
* Reordered the key-value pairs from vmm_optname in alphabetical order.
* Use the "," separator for the composite keys of the associative array instead
of ":" (don't remember why I originally settled on ":", but it was a really poor
choice).
* Dropped the Reviewed-by tags from Drew and Shaoqin Huang from patch #6
("scripts: Use an associative array for qemu argument names") - the review is
much appreciated, but the way the vmm_opts array (now renamed to vmm_optname) is
created, and used, has changed, and since the patch is about introducing the
associative array, I thought it would be useful to have another round of review.
* Use functions instead of indexing vmm_opts (now vmm_optname) directly.
* Fixed standalone test generation by removing 'source vmm.bash' from
scripts/arch-run.bash, $arch/run and scripts/runtime, and having
scripts/mkstandalone.sh::generate_test() copy it directly in the final test
script. Didn't catch that during the previous iterations because I was
running the standalone tests from the top level source directory, and
"source scripts/vmm.bash" happened to work.
More details in the changelog for the modified patches.
[1] https://lore.kernel.org/kvm/20250507151256.167769-1-alexandru.elisei@arm.com/
[2] https://lore.kernel.org/kvm/20250625154354.27015-1-alexandru.elisei@arm.com/
Alexandru Elisei (13):
run_tests.sh: Document --probe-maxsmp argument
scripts: Document environment variables
scripts: Refuse to run the tests if not configured for qemu
scripts: Use an associative array for qemu argument names
scripts: Add 'kvmtool_params' to test definition
scripts: Add support for kvmtool
scripts: Add default arguments for kvmtool
scripts: Add KVMTOOL environment variable for kvmtool binary path
scripts: Detect kvmtool failure in premature_failure()
scripts: Do not probe for maximum number of VCPUs when using kvmtool
scripts/mkstandalone: Export $TARGET
scripts: Add 'disabled_if' test definition parameter for kvmtool to
use
scripts: Enable kvmtool
README.md | 18 +++-
arm/efi/run | 8 ++
arm/run | 161 ++++++++++++++++-----------
arm/unittests.cfg | 31 ++++++
configure | 1 -
docs/unittests.txt | 26 ++++-
powerpc/run | 5 +-
riscv/run | 5 +-
run_tests.sh | 35 +++---
s390x/run | 3 +-
scripts/arch-run.bash | 112 +++++++------------
scripts/common.bash | 30 ++++--
scripts/mkstandalone.sh | 8 +-
scripts/runtime.bash | 35 ++----
scripts/vmm.bash | 234 ++++++++++++++++++++++++++++++++++++++++
x86/run | 5 +-
16 files changed, 525 insertions(+), 192 deletions(-)
create mode 100644 scripts/vmm.bash
--
2.50.0
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v4 01/13] run_tests.sh: Document --probe-maxsmp argument
2025-06-25 15:48 [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Alexandru Elisei
@ 2025-06-25 15:48 ` Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 02/13] scripts: Document environment variables Alexandru Elisei
` (14 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Alexandru Elisei @ 2025-06-25 15:48 UTC (permalink / raw)
To: andrew.jones, eric.auger, lvivier, thuth, frankja, imbrenda, nrb,
david, pbonzini
Cc: kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
Commit 5dd20ec76ea63 ("runtime: Update MAX_SMP probe") added the
--probe-maxmp argument, but the help message for run_tests.sh wasn't
updated. Document --probe-maxsmp.
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
run_tests.sh | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/run_tests.sh b/run_tests.sh
index 152323ffc8a2..f30b6dbd131c 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -17,14 +17,15 @@ cat <<EOF
Usage: $0 [-h] [-v] [-a] [-g group] [-j NUM-TASKS] [-t] [-l]
- -h, --help Output this help text
- -v, --verbose Enables verbose mode
- -a, --all Run all tests, including those flagged as 'nodefault'
- and those guarded by errata.
- -g, --group Only execute tests in the given group
- -j, --parallel Execute tests in parallel
- -t, --tap13 Output test results in TAP format
- -l, --list Only output all tests list
+ -h, --help Output this help text
+ -v, --verbose Enables verbose mode
+ -a, --all Run all tests, including those flagged as 'nodefault'
+ and those guarded by errata.
+ -g, --group Only execute tests in the given group
+ -j, --parallel Execute tests in parallel
+ -t, --tap13 Output test results in TAP format
+ -l, --list Only output all tests list
+ --probe-maxsmp Update the maximum number of VCPUs supported by host
Set the environment variable QEMU=/path/to/qemu-system-ARCH to
specify the appropriate qemu binary for ARCH-run.
--
2.50.0
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v4 02/13] scripts: Document environment variables
2025-06-25 15:48 [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 01/13] run_tests.sh: Document --probe-maxsmp argument Alexandru Elisei
@ 2025-06-25 15:48 ` Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 03/13] scripts: Refuse to run the tests if not configured for qemu Alexandru Elisei
` (13 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Alexandru Elisei @ 2025-06-25 15:48 UTC (permalink / raw)
To: andrew.jones, eric.auger, lvivier, thuth, frankja, imbrenda, nrb,
david, pbonzini
Cc: kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang, Andrew Jones
Document the environment variables that influence how a test is executed
by the run_tests.sh test runner.
Suggested-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
docs/unittests.txt | 5 ++++-
run_tests.sh | 12 +++++++++---
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/docs/unittests.txt b/docs/unittests.txt
index 6eb315618dbd..ea0da959f008 100644
--- a/docs/unittests.txt
+++ b/docs/unittests.txt
@@ -102,7 +102,8 @@ timeout
-------
timeout = <duration>
-Optional timeout in seconds, after which the test will be killed and fail.
+Optional timeout in seconds, after which the test will be killed and fail. Can
+be overwritten with the TIMEOUT=<duration> environment variable.
check
-----
@@ -113,3 +114,5 @@ can contain multiple files to check separated by a space, but each check
parameter needs to be of the form <path>=<value>
The path and value cannot contain space, =, or shell wildcard characters.
+
+Can be overwritten with the CHECK environment variable with the same syntax.
diff --git a/run_tests.sh b/run_tests.sh
index f30b6dbd131c..dd9d27377905 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -27,9 +27,15 @@ Usage: $0 [-h] [-v] [-a] [-g group] [-j NUM-TASKS] [-t] [-l]
-l, --list Only output all tests list
--probe-maxsmp Update the maximum number of VCPUs supported by host
-Set the environment variable QEMU=/path/to/qemu-system-ARCH to
-specify the appropriate qemu binary for ARCH-run.
-
+The following environment variables are used:
+
+ QEMU Path to QEMU binary for ARCH-run
+ ACCEL QEMU accelerator to use, e.g. 'kvm', 'hvf' or 'tcg'
+ ACCEL_PROPS Extra argument(s) to ACCEL
+ MACHINE QEMU machine type
+ TIMEOUT Timeout duration for the timeout(1) command
+ CHECK Overwrites the 'check' unit test parameter (see
+ docs/unittests.txt)
EOF
}
--
2.50.0
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v4 03/13] scripts: Refuse to run the tests if not configured for qemu
2025-06-25 15:48 [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 01/13] run_tests.sh: Document --probe-maxsmp argument Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 02/13] scripts: Document environment variables Alexandru Elisei
@ 2025-06-25 15:48 ` Alexandru Elisei
2025-06-26 15:25 ` Andrew Jones
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 04/13] scripts: Use an associative array for qemu argument names Alexandru Elisei
` (12 subsequent siblings)
15 siblings, 1 reply; 26+ messages in thread
From: Alexandru Elisei @ 2025-06-25 15:48 UTC (permalink / raw)
To: andrew.jones, eric.auger, lvivier, thuth, frankja, imbrenda, nrb,
david, pbonzini
Cc: kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
Arm and arm64 support running the tests under kvmtool. kvmtool has a
different command line syntax for configuring and running a virtual
machine, and the automated scripts know only how to use qemu.
One issue with that is even though the tests have been configured for
kvmtool (with ./configure --target=kvmtool), the scripts will use qemu to
run the tests, and without looking at the logs there is no indication that
the tests haven't been run with kvmtool, as configured.
Another issue is that kvmtool uses a different address for the UART and
when running the tests with qemu via the scripts, this warning is
displayed:
WARNING: early print support may not work. Found uart at 0x9000000, but early base is 0x1000000.
which might trip up an unsuspected user.
There are four different ways to run a test using the test infrastructure:
with run_tests.sh, by invoking arm/run or arm/efi/run with the correct
parameters (only the arm directory is mentioned here because the tests can
be configured for kvmtool only on arm and arm64), and by creating
standalone tests.
run_tests.sh ends up executing either arm/run or arm/efi/run, so add a
check to these two scripts for the test target, and refuse to run the test
if kvm-unit-tests has been configured for kvmtool.
mkstandalone.sh also executes arm/run or arm/efi run, but the usual use
case for standalone tests is to compile them on one machine, and then to
run them on a different machine. This two step process can be time
consuming, so save the user time (and frustration!) and add a check
directly to mkstandalone.sh.
Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
Changes v3->v4:
* Renamed check_vmm_supported() to vmm_check_supported().
* Added function vmm_get_target().
* Added Reviewed-by from Shaoqin.
* Fixed typo s/execuing/executing (Drew).
arm/efi/run | 3 +++
arm/run | 4 ++++
scripts/mkstandalone.sh | 6 +++++-
scripts/vmm.bash | 25 +++++++++++++++++++++++++
4 files changed, 37 insertions(+), 1 deletion(-)
create mode 100644 scripts/vmm.bash
diff --git a/arm/efi/run b/arm/efi/run
index 8f41fc02df31..38800e8bfa13 100755
--- a/arm/efi/run
+++ b/arm/efi/run
@@ -11,6 +11,9 @@ if [ ! -f config.mak ]; then
fi
source config.mak
source scripts/arch-run.bash
+source scripts/vmm.bash
+
+vmm_check_supported
if [ -f /usr/share/qemu-efi-aarch64/QEMU_EFI.fd ]; then
DEFAULT_UEFI=/usr/share/qemu-efi-aarch64/QEMU_EFI.fd
diff --git a/arm/run b/arm/run
index ef58558231b7..edf0c1dd1b41 100755
--- a/arm/run
+++ b/arm/run
@@ -7,7 +7,11 @@ if [ -z "$KUT_STANDALONE" ]; then
fi
source config.mak
source scripts/arch-run.bash
+ source scripts/vmm.bash
fi
+
+vmm_check_supported
+
qemu_cpu="$TARGET_CPU"
if [ "$QEMU" ] && [ -z "$ACCEL" ] &&
diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh
index c4ba81f18935..9c5768563757 100755
--- a/scripts/mkstandalone.sh
+++ b/scripts/mkstandalone.sh
@@ -6,6 +6,9 @@ if [ ! -f config.mak ]; then
fi
source config.mak
source scripts/common.bash
+source scripts/vmm.bash
+
+vmm_check_supported
temp_file ()
{
@@ -71,7 +74,8 @@ generate_test ()
args[3]='$bin'
(echo "#!/usr/bin/env bash"
- cat scripts/arch-run.bash "$TEST_DIR/run") | temp_file RUNTIME_arch_run
+ cat scripts/vmm.bash scripts/arch-run.bash "$TEST_DIR/run") \
+ | temp_file RUNTIME_arch_run
echo "exec {stdout}>&1"
echo "RUNTIME_log_stdout () { cat >&\$stdout; }"
diff --git a/scripts/vmm.bash b/scripts/vmm.bash
new file mode 100644
index 000000000000..8365c1424a3f
--- /dev/null
+++ b/scripts/vmm.bash
@@ -0,0 +1,25 @@
+function vmm_get_target()
+{
+ if [[ -z "$TARGET" ]]; then
+ echo "qemu"
+ else
+ echo "$TARGET"
+ fi
+}
+
+function vmm_check_supported()
+{
+ # We're not interested in the return code for vmm_get_target().
+ # shellcheck disable=SC2155
+ local target=$(vmm_get_target)
+
+ case "$target" in
+ qemu)
+ return 0
+ ;;
+ *)
+ echo "$0 does not support target '$target'"
+ exit 2
+ ;;
+ esac
+}
--
2.50.0
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v4 04/13] scripts: Use an associative array for qemu argument names
2025-06-25 15:48 [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Alexandru Elisei
` (2 preceding siblings ...)
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 03/13] scripts: Refuse to run the tests if not configured for qemu Alexandru Elisei
@ 2025-06-25 15:48 ` Alexandru Elisei
2025-06-26 15:29 ` Andrew Jones
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 05/13] scripts: Add 'kvmtool_params' to test definition Alexandru Elisei
` (11 subsequent siblings)
15 siblings, 1 reply; 26+ messages in thread
From: Alexandru Elisei @ 2025-06-25 15:48 UTC (permalink / raw)
To: andrew.jones, eric.auger, lvivier, thuth, frankja, imbrenda, nrb,
david, pbonzini
Cc: kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
Move away from hardcoded qemu arguments and use instead an associative
array to get the needed arguments. This paves the way for adding kvmtool
support to the scripts, which has a different syntax for the same VM
configuration parameters.
Suggested-by: Andrew Jones <andrew.jones@linux.dev>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
Changes v3->v4:
* Renamed vmm_opts to vmm_optname.
* Dropped entries for 'kernel' and 'initrd' in vmm_optname because they weren't
used in this patch.
* Use vmm_optname_nr_cpus() and vmm_optname_args() instead of directly indexing
into vmm_optname.
* Dropped the check for empty $test_args in scripts/runtime.bash::run() by
having $test_args already contain --append if not empty in
scripts/common.bash::for_each_unittest().
scripts/common.bash | 11 ++++++++---
scripts/runtime.bash | 7 +------
scripts/vmm.bash | 15 +++++++++++++++
3 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/scripts/common.bash b/scripts/common.bash
index 9deb87d4050d..ae127bd4e208 100644
--- a/scripts/common.bash
+++ b/scripts/common.bash
@@ -1,4 +1,5 @@
source config.mak
+source scripts/vmm.bash
function for_each_unittest()
{
@@ -26,8 +27,12 @@ function for_each_unittest()
$(arch_cmd) "$cmd" "$testname" "$groups" "$smp" "$kernel" "$test_args" "$opts" "$arch" "$machine" "$check" "$accel" "$timeout"
fi
testname=$rematch
- smp=1
+ smp="$(vmm_optname_nr_cpus) 1"
kernel=""
+ # Intentionally don't use -append if test_args is empty
+ # because qemu interprets the first word after
+ # -append as a kernel parameter instead of a command
+ # line option.
test_args=""
opts=""
groups=""
@@ -39,9 +44,9 @@ function for_each_unittest()
elif [[ $line =~ ^file\ *=\ *(.*)$ ]]; then
kernel=$TEST_DIR/${BASH_REMATCH[1]}
elif [[ $line =~ ^smp\ *=\ *(.*)$ ]]; then
- smp=${BASH_REMATCH[1]}
+ smp="$(vmm_optname_nr_cpus) ${BASH_REMATCH[1]}"
elif [[ $line =~ ^test_args\ *=\ *(.*)$ ]]; then
- test_args=${BASH_REMATCH[1]}
+ test_args="$(vmm_optname_args) ${BASH_REMATCH[1]}"
elif [[ $line =~ ^(extra_params|qemu_params)\ *=\ *'"""'(.*)$ ]]; then
opts=${BASH_REMATCH[2]}$'\n'
while read -r -u $fd; do
diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index bc17b89f4ff5..86d8a2cd8528 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -34,7 +34,7 @@ premature_failure()
get_cmdline()
{
local kernel=$1
- echo "TESTNAME=$testname TIMEOUT=$timeout MACHINE=$machine ACCEL=$accel $RUNTIME_arch_run $kernel -smp $smp $opts"
+ echo "TESTNAME=$testname TIMEOUT=$timeout MACHINE=$machine ACCEL=$accel $RUNTIME_arch_run $kernel $smp $test_args $opts"
}
skip_nodefault()
@@ -88,11 +88,6 @@ function run()
local accel="${10}"
local timeout="${11:-$TIMEOUT}" # unittests.cfg overrides the default
- # If $test_args is empty, qemu will interpret the first option after -append
- # as a test argument instead of a qemu option, so make sure that doesn't
- # happen.
- [ -n "$test_args" ] && opts="-append $test_args $opts"
-
if [ "${CONFIG_EFI}" == "y" ]; then
kernel=${kernel/%.flat/.efi}
fi
diff --git a/scripts/vmm.bash b/scripts/vmm.bash
index 8365c1424a3f..7629b2b9146e 100644
--- a/scripts/vmm.bash
+++ b/scripts/vmm.bash
@@ -1,3 +1,18 @@
+declare -A vmm_optname=(
+ [qemu,args]='-append'
+ [qemu,nr_cpus]='-smp'
+)
+
+function vmm_optname_args()
+{
+ echo ${vmm_optname[$(vmm_get_target),args]}
+}
+
+function vmm_optname_nr_cpus()
+{
+ echo ${vmm_optname[$(vmm_get_target),nr_cpus]}
+}
+
function vmm_get_target()
{
if [[ -z "$TARGET" ]]; then
--
2.50.0
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v4 05/13] scripts: Add 'kvmtool_params' to test definition
2025-06-25 15:48 [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Alexandru Elisei
` (3 preceding siblings ...)
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 04/13] scripts: Use an associative array for qemu argument names Alexandru Elisei
@ 2025-06-25 15:48 ` Alexandru Elisei
2025-06-26 15:34 ` Andrew Jones
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 06/13] scripts: Add support for kvmtool Alexandru Elisei
` (10 subsequent siblings)
15 siblings, 1 reply; 26+ messages in thread
From: Alexandru Elisei @ 2025-06-25 15:48 UTC (permalink / raw)
To: andrew.jones, eric.auger, lvivier, thuth, frankja, imbrenda, nrb,
david, pbonzini
Cc: kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
arm/arm64 supports running tests under kvmtool, but kvmtool's syntax for
running and configuring a virtual machine is different to qemu. To run
tests using the automated test infrastructure, add a new test parameter,
'kvmtool_params'. The parameter serves the exact purpose as 'qemu_params',
but using kvmtool's syntax.
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
Changes v3->v4:
* Added params_name in scripts/common.bash::for_each_unittest() to avoid
checking for $TARGET when deciding to parse kvmtool_params or
{qemu,extra}_params.
* Dropped factoring out parse_opts() in for_each_unittest().
arm/unittests.cfg | 24 ++++++++++++++++++++++++
docs/unittests.txt | 8 ++++++++
scripts/common.bash | 11 +++++++----
scripts/vmm.bash | 16 ++++++++++++++++
4 files changed, 55 insertions(+), 4 deletions(-)
diff --git a/arm/unittests.cfg b/arm/unittests.cfg
index 384af983cd88..343c14567f27 100644
--- a/arm/unittests.cfg
+++ b/arm/unittests.cfg
@@ -17,6 +17,7 @@ file = selftest.flat
smp = 2
test_args = 'setup smp=2 mem=256'
qemu_params = -m 256
+kvmtool_params = --mem 256
groups = selftest
# Test vector setup and exception handling (kernel mode).
@@ -48,66 +49,77 @@ groups = pci
file = pmu.flat
groups = pmu
test_args = "cycle-counter 0"
+kvmtool_params = --pmu
[pmu-event-introspection]
file = pmu.flat
groups = pmu
arch = arm64
test_args = pmu-event-introspection
+kvmtool_params = --pmu
[pmu-event-counter-config]
file = pmu.flat
groups = pmu
arch = arm64
test_args = pmu-event-counter-config
+kvmtool_params = --pmu
[pmu-basic-event-count]
file = pmu.flat
groups = pmu
arch = arm64
test_args = pmu-basic-event-count
+kvmtool_params = --pmu
[pmu-mem-access]
file = pmu.flat
groups = pmu
arch = arm64
test_args = pmu-mem-access
+kvmtool_params = --pmu
[pmu-mem-access-reliability]
file = pmu.flat
groups = pmu
arch = arm64
test_args = pmu-mem-access-reliability
+kvmtool_params = --pmu
[pmu-sw-incr]
file = pmu.flat
groups = pmu
arch = arm64
test_args = pmu-sw-incr
+kvmtool_params = --pmu
[pmu-chained-counters]
file = pmu.flat
groups = pmu
arch = arm64
test_args = pmu-chained-counters
+kvmtool_params = --pmu
[pmu-chained-sw-incr]
file = pmu.flat
groups = pmu
arch = arm64
test_args = pmu-chained-sw-incr
+kvmtool_params = --pmu
[pmu-chain-promotion]
file = pmu.flat
groups = pmu
arch = arm64
test_args = pmu-chain-promotion
+kvmtool_params = --pmu
[pmu-overflow-interrupt]
file = pmu.flat
groups = pmu
arch = arm64
test_args = pmu-overflow-interrupt
+kvmtool_params = --pmu
# Test PMU support (TCG) with -icount IPC=1
#[pmu-tcg-icount-1]
@@ -131,6 +143,7 @@ file = gic.flat
smp = $((($MAX_SMP < 8)?$MAX_SMP:8))
test_args = ipi
qemu_params = -machine gic-version=2
+kvmtool_params = --irqchip=gicv2
groups = gic
[gicv2-mmio]
@@ -138,6 +151,7 @@ file = gic.flat
smp = $((($MAX_SMP < 8)?$MAX_SMP:8))
test_args = mmio
qemu_params = -machine gic-version=2
+kvmtool_params = --irqchip=gicv2
groups = gic
[gicv2-mmio-up]
@@ -145,6 +159,7 @@ file = gic.flat
smp = 1
test_args = mmio
qemu_params = -machine gic-version=2
+kvmtool_params = --irqchip=gicv2
groups = gic
[gicv2-mmio-3p]
@@ -152,6 +167,7 @@ file = gic.flat
smp = $((($MAX_SMP < 3)?$MAX_SMP:3))
test_args = mmio
qemu_params = -machine gic-version=2
+kvmtool_params = --irqchip=gicv2
groups = gic
[gicv3-ipi]
@@ -159,6 +175,7 @@ file = gic.flat
smp = $MAX_SMP
test_args = ipi
qemu_params = -machine gic-version=3
+kvmtool_params = --irqchip=gicv3
groups = gic
[gicv2-active]
@@ -166,6 +183,7 @@ file = gic.flat
smp = $((($MAX_SMP < 8)?$MAX_SMP:8))
test_args = active
qemu_params = -machine gic-version=2
+kvmtool_params = --irqchip=gicv2
groups = gic
[gicv3-active]
@@ -173,6 +191,7 @@ file = gic.flat
smp = $MAX_SMP
test_args = active
qemu_params = -machine gic-version=3
+kvmtool_params = --irqchip=gicv3
groups = gic
[its-introspection]
@@ -180,6 +199,7 @@ file = gic.flat
smp = $MAX_SMP
test_args = its-introspection
qemu_params = -machine gic-version=3
+kvmtool_params = --irqchip=gicv3-its
groups = its
arch = arm64
@@ -188,6 +208,7 @@ file = gic.flat
smp = $MAX_SMP
test_args = its-trigger
qemu_params = -machine gic-version=3
+kvmtool_params = --irqchip=gicv3-its
groups = its
arch = arm64
@@ -196,6 +217,7 @@ file = gic.flat
smp = $MAX_SMP
test_args = its-migration
qemu_params = -machine gic-version=3
+kvmtool_params = --irqchip=gicv3
groups = its migration
arch = arm64
@@ -204,6 +226,7 @@ file = gic.flat
smp = $MAX_SMP
test_args = its-pending-migration
qemu_params = -machine gic-version=3
+kvmtool_params = --irqchip=gicv3
groups = its migration
arch = arm64
@@ -212,6 +235,7 @@ file = gic.flat
smp = $MAX_SMP
test_args = its-migrate-unmapped-collection
qemu_params = -machine gic-version=3
+kvmtool_params = --irqchip=gicv3
groups = its migration
arch = arm64
diff --git a/docs/unittests.txt b/docs/unittests.txt
index ea0da959f008..a9164bccc24c 100644
--- a/docs/unittests.txt
+++ b/docs/unittests.txt
@@ -78,6 +78,14 @@ extra_params
Alias for 'qemu_params', supported for compatibility purposes. Use
'qemu_params' for new tests.
+kvmtool_params
+--------------
+Extra parameters supplied to the kvmtool process. Works similarly to
+'qemu_params', but uses kvmtool's syntax for command line arguments. The
+example for 'qemu_params', applied to kvmtool, would be:
+
+kvmtool_params = --mem 256
+
groups
------
groups = <group_name1> <group_name2> ...
diff --git a/scripts/common.bash b/scripts/common.bash
index ae127bd4e208..7c1b89f1b3c2 100644
--- a/scripts/common.bash
+++ b/scripts/common.bash
@@ -18,6 +18,9 @@ function for_each_unittest()
local timeout
local rematch
+ # shellcheck disable=SC2155
+ local params_name=$(vmm_unittest_params_name)
+
exec {fd}<"$unittests"
while read -r -u $fd line; do
@@ -47,8 +50,8 @@ function for_each_unittest()
smp="$(vmm_optname_nr_cpus) ${BASH_REMATCH[1]}"
elif [[ $line =~ ^test_args\ *=\ *(.*)$ ]]; then
test_args="$(vmm_optname_args) ${BASH_REMATCH[1]}"
- elif [[ $line =~ ^(extra_params|qemu_params)\ *=\ *'"""'(.*)$ ]]; then
- opts=${BASH_REMATCH[2]}$'\n'
+ elif [[ $line =~ ^$params_name\ *=\ *'"""'(.*)$ ]]; then
+ opts=${BASH_REMATCH[1]}$'\n'
while read -r -u $fd; do
#escape backslash newline, but not double backslash
if [[ $opts =~ [^\\]*(\\*)$'\n'$ ]]; then
@@ -63,8 +66,8 @@ function for_each_unittest()
opts+=$REPLY$'\n'
fi
done
- elif [[ $line =~ ^(extra_params|qemu_params)\ *=\ *(.*)$ ]]; then
- opts=${BASH_REMATCH[2]}
+ elif [[ $line =~ ^$params_name\ *=\ *(.*)$ ]]; then
+ opts=${BASH_REMATCH[1]}
elif [[ $line =~ ^groups\ *=\ *(.*)$ ]]; then
groups=${BASH_REMATCH[1]}
elif [[ $line =~ ^arch\ *=\ *(.*)$ ]]; then
diff --git a/scripts/vmm.bash b/scripts/vmm.bash
index 7629b2b9146e..9a2608eb3fd4 100644
--- a/scripts/vmm.bash
+++ b/scripts/vmm.bash
@@ -38,3 +38,19 @@ function vmm_check_supported()
;;
esac
}
+
+function vmm_unittest_params_name()
+{
+ # shellcheck disable=SC2155
+ local target=$(vmm_get_target)
+
+ case "$target" in
+ qemu)
+ echo "extra_params|qemu_params"
+ ;;
+ *)
+ echo "$0 does not support '$target'"
+ exit 2
+ ;;
+ esac
+}
--
2.50.0
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v4 06/13] scripts: Add support for kvmtool
2025-06-25 15:48 [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Alexandru Elisei
` (4 preceding siblings ...)
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 05/13] scripts: Add 'kvmtool_params' to test definition Alexandru Elisei
@ 2025-06-25 15:48 ` Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 07/13] scripts: Add default arguments " Alexandru Elisei
` (9 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Alexandru Elisei @ 2025-06-25 15:48 UTC (permalink / raw)
To: andrew.jones, eric.auger, lvivier, thuth, frankja, imbrenda, nrb,
david, pbonzini
Cc: kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
Teach the arm runner to use kvmtool when kvm-unit-tests has been configured
appropriately.
The test is ran using run_test_status(), and a 0 return code (which means
success) is converted to 1, because kvmtool does not have a testdev device
to return the test exit code, so kvm-unit-tests must always parse the
"EXIT: STATUS" line for the exit code.
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
Changes v3->v4:
* Use vmm_get_target() in $arch/run instead of testing $TARGET directly.
* Do not source scripts/vmm.bash and config.mak in scripts/arch-run.bash because
that will fail when running standalone tests.
* Source scripts/vmm.bash in $arch/run when not making standalone tests to make
the needed functions available for scripts/arch-run.bash.
* Dropped local variable sig in run_test (shellcheck).
* Use vmm_fixup_return_code(), vmm_optname_initrd() and vmm_get_target() in
scripts/arch-run.bash.
arm/run | 161 ++++++++++++++++++++++++++----------------
powerpc/run | 5 +-
riscv/run | 5 +-
s390x/run | 3 +-
scripts/arch-run.bash | 111 ++++++++++-------------------
scripts/vmm.bash | 102 ++++++++++++++++++++++++++
x86/run | 5 +-
7 files changed, 251 insertions(+), 141 deletions(-)
diff --git a/arm/run b/arm/run
index edf0c1dd1b41..9ee795ae424c 100755
--- a/arm/run
+++ b/arm/run
@@ -12,80 +12,117 @@ fi
vmm_check_supported
-qemu_cpu="$TARGET_CPU"
-
-if [ "$QEMU" ] && [ -z "$ACCEL" ] &&
- [ "$HOST" = "aarch64" ] && [ "$ARCH" = "arm" ] &&
- [ "$(basename $QEMU)" = "qemu-system-arm" ]; then
- ACCEL="tcg"
-fi
+function arch_run_qemu()
+{
+ qemu_cpu="$TARGET_CPU"
+
+ if [ "$QEMU" ] && [ -z "$ACCEL" ] &&
+ [ "$HOST" = "aarch64" ] && [ "$ARCH" = "arm" ] &&
+ [ "$(basename $QEMU)" = "qemu-system-arm" ]; then
+ ACCEL="tcg"
+ fi
-set_qemu_accelerator || exit $?
-if [ "$ACCEL" = "kvm" ]; then
- QEMU_ARCH=$HOST
-fi
+ set_qemu_accelerator || exit $?
+ if [ "$ACCEL" = "kvm" ]; then
+ QEMU_ARCH=$HOST
+ fi
-qemu=$(search_qemu_binary) ||
- exit $?
+ qemu=$(search_qemu_binary) ||
+ exit $?
-if ! $qemu -machine '?' | grep -q 'ARM Virtual Machine'; then
- echo "$qemu doesn't support mach-virt ('-machine virt'). Exiting."
- exit 2
-fi
+ if ! $qemu -machine '?' | grep -q 'ARM Virtual Machine'; then
+ echo "$qemu doesn't support mach-virt ('-machine virt'). Exiting."
+ exit 2
+ fi
-M='-machine virt'
+ M='-machine virt'
-if [ "$ACCEL" = "kvm" ]; then
- if $qemu $M,\? | grep -q gic-version; then
- M+=',gic-version=host'
+ if [ "$ACCEL" = "kvm" ]; then
+ if $qemu $M,\? | grep -q gic-version; then
+ M+=',gic-version=host'
+ fi
fi
-fi
-if [ -z "$qemu_cpu" ]; then
- if ( [ "$ACCEL" = "kvm" ] || [ "$ACCEL" = "hvf" ] ) &&
- ( [ "$HOST" = "aarch64" ] || [ "$HOST" = "arm" ] ); then
- qemu_cpu="host"
- if [ "$ARCH" = "arm" ] && [ "$HOST" = "aarch64" ]; then
- qemu_cpu+=",aarch64=off"
+ if [ -z "$qemu_cpu" ]; then
+ if ( [ "$ACCEL" = "kvm" ] || [ "$ACCEL" = "hvf" ] ) &&
+ ( [ "$HOST" = "aarch64" ] || [ "$HOST" = "arm" ] ); then
+ qemu_cpu="host"
+ if [ "$ARCH" = "arm" ] && [ "$HOST" = "aarch64" ]; then
+ qemu_cpu+=",aarch64=off"
+ fi
+ else
+ qemu_cpu="$DEFAULT_QEMU_CPU"
fi
- else
- qemu_cpu="$DEFAULT_QEMU_CPU"
fi
-fi
-if [ "$ARCH" = "arm" ]; then
- M+=",highmem=off"
-fi
+ if [ "$ARCH" = "arm" ]; then
+ M+=",highmem=off"
+ fi
-if ! $qemu $M -device '?' | grep -q virtconsole; then
- echo "$qemu doesn't support virtio-console for chr-testdev. Exiting."
- exit 2
-fi
+ if ! $qemu $M -device '?' | grep -q virtconsole; then
+ echo "$qemu doesn't support virtio-console for chr-testdev. Exiting."
+ exit 2
+ fi
-if ! $qemu $M -chardev '?' | grep -q testdev; then
- echo "$qemu doesn't support chr-testdev. Exiting."
- exit 2
-fi
+ if ! $qemu $M -chardev '?' | grep -q testdev; then
+ echo "$qemu doesn't support chr-testdev. Exiting."
+ exit 2
+ fi
-if [ "$UEFI_SHELL_RUN" != "y" ] && [ "$EFI_USE_ACPI" != "y" ]; then
- chr_testdev='-device virtio-serial-device'
- chr_testdev+=' -device virtconsole,chardev=ctd -chardev testdev,id=ctd'
-fi
+ if [ "$UEFI_SHELL_RUN" != "y" ] && [ "$EFI_USE_ACPI" != "y" ]; then
+ chr_testdev='-device virtio-serial-device'
+ chr_testdev+=' -device virtconsole,chardev=ctd -chardev testdev,id=ctd'
+ fi
-pci_testdev=
-if $qemu $M -device '?' | grep -q pci-testdev; then
- pci_testdev="-device pci-testdev"
-fi
+ pci_testdev=
+ if $qemu $M -device '?' | grep -q pci-testdev; then
+ pci_testdev="-device pci-testdev"
+ fi
-A="-accel $ACCEL$ACCEL_PROPS"
-command="$qemu -nodefaults $M $A -cpu $qemu_cpu $chr_testdev $pci_testdev"
-command+=" -display none -serial stdio"
-command="$(migration_cmd) $(timeout_cmd) $command"
-
-if [ "$UEFI_SHELL_RUN" = "y" ]; then
- ENVIRON_DEFAULT=n run_qemu_status $command "$@"
-elif [ "$EFI_USE_ACPI" = "y" ]; then
- run_qemu_status $command -kernel "$@"
-else
- run_qemu $command -kernel "$@"
-fi
+ A="-accel $ACCEL$ACCEL_PROPS"
+ command="$qemu -nodefaults $M $A -cpu $qemu_cpu $chr_testdev $pci_testdev"
+ command+=" -display none -serial stdio"
+ command="$(migration_cmd) $(timeout_cmd) $command"
+
+ if [ "$UEFI_SHELL_RUN" = "y" ]; then
+ ENVIRON_DEFAULT=n run_test_status $command "$@"
+ elif [ "$EFI_USE_ACPI" = "y" ]; then
+ run_test_status $command -kernel "$@"
+ else
+ run_test $command -kernel "$@"
+ fi
+}
+
+function arch_run_kvmtool()
+{
+ local command
+
+ kvmtool=$(search_kvmtool_binary) ||
+ exit $?
+
+ if [ "$ACCEL" ] && [ "$ACCEL" != "kvm" ]; then
+ echo "kvmtool does not support $ACCEL" >&2
+ exit 2
+ fi
+
+ if ! kvm_available; then
+ echo "kvmtool requires KVM but not available on the host" >&2
+ exit 2
+ fi
+
+ command="$(timeout_cmd) $kvmtool run"
+ if [ "$HOST" = "aarch64" ] && [ "$ARCH" = "arm" ]; then
+ run_test_status $command --kernel "$@" --aarch32
+ else
+ run_test_status $command --kernel "$@"
+ fi
+}
+
+case $(vmm_get_target) in
+qemu)
+ arch_run_qemu "$@"
+ ;;
+kvmtool)
+ arch_run_kvmtool "$@"
+ ;;
+esac
diff --git a/powerpc/run b/powerpc/run
index 27abf1ef6a4d..0665776448eb 100755
--- a/powerpc/run
+++ b/powerpc/run
@@ -16,6 +16,7 @@ if [ -z "$KUT_STANDALONE" ]; then
fi
source config.mak
source scripts/arch-run.bash
+ source scripts/vmm.bash
fi
set_qemu_accelerator || exit $?
@@ -59,8 +60,8 @@ command+=" -display none -serial stdio -kernel"
command="$(migration_cmd) $(timeout_cmd) $command"
# powerpc tests currently exit with rtas-poweroff, which exits with 0.
-# run_qemu treats that as a failure exit and returns 1, so we need
+# run_test treats that as a failure exit and returns 1, so we need
# to fixup the fixup below by parsing the true exit code from the output.
# The second fixup is also a FIXME, because once we add chr-testdev
# support for powerpc, we won't need the second fixup.
-run_qemu_status $command "$@"
+run_test_status $command "$@"
diff --git a/riscv/run b/riscv/run
index 3b2fc36f2afb..0f000f0d82c6 100755
--- a/riscv/run
+++ b/riscv/run
@@ -7,6 +7,7 @@ if [ -z "$KUT_STANDALONE" ]; then
fi
source config.mak
source scripts/arch-run.bash
+ source scripts/vmm.bash
fi
# Allow user overrides of some config.mak variables
@@ -36,8 +37,8 @@ command+=" $mach $acc $firmware -cpu $qemu_cpu "
command="$(migration_cmd) $(timeout_cmd) $command"
if [ "$UEFI_SHELL_RUN" = "y" ]; then
- ENVIRON_DEFAULT=n run_qemu_status $command "$@"
+ ENVIRON_DEFAULT=n run_test_status $command "$@"
else
# We return the exit code via stdout, not via the QEMU return code
- run_qemu_status $command -kernel "$@"
+ run_test_status $command -kernel "$@"
fi
diff --git a/s390x/run b/s390x/run
index 34552c2747d4..c9ca38cd9d0c 100755
--- a/s390x/run
+++ b/s390x/run
@@ -7,6 +7,7 @@ if [ -z "$KUT_STANDALONE" ]; then
fi
source config.mak
source scripts/arch-run.bash
+ source scripts/vmm.bash
fi
set_qemu_accelerator || exit $?
@@ -47,4 +48,4 @@ command+=" -kernel"
command="$(panic_cmd) $(migration_cmd) $(timeout_cmd) $command"
# We return the exit code via stdout, not via the QEMU return code
-run_qemu_status $command "$@"
+run_test_status $command "$@"
diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
index 8643bab3b252..354ce80fe3fa 100644
--- a/scripts/arch-run.bash
+++ b/scripts/arch-run.bash
@@ -1,32 +1,6 @@
-##############################################################################
-# run_qemu translates the ambiguous exit status in Table1 to that in Table2.
-# Table3 simply documents the complete status table.
-#
-# Table1: Before fixup
-# --------------------
-# 0 - Unexpected exit from QEMU (possible signal), or the unittest did
-# not use debug-exit
-# 1 - most likely unittest succeeded, or QEMU failed
-#
-# Table2: After fixup
-# -------------------
-# 0 - Everything succeeded
-# 1 - most likely QEMU failed
-#
-# Table3: Complete table
-# ----------------------
-# 0 - SUCCESS
-# 1 - most likely QEMU failed
-# 2 - most likely a run script failed
-# 3 - most likely the unittest failed
-# 124 - most likely the unittest timed out
-# 127 - most likely the unittest called abort()
-# 1..127 - FAILURE (could be QEMU, a run script, or the unittest)
-# >= 128 - Signal (signum = status - 128)
-##############################################################################
-run_qemu ()
+run_test ()
{
- local stdout errors ret sig
+ local stdout errors ret
initrd_create || return $?
echo -n "$@"
@@ -39,48 +13,17 @@ run_qemu ()
ret=$?
exec {stdout}>&-
- [ $ret -eq 134 ] && echo "QEMU Aborted" >&2
-
- if [ "$errors" ]; then
- sig=$(grep 'terminating on signal' <<<"$errors")
- if [ "$sig" ]; then
- # This is too complex for ${var/search/replace}
- # shellcheck disable=SC2001
- sig=$(sed 's/.*terminating on signal \([0-9][0-9]*\).*/\1/' <<<"$sig")
- fi
- fi
-
- if [ $ret -eq 0 ]; then
- # Some signals result in a zero return status, but the
- # error log tells the truth.
- if [ "$sig" ]; then
- ((ret=sig+128))
- else
- # Exiting with zero (non-debugexit) is an error
- ret=1
- fi
- elif [ $ret -eq 1 ]; then
- # Even when ret==1 (unittest success) if we also got stderr
- # logs, then we assume a QEMU failure. Otherwise we translate
- # status of 1 to 0 (SUCCESS)
- if [ "$errors" ]; then
- if ! grep -qvi warning <<<"$errors" ; then
- ret=0
- fi
- else
- ret=0
- fi
- fi
+ ret=$(vmm_fixup_return_code $ret $errors)
return $ret
}
-run_qemu_status ()
+run_test_status ()
{
local stdout ret
exec {stdout}>&1
- lines=$(run_qemu "$@" > >(tee /dev/fd/$stdout))
+ lines=$(run_test "$@" > >(tee /dev/fd/$stdout))
ret=$?
exec {stdout}>&-
@@ -422,6 +365,25 @@ search_qemu_binary ()
export PATH=$save_path
}
+search_kvmtool_binary ()
+{
+ local kvmtoolcmd kvmtool
+
+ for kvmtoolcmd in lkvm vm lkvm-static; do
+ if "$kvmtoolcmd" --help 2>/dev/null| grep -q 'The most commonly used'; then
+ kvmtool="$kvmtoolcmd"
+ break
+ fi
+ done
+
+ if [ -z "$kvmtool" ]; then
+ echo "A kvmtool binary was not found." >&2
+ return 2
+ fi
+
+ command -v $kvmtool
+}
+
initrd_cleanup ()
{
rm -f $KVM_UNIT_TESTS_ENV
@@ -447,7 +409,7 @@ initrd_create ()
fi
unset INITRD
- [ -f "$KVM_UNIT_TESTS_ENV" ] && INITRD="-initrd $KVM_UNIT_TESTS_ENV"
+ [ -f "$KVM_UNIT_TESTS_ENV" ] && INITRD="$(vmm_optname_initrd) $KVM_UNIT_TESTS_ENV"
return 0
}
@@ -471,18 +433,23 @@ env_params ()
local qemu have_qemu
local _ rest
- qemu=$(search_qemu_binary) && have_qemu=1
+ env_add_params TARGET
- if [ "$have_qemu" ]; then
- if [ -n "$ACCEL" ] || [ -n "$QEMU_ACCEL" ]; then
- [ -n "$ACCEL" ] && QEMU_ACCEL=$ACCEL
+ # kvmtool's versioning has been broken since it was split from the
+ # kernel source.
+ if [ "$(vmm_get_target)" = "qemu" ]; then
+ qemu=$(search_qemu_binary) && have_qemu=1
+ if [ "$have_qemu" ]; then
+ if [ -n "$ACCEL" ] || [ -n "$QEMU_ACCEL" ]; then
+ [ -n "$ACCEL" ] && QEMU_ACCEL=$ACCEL
+ fi
+ QEMU_VERSION_STRING="$($qemu -h | head -1)"
+ # Shellcheck does not see QEMU_MAJOR|MINOR|MICRO are used
+ # shellcheck disable=SC2034
+ IFS='[ .]' read -r _ _ _ QEMU_MAJOR QEMU_MINOR QEMU_MICRO rest <<<"$QEMU_VERSION_STRING"
fi
- QEMU_VERSION_STRING="$($qemu -h | head -1)"
- # Shellcheck does not see QEMU_MAJOR|MINOR|MICRO are used
- # shellcheck disable=SC2034
- IFS='[ .]' read -r _ _ _ QEMU_MAJOR QEMU_MINOR QEMU_MICRO rest <<<"$QEMU_VERSION_STRING"
+ env_add_params QEMU_ACCEL QEMU_VERSION_STRING QEMU_MAJOR QEMU_MINOR QEMU_MICRO
fi
- env_add_params QEMU_ACCEL QEMU_VERSION_STRING QEMU_MAJOR QEMU_MINOR QEMU_MICRO
KERNEL_VERSION_STRING=$(uname -r)
IFS=. read -r KERNEL_VERSION KERNEL_PATCHLEVEL rest <<<"$KERNEL_VERSION_STRING"
diff --git a/scripts/vmm.bash b/scripts/vmm.bash
index 9a2608eb3fd4..0dd3f971ecdf 100644
--- a/scripts/vmm.bash
+++ b/scripts/vmm.bash
@@ -1,6 +1,95 @@
+##############################################################################
+# qemu_fixup_return_code translates the ambiguous exit status in Table1 to that
+# in Table2. Table3 simply documents the complete status table.
+#
+# Table1: Before fixup
+# --------------------
+# 0 - Unexpected exit from QEMU (possible signal), or the unittest did
+# not use debug-exit
+# 1 - most likely unittest succeeded, or QEMU failed
+#
+# Table2: After fixup
+# -------------------
+# 0 - Everything succeeded
+# 1 - most likely QEMU failed
+#
+# Table3: Complete table
+# ----------------------
+# 0 - SUCCESS
+# 1 - most likely QEMU failed
+# 2 - most likely a run script failed
+# 3 - most likely the unittest failed
+# 124 - most likely the unittest timed out
+# 127 - most likely the unittest called abort()
+# 1..127 - FAILURE (could be QEMU, a run script, or the unittest)
+# >= 128 - Signal (signum = status - 128)
+##############################################################################
+function qemu_fixup_return_code()
+{
+ local ret=$1
+ # Remove $ret from the list of arguments
+ shift 1
+ local errors=$*
+ local sig
+
+ [ $ret -eq 134 ] && echo "QEMU Aborted" >&2
+
+ if [ "$errors" ]; then
+ sig=$(grep 'terminating on signal' <<<"$errors")
+ if [ "$sig" ]; then
+ # This is too complex for ${var/search/replace}
+ # shellcheck disable=SC2001
+ sig=$(sed 's/.*terminating on signal \([0-9][0-9]*\).*/\1/' <<<"$sig")
+ fi
+ fi
+
+ if [ $ret -eq 0 ]; then
+ # Some signals result in a zero return status, but the
+ # error log tells the truth.
+ if [ "$sig" ]; then
+ ((ret=sig+128))
+ else
+ # Exiting with zero (non-debugexit) is an error
+ ret=1
+ fi
+ elif [ $ret -eq 1 ]; then
+ # Even when ret==1 (unittest success) if we also got stderr
+ # logs, then we assume a QEMU failure. Otherwise we translate
+ # status of 1 to 0 (SUCCESS)
+ if [ "$errors" ]; then
+ if ! grep -qvi warning <<<"$errors" ; then
+ ret=0
+ fi
+ else
+ ret=0
+ fi
+ fi
+
+ echo $ret
+}
+
+function kvmtool_fixup_return_code()
+{
+ local ret=$1
+
+ # Force run_test_status() to interpret the STATUS line.
+ if [ $ret -eq 0 ]; then
+ ret=1
+ fi
+
+ echo $ret
+}
+
declare -A vmm_optname=(
[qemu,args]='-append'
+ [qemu,fixup_return_code]=qemu_fixup_return_code
+ [qemu,initrd]='-initrd'
[qemu,nr_cpus]='-smp'
+
+ [kvmtool,args]='--params'
+ [kvmtool,fixup_return_code]=kvmtool_fixup_return_code
+ [kvmtool,initrd]='--initrd'
+ [kvmtool,nr_cpus]='--cpus'
)
function vmm_optname_args()
@@ -8,6 +97,16 @@ function vmm_optname_args()
echo ${vmm_optname[$(vmm_get_target),args]}
}
+function vmm_fixup_return_code()
+{
+ ${vmm_optname[$(vmm_get_target),fixup_return_code]} "$@"
+}
+
+function vmm_optname_initrd()
+{
+ echo ${vmm_optname[$(vmm_get_target),initrd]}
+}
+
function vmm_optname_nr_cpus()
{
echo ${vmm_optname[$(vmm_get_target),nr_cpus]}
@@ -48,6 +147,9 @@ function vmm_unittest_params_name()
qemu)
echo "extra_params|qemu_params"
;;
+ kvmtool)
+ echo "kvmtool_params"
+ ;;
*)
echo "$0 does not support '$target'"
exit 2
diff --git a/x86/run b/x86/run
index a3d3e7db8891..9d21cf3e188d 100755
--- a/x86/run
+++ b/x86/run
@@ -7,6 +7,7 @@ if [ -z "$KUT_STANDALONE" ]; then
fi
source config.mak
source scripts/arch-run.bash
+ source scripts/vmm.bash
fi
set_qemu_accelerator || exit $?
@@ -49,7 +50,7 @@ if [ "${CONFIG_EFI}" = y ]; then
# UEFI, the test case binaries are passed to QEMU through the disk
# image, not through the '-kernel' flag. And QEMU reports an error if it
# gets '-initrd' without a '-kernel'
- ENVIRON_DEFAULT=n run_qemu ${command} "$@"
+ ENVIRON_DEFAULT=n run_test ${command} "$@"
else
- run_qemu ${command} "$@"
+ run_test ${command} "$@"
fi
--
2.50.0
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v4 07/13] scripts: Add default arguments for kvmtool
2025-06-25 15:48 [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Alexandru Elisei
` (5 preceding siblings ...)
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 06/13] scripts: Add support for kvmtool Alexandru Elisei
@ 2025-06-25 15:48 ` Alexandru Elisei
2025-06-26 15:43 ` Andrew Jones
2025-07-11 11:32 ` Thomas Huth
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 08/13] scripts: Add KVMTOOL environment variable for kvmtool binary path Alexandru Elisei
` (8 subsequent siblings)
15 siblings, 2 replies; 26+ messages in thread
From: Alexandru Elisei @ 2025-06-25 15:48 UTC (permalink / raw)
To: andrew.jones, eric.auger, lvivier, thuth, frankja, imbrenda, nrb,
david, pbonzini
Cc: kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
kvmtool, unless told otherwise, will do its best to make sure that a kernel
successfully boots in a virtual machine. It does things like automatically
creating a rootfs and adding extra parameters to the kernel command line.
This is actively harmful to kvm-unit-tests, because some tests parse the
kernel command line and they will fail if they encounter the options added
by kvmtool.
Fortunately for us, kvmtool commit 5613ae26b998 ("Add --nodefaults command
line argument") addded the --nodefaults kvmtool parameter which disables
all the implicit virtual machine configuration that cannot be disabled by
using other parameters, like modifying the kernel command line. So always
use --nodefaults to allow a test to run.
kvmtool can also be too verbose when running a virtual machine, and this is
controlled by several parameters. Add those to the default kvmtool command
line to reduce this verbosity to a minimum.
Before:
$ vm run arm/selftest.flat --cpus 2 --mem 256 --params "setup smp=2 mem=256"
Info: # lkvm run -k arm/selftest.flat -m 256 -c 2 --name guest-5035
Unknown subtest
EXIT: STATUS=127
Warning: KVM compatibility warning.
virtio-9p device was not detected.
While you have requested a virtio-9p device, the guest kernel did not initialize it.
Please make sure that the guest kernel was compiled with CONFIG_NET_9P_VIRTIO=y enabled in .config.
Warning: KVM compatibility warning.
virtio-net device was not detected.
While you have requested a virtio-net device, the guest kernel did not initialize it.
Please make sure that the guest kernel was compiled with CONFIG_VIRTIO_NET=y enabled in .config.
Info: KVM session ended normally.
After:
$ vm run arm/selftest.flat --nodefaults --network mode=none --loglevel=warning --cpus 2 --mem 256 --params "setup smp=2 mem=256"
PASS: selftest: setup: smp: number of CPUs matches expectation
INFO: selftest: setup: smp: found 2 CPUs
PASS: selftest: setup: mem: memory size matches expectation
INFO: selftest: setup: mem: found 256 MB
SUMMARY: 2 tests
EXIT: STATUS=1
Note that KVMTOOL_DEFAULT_OPTS can be overwritten by an environment
variable with the same name, but it's not documented in the help string for
run_tests.sh. This has been done on purpose, since overwritting
KVMTOOL_DEFAULT_OPTS should only be necessary for debugging or development
purposes.
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
Changes v3->v4:
* Use vmm_default_opts() instead of indexing into vmm_optname
* Reworded the help test for --nodefaults as per Shaoqin's suggestion.
scripts/common.bash | 6 +++---
scripts/vmm.bash | 18 ++++++++++++++++++
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/scripts/common.bash b/scripts/common.bash
index 7c1b89f1b3c2..d5d3101c8089 100644
--- a/scripts/common.bash
+++ b/scripts/common.bash
@@ -37,7 +37,7 @@ function for_each_unittest()
# -append as a kernel parameter instead of a command
# line option.
test_args=""
- opts=""
+ opts="$(vmm_default_opts)"
groups=""
arch=""
machine=""
@@ -51,7 +51,7 @@ function for_each_unittest()
elif [[ $line =~ ^test_args\ *=\ *(.*)$ ]]; then
test_args="$(vmm_optname_args) ${BASH_REMATCH[1]}"
elif [[ $line =~ ^$params_name\ *=\ *'"""'(.*)$ ]]; then
- opts=${BASH_REMATCH[1]}$'\n'
+ opts="$(vmm_defaults_opts) ${BASH_REMATCH[1]}$'\n'"
while read -r -u $fd; do
#escape backslash newline, but not double backslash
if [[ $opts =~ [^\\]*(\\*)$'\n'$ ]]; then
@@ -67,7 +67,7 @@ function for_each_unittest()
fi
done
elif [[ $line =~ ^$params_name\ *=\ *(.*)$ ]]; then
- opts=${BASH_REMATCH[1]}
+ opts="$(vmm_default_opts) ${BASH_REMATCH[1]}"
elif [[ $line =~ ^groups\ *=\ *(.*)$ ]]; then
groups=${BASH_REMATCH[1]}
elif [[ $line =~ ^arch\ *=\ *(.*)$ ]]; then
diff --git a/scripts/vmm.bash b/scripts/vmm.bash
index 0dd3f971ecdf..368690d62473 100644
--- a/scripts/vmm.bash
+++ b/scripts/vmm.bash
@@ -1,3 +1,14 @@
+# The following parameters are enabled by default when running a test with
+# kvmtool:
+# --nodefaults: suppress VM configuration that cannot be disabled (like
+# modifying the supplied kernel command line). Otherwise tests
+# that use the command line will fail without this parameter.
+# --network mode=none: do not create a network device. kvmtool tries to help the
+# user by automatically create one, and then prints a warning
+# when the VM terminates if the device hasn't been initialized.
+# --loglevel=warning: reduce verbosity
+: "${KVMTOOL_DEFAULT_OPTS:="--nodefaults --network mode=none --loglevel=warning"}"
+
##############################################################################
# qemu_fixup_return_code translates the ambiguous exit status in Table1 to that
# in Table2. Table3 simply documents the complete status table.
@@ -82,11 +93,13 @@ function kvmtool_fixup_return_code()
declare -A vmm_optname=(
[qemu,args]='-append'
+ [qemu,default_opts]=''
[qemu,fixup_return_code]=qemu_fixup_return_code
[qemu,initrd]='-initrd'
[qemu,nr_cpus]='-smp'
[kvmtool,args]='--params'
+ [kvmtool,default_opts]="$KVMTOOL_DEFAULT_OPTS"
[kvmtool,fixup_return_code]=kvmtool_fixup_return_code
[kvmtool,initrd]='--initrd'
[kvmtool,nr_cpus]='--cpus'
@@ -97,6 +110,11 @@ function vmm_optname_args()
echo ${vmm_optname[$(vmm_get_target),args]}
}
+function vmm_default_opts()
+{
+ echo ${vmm_optname[$(vmm_get_target),default_opts]}
+}
+
function vmm_fixup_return_code()
{
${vmm_optname[$(vmm_get_target),fixup_return_code]} "$@"
--
2.50.0
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v4 08/13] scripts: Add KVMTOOL environment variable for kvmtool binary path
2025-06-25 15:48 [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Alexandru Elisei
` (6 preceding siblings ...)
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 07/13] scripts: Add default arguments " Alexandru Elisei
@ 2025-06-25 15:48 ` Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 09/13] scripts: Detect kvmtool failure in premature_failure() Alexandru Elisei
` (7 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Alexandru Elisei @ 2025-06-25 15:48 UTC (permalink / raw)
To: andrew.jones, eric.auger, lvivier, thuth, frankja, imbrenda, nrb,
david, pbonzini
Cc: kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
kvmtool is often used for prototyping new features, and a developer might
not want to install it system-wide. Add a KVMTOOL environment variable to
make it easier for tests to use a binary not in $PATH.
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
run_tests.sh | 1 +
scripts/arch-run.bash | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/run_tests.sh b/run_tests.sh
index dd9d27377905..150a06a91064 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -36,6 +36,7 @@ The following environment variables are used:
TIMEOUT Timeout duration for the timeout(1) command
CHECK Overwrites the 'check' unit test parameter (see
docs/unittests.txt)
+ KVMTOOL Path to kvmtool binary for ARCH-run
EOF
}
diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
index 354ce80fe3fa..c440f2162bac 100644
--- a/scripts/arch-run.bash
+++ b/scripts/arch-run.bash
@@ -369,7 +369,7 @@ search_kvmtool_binary ()
{
local kvmtoolcmd kvmtool
- for kvmtoolcmd in lkvm vm lkvm-static; do
+ for kvmtoolcmd in ${KVMTOOL:-lkvm vm lkvm-static}; do
if "$kvmtoolcmd" --help 2>/dev/null| grep -q 'The most commonly used'; then
kvmtool="$kvmtoolcmd"
break
@@ -378,6 +378,7 @@ search_kvmtool_binary ()
if [ -z "$kvmtool" ]; then
echo "A kvmtool binary was not found." >&2
+ echo "You can set a custom location by using the KVMTOOL=<path> environment variable." >&2
return 2
fi
--
2.50.0
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v4 09/13] scripts: Detect kvmtool failure in premature_failure()
2025-06-25 15:48 [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Alexandru Elisei
` (7 preceding siblings ...)
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 08/13] scripts: Add KVMTOOL environment variable for kvmtool binary path Alexandru Elisei
@ 2025-06-25 15:48 ` Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 10/13] scripts: Do not probe for maximum number of VCPUs when using kvmtool Alexandru Elisei
` (6 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Alexandru Elisei @ 2025-06-25 15:48 UTC (permalink / raw)
To: andrew.jones, eric.auger, lvivier, thuth, frankja, imbrenda, nrb,
david, pbonzini
Cc: kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
kvm-unit-tests assumes that if the VMM is able to get to where it tries to
load the kernel, then the VMM and the configuration parameters will also
work for running the test. All of this is done in premature_failure().
Teach premature_failure() about the kvmtool's error message when it fails
to load the dummy kernel.
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
Changes v3->v4:
* Use vmm_parse_premature_failure() in
scripts/runtime.bash::premature_failure().
* Do not source scripts/vmm.bash in scripts/runtime.bash to avoid errors in
the standalone tests.
scripts/mkstandalone.sh | 1 +
scripts/runtime.bash | 6 +-----
scripts/vmm.bash | 28 ++++++++++++++++++++++++++++
3 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh
index 9c5768563757..ebf425564af5 100755
--- a/scripts/mkstandalone.sh
+++ b/scripts/mkstandalone.sh
@@ -81,6 +81,7 @@ generate_test ()
echo "RUNTIME_log_stdout () { cat >&\$stdout; }"
echo "RUNTIME_log_stderr () { cat >&2; }"
+ cat scripts/vmm.bash
cat scripts/runtime.bash
echo "run ${args[*]}"
diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index 86d8a2cd8528..5839ca5ca665 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -19,11 +19,7 @@ premature_failure()
log="$(eval "$(get_cmdline _NO_FILE_4Uhere_)" 2>&1)"
- echo "$log" | grep "_NO_FILE_4Uhere_" |
- grep -q -e "[Cc]ould not \(load\|open\) kernel" \
- -e "error loading" \
- -e "failed to load" &&
- return 1
+ vmm_parse_premature_failure "$log" || return 1
RUNTIME_log_stderr <<< "$log"
diff --git a/scripts/vmm.bash b/scripts/vmm.bash
index 368690d62473..44954a711cad 100644
--- a/scripts/vmm.bash
+++ b/scripts/vmm.bash
@@ -79,6 +79,18 @@ function qemu_fixup_return_code()
echo $ret
}
+function qemu_parse_premature_failure()
+{
+ local log=$*
+
+ echo "$log" | grep "_NO_FILE_4Uhere_" |
+ grep -q -e "[Cc]ould not \(load\|open\) kernel" \
+ -e "error loading" \
+ -e "failed to load" &&
+ return 1
+ return 0
+}
+
function kvmtool_fixup_return_code()
{
local ret=$1
@@ -91,18 +103,29 @@ function kvmtool_fixup_return_code()
echo $ret
}
+function kvmtool_parse_premature_failure()
+{
+ local log=$*
+
+ echo "$log" | grep "Fatal: Unable to open kernel _NO_FILE_4Uhere_" &&
+ return 1
+ return 0
+}
+
declare -A vmm_optname=(
[qemu,args]='-append'
[qemu,default_opts]=''
[qemu,fixup_return_code]=qemu_fixup_return_code
[qemu,initrd]='-initrd'
[qemu,nr_cpus]='-smp'
+ [qemu,parse_premature_failure]=qemu_parse_premature_failure
[kvmtool,args]='--params'
[kvmtool,default_opts]="$KVMTOOL_DEFAULT_OPTS"
[kvmtool,fixup_return_code]=kvmtool_fixup_return_code
[kvmtool,initrd]='--initrd'
[kvmtool,nr_cpus]='--cpus'
+ [kvmtool,parse_premature_failure]=kvmtool_parse_premature_failure
)
function vmm_optname_args()
@@ -130,6 +153,11 @@ function vmm_optname_nr_cpus()
echo ${vmm_optname[$(vmm_get_target),nr_cpus]}
}
+function vmm_parse_premature_failure()
+{
+ ${vmm_optname[$(vmm_get_target),parse_premature_failure]} "$@"
+}
+
function vmm_get_target()
{
if [[ -z "$TARGET" ]]; then
--
2.50.0
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v4 10/13] scripts: Do not probe for maximum number of VCPUs when using kvmtool
2025-06-25 15:48 [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Alexandru Elisei
` (8 preceding siblings ...)
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 09/13] scripts: Detect kvmtool failure in premature_failure() Alexandru Elisei
@ 2025-06-25 15:48 ` Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 11/13] scripts/mkstandalone: Export $TARGET Alexandru Elisei
` (5 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Alexandru Elisei @ 2025-06-25 15:48 UTC (permalink / raw)
To: andrew.jones, eric.auger, lvivier, thuth, frankja, imbrenda, nrb,
david, pbonzini
Cc: kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
The --probe-maxsmp parameter updates MAX_SMP with the maximum number of
VCPUs that the host supports. Qemu will exit with an error when creating a
virtual machine if the number of VCPUs is exceeded.
kvmtool behaves differently: it will automatically limit the number of
VCPUs to the what KVM supports, which is exactly what --probe-maxsmp wants
to achieve. When doing --probe-maxsmp with kvmtool, print a message
explaining why it's redundant and don't do anything else.
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
Changes v3->v4:
* Use vmmm_probe_maxsmp() instead of indexing vmm_optname in run_tests.sh.
run_tests.sh | 3 ++-
scripts/runtime.bash | 16 ----------------
scripts/vmm.bash | 30 ++++++++++++++++++++++++++++++
3 files changed, 32 insertions(+), 17 deletions(-)
diff --git a/run_tests.sh b/run_tests.sh
index 150a06a91064..4cfc3cd9e4cf 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -10,6 +10,7 @@ if [ ! -f config.mak ]; then
fi
source config.mak
source scripts/common.bash
+source scripts/vmm.bash
function usage()
{
@@ -90,7 +91,7 @@ while [ $# -gt 0 ]; do
list_tests="yes"
;;
--probe-maxsmp)
- probe_maxsmp
+ vmm_probe_maxsmp $RUNTIME_arch_run
;;
--)
;;
diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index 5839ca5ca665..766d1d28fb75 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -207,19 +207,3 @@ function run()
return $ret
}
-
-#
-# Probe for MAX_SMP, in case it's less than the number of host cpus.
-#
-function probe_maxsmp()
-{
- local smp
-
- if smp=$($RUNTIME_arch_run _NO_FILE_4Uhere_ -smp $MAX_SMP |& grep 'SMP CPUs'); then
- smp=${smp##* }
- smp=${smp/\(}
- smp=${smp/\)}
- echo "Restricting MAX_SMP from ($MAX_SMP) to the max supported ($smp)" >&2
- MAX_SMP=$smp
- fi
-}
diff --git a/scripts/vmm.bash b/scripts/vmm.bash
index 44954a711cad..724c96f9e665 100644
--- a/scripts/vmm.bash
+++ b/scripts/vmm.bash
@@ -91,6 +91,23 @@ function qemu_parse_premature_failure()
return 0
}
+#
+# Probe for MAX_SMP, in case it's less than the number of host cpus.
+#
+function qemu_probe_maxsmp()
+{
+ local runtime_arch_run="$1"
+ local smp
+
+ if smp=$($runtime_arch_run _NO_FILE_4Uhere_ -smp $MAX_SMP |& grep 'SMP CPUs'); then
+ smp=${smp##* }
+ smp=${smp/\(}
+ smp=${smp/\)}
+ echo "Restricting MAX_SMP from ($MAX_SMP) to the max supported ($smp)" >&2
+ MAX_SMP=$smp
+ fi
+}
+
function kvmtool_fixup_return_code()
{
local ret=$1
@@ -112,6 +129,12 @@ function kvmtool_parse_premature_failure()
return 0
}
+function kvmtool_probe_maxsmp()
+{
+ echo "kvmtool automatically limits the number of VCPUs to maximum supported"
+ echo "The 'smp' test parameter won't be modified"
+}
+
declare -A vmm_optname=(
[qemu,args]='-append'
[qemu,default_opts]=''
@@ -119,6 +142,7 @@ declare -A vmm_optname=(
[qemu,initrd]='-initrd'
[qemu,nr_cpus]='-smp'
[qemu,parse_premature_failure]=qemu_parse_premature_failure
+ [qemu,probe_maxsmp]=qemu_probe_maxsmp
[kvmtool,args]='--params'
[kvmtool,default_opts]="$KVMTOOL_DEFAULT_OPTS"
@@ -126,6 +150,7 @@ declare -A vmm_optname=(
[kvmtool,initrd]='--initrd'
[kvmtool,nr_cpus]='--cpus'
[kvmtool,parse_premature_failure]=kvmtool_parse_premature_failure
+ [kvmtool,probe_maxsmp]=kvmtool_probe_maxsmp
)
function vmm_optname_args()
@@ -158,6 +183,11 @@ function vmm_parse_premature_failure()
${vmm_optname[$(vmm_get_target),parse_premature_failure]} "$@"
}
+function vmm_probe_maxsmp()
+{
+ ${vmm_optname[$(vmm_get_target),probe_maxsmp]} "$1"
+}
+
function vmm_get_target()
{
if [[ -z "$TARGET" ]]; then
--
2.50.0
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v4 11/13] scripts/mkstandalone: Export $TARGET
2025-06-25 15:48 [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Alexandru Elisei
` (9 preceding siblings ...)
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 10/13] scripts: Do not probe for maximum number of VCPUs when using kvmtool Alexandru Elisei
@ 2025-06-25 15:48 ` Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 12/13] scripts: Add 'disabled_if' test definition parameter for kvmtool to use Alexandru Elisei
` (4 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Alexandru Elisei @ 2025-06-25 15:48 UTC (permalink / raw)
To: andrew.jones, eric.auger, lvivier, thuth, frankja, imbrenda, nrb,
david, pbonzini
Cc: kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
$TARGET is needed for the test runner to decide if it should use qemu or
kvmtool, so export it.
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
scripts/mkstandalone.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh
index ebf425564af5..5a23bb59879e 100755
--- a/scripts/mkstandalone.sh
+++ b/scripts/mkstandalone.sh
@@ -47,6 +47,7 @@ generate_test ()
config_export ARCH_NAME
config_export TARGET_CPU
config_export DEFAULT_QEMU_CPU
+ config_export TARGET
echo "echo BUILD_HEAD=$(cat build-head)"
--
2.50.0
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v4 12/13] scripts: Add 'disabled_if' test definition parameter for kvmtool to use
2025-06-25 15:48 [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Alexandru Elisei
` (10 preceding siblings ...)
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 11/13] scripts/mkstandalone: Export $TARGET Alexandru Elisei
@ 2025-06-25 15:48 ` Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 13/13] scripts: Enable kvmtool Alexandru Elisei
` (3 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Alexandru Elisei @ 2025-06-25 15:48 UTC (permalink / raw)
To: andrew.jones, eric.auger, lvivier, thuth, frankja, imbrenda, nrb,
david, pbonzini
Cc: kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
The pci-test is qemu specific. Other tests perform migration, which
isn't supported by kvmtool. In general, kvmtool is not as feature-rich
as qemu, so add a new unittest parameter, 'disabled_if', that causes a
test to be skipped if the condition evaluates to true.
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
arm/unittests.cfg | 7 +++++++
docs/unittests.txt | 13 +++++++++++++
scripts/common.bash | 6 +++++-
scripts/runtime.bash | 6 ++++++
4 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/arm/unittests.cfg b/arm/unittests.cfg
index 343c14567f27..12fc4468d0fd 100644
--- a/arm/unittests.cfg
+++ b/arm/unittests.cfg
@@ -43,6 +43,7 @@ groups = selftest
[pci-test]
file = pci-test.flat
groups = pci
+disabled_if = [[ "$TARGET" != qemu ]]
# Test PMU support
[pmu-cycle-counter]
@@ -219,6 +220,7 @@ test_args = its-migration
qemu_params = -machine gic-version=3
kvmtool_params = --irqchip=gicv3
groups = its migration
+disabled_if = [[ "$TARGET" != qemu ]]
arch = arm64
[its-pending-migration]
@@ -228,6 +230,7 @@ test_args = its-pending-migration
qemu_params = -machine gic-version=3
kvmtool_params = --irqchip=gicv3
groups = its migration
+disabled_if = [[ "$TARGET" != qemu ]]
arch = arm64
[its-migrate-unmapped-collection]
@@ -237,6 +240,7 @@ test_args = its-migrate-unmapped-collection
qemu_params = -machine gic-version=3
kvmtool_params = --irqchip=gicv3
groups = its migration
+disabled_if = [[ "$TARGET" != qemu ]]
arch = arm64
# Test PSCI emulation
@@ -278,6 +282,7 @@ file = debug.flat
arch = arm64
test_args = bp-migration
groups = debug migration
+disabled_if = [[ "$TARGET" != qemu ]]
[debug-wp]
file = debug.flat
@@ -290,6 +295,7 @@ file = debug.flat
arch = arm64
test_args = wp-migration
groups = debug migration
+disabled_if = [[ "$TARGET" != qemu ]]
[debug-sstep]
file = debug.flat
@@ -302,6 +308,7 @@ file = debug.flat
arch = arm64
test_args = ss-migration
groups = debug migration
+disabled_if = [[ "$TARGET" != qemu ]]
# FPU/SIMD test
[fpu-context]
diff --git a/docs/unittests.txt b/docs/unittests.txt
index a9164bccc24c..921318a6d85a 100644
--- a/docs/unittests.txt
+++ b/docs/unittests.txt
@@ -124,3 +124,16 @@ parameter needs to be of the form <path>=<value>
The path and value cannot contain space, =, or shell wildcard characters.
Can be overwritten with the CHECK environment variable with the same syntax.
+
+disabled_if
+-----------
+disabled_if = <condition>
+
+Do not run the test if <condition> is met. <condition> will be fed unmodified
+to a bash 'if' statement and follows the same syntax.
+
+This can be used to prevent running a test when kvm-unit-tests is configured a
+certain way. For example, it can be used to skip a qemu specific test when
+using another VMM and using UEFI:
+
+disabled_if = [[ "$TARGET" != qemu ]] && [[ "$CONFIG_EFI" = y ]]
diff --git a/scripts/common.bash b/scripts/common.bash
index d5d3101c8089..283fb30f5533 100644
--- a/scripts/common.bash
+++ b/scripts/common.bash
@@ -16,6 +16,7 @@ function for_each_unittest()
local check
local accel
local timeout
+ local disabled_if
local rematch
# shellcheck disable=SC2155
@@ -27,7 +28,7 @@ function for_each_unittest()
if [[ "$line" =~ ^\[(.*)\]$ ]]; then
rematch=${BASH_REMATCH[1]}
if [ -n "${testname}" ]; then
- $(arch_cmd) "$cmd" "$testname" "$groups" "$smp" "$kernel" "$test_args" "$opts" "$arch" "$machine" "$check" "$accel" "$timeout"
+ $(arch_cmd) "$cmd" "$testname" "$groups" "$smp" "$kernel" "$test_args" "$opts" "$arch" "$machine" "$check" "$accel" "$timeout" "$disabled_if"
fi
testname=$rematch
smp="$(vmm_optname_nr_cpus) 1"
@@ -44,6 +45,7 @@ function for_each_unittest()
check=""
accel=""
timeout=""
+ disabled_if=""
elif [[ $line =~ ^file\ *=\ *(.*)$ ]]; then
kernel=$TEST_DIR/${BASH_REMATCH[1]}
elif [[ $line =~ ^smp\ *=\ *(.*)$ ]]; then
@@ -76,6 +78,8 @@ function for_each_unittest()
machine=${BASH_REMATCH[1]}
elif [[ $line =~ ^check\ *=\ *(.*)$ ]]; then
check=${BASH_REMATCH[1]}
+ elif [[ $line =~ ^disabled_if\ *=\ *(.*)$ ]]; then
+ disabled_if=${BASH_REMATCH[1]}
elif [[ $line =~ ^accel\ *=\ *(.*)$ ]]; then
accel=${BASH_REMATCH[1]}
elif [[ $line =~ ^timeout\ *=\ *(.*)$ ]]; then
diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index 766d1d28fb75..0ff8ad08bf1d 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -83,6 +83,7 @@ function run()
local check="${CHECK:-$9}"
local accel="${10}"
local timeout="${11:-$TIMEOUT}" # unittests.cfg overrides the default
+ local disabled_if="${12}"
if [ "${CONFIG_EFI}" == "y" ]; then
kernel=${kernel/%.flat/.efi}
@@ -130,6 +131,11 @@ function run()
accel="$ACCEL"
fi
+ if [[ "$disabled_if" ]] && (eval $disabled_if); then
+ print_result "SKIP" $testname "" "disabled because: $disabled_if"
+ return 2
+ fi
+
# check a file for a particular value before running a test
# the check line can contain multiple files to check separated by a space
# but each check parameter needs to be of the form <path>=<value>
--
2.50.0
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [kvm-unit-tests PATCH v4 13/13] scripts: Enable kvmtool
2025-06-25 15:48 [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Alexandru Elisei
` (11 preceding siblings ...)
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 12/13] scripts: Add 'disabled_if' test definition parameter for kvmtool to use Alexandru Elisei
@ 2025-06-25 15:48 ` Alexandru Elisei
2025-06-26 16:42 ` [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Andrew Jones
` (2 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Alexandru Elisei @ 2025-06-25 15:48 UTC (permalink / raw)
To: andrew.jones, eric.auger, lvivier, thuth, frankja, imbrenda, nrb,
david, pbonzini
Cc: kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
Everything is in place to run the tests using kvmtool:
$ ./configure --target=kvmtool
$ make clean && make
$ KVMTOOL=<path/to/kvmtool> ./run_tests.sh
so enable it, and remove ERRATA_FORCE=y when configuring for kvmtool,
because the runner will generate and pass the correct environment to
kvmtool.
Support for EFI tests is missing. That's because distros don't ship a
EDK2 binary compiled for kvmtool, and on top of that kvm-unit-tests as
an EFI app hasn't been tested to work with kvmtool.
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
README.md | 18 +++++++++++++++++-
arm/efi/run | 5 +++++
configure | 1 -
scripts/vmm.bash | 2 +-
4 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index be07dc28a094..723ce04cd978 100644
--- a/README.md
+++ b/README.md
@@ -65,6 +65,9 @@ or:
to run them all.
+All tests can be run using QEMU. On arm and arm64, tests can also be run using
+kvmtool.
+
By default the runner script searches for a suitable QEMU binary in the system.
To select a specific QEMU binary though, specify the QEMU=path/to/binary
environment variable:
@@ -78,12 +81,25 @@ ACCEL=name environment variable:
For running tests that involve migration from one QEMU instance to another
you also need to have the "ncat" binary (from the nmap.org project) installed,
-otherwise the related tests will be skipped.
+otherwise the related tests will be skipped. kvmtool does not support migration.
+
+As for running a test with kvmtool, please configure kvm-unit-tests accordingly
+first:
+
+ ./configure --arch=arm64 --target=kvmtool
+
+then run the test(s) like with QEMU above.
+
+To select a kvmtool binary, specify the KVMTOOL=path/to/binary environment
+variable. kvmtool supports only kvm as the accelerator.
## Running the tests with UEFI
Check [x86/efi/README.md](./x86/efi/README.md).
+On arm and arm64, this is only supported with QEMU; kvmtool cannot run the
+tests under UEFI.
+
# Tests configuration file
The test case may need specific runtime configurations, for
diff --git a/arm/efi/run b/arm/efi/run
index 38800e8bfa13..12d7a4186230 100755
--- a/arm/efi/run
+++ b/arm/efi/run
@@ -15,6 +15,11 @@ source scripts/vmm.bash
vmm_check_supported
+if [[ $(vmm_get_target) == "kvmtool" ]]; then
+ echo "kvmtool does not support EFI tests."
+ exit 2
+fi
+
if [ -f /usr/share/qemu-efi-aarch64/QEMU_EFI.fd ]; then
DEFAULT_UEFI=/usr/share/qemu-efi-aarch64/QEMU_EFI.fd
elif [ -f /usr/share/edk2/aarch64/QEMU_EFI.silent.fd ]; then
diff --git a/configure b/configure
index 20bf5042cb9e..470f9d7cdb3b 100755
--- a/configure
+++ b/configure
@@ -378,7 +378,6 @@ elif [ "$arch" = "arm" ] || [ "$arch" = "arm64" ]; then
: "${uart_early_addr:=0x9000000}"
elif [ "$target" = "kvmtool" ]; then
: "${uart_early_addr:=0x1000000}"
- errata_force=1
else
echo "--target must be one of 'qemu' or 'kvmtool'!"
usage
diff --git a/scripts/vmm.bash b/scripts/vmm.bash
index 724c96f9e665..f2c987d92405 100644
--- a/scripts/vmm.bash
+++ b/scripts/vmm.bash
@@ -204,7 +204,7 @@ function vmm_check_supported()
local target=$(vmm_get_target)
case "$target" in
- qemu)
+ qemu | kvmtool)
return 0
;;
*)
--
2.50.0
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v4 03/13] scripts: Refuse to run the tests if not configured for qemu
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 03/13] scripts: Refuse to run the tests if not configured for qemu Alexandru Elisei
@ 2025-06-26 15:25 ` Andrew Jones
0 siblings, 0 replies; 26+ messages in thread
From: Andrew Jones @ 2025-06-26 15:25 UTC (permalink / raw)
To: Alexandru Elisei
Cc: eric.auger, lvivier, thuth, frankja, imbrenda, nrb, david,
pbonzini, kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
On Wed, Jun 25, 2025 at 04:48:03PM +0100, Alexandru Elisei wrote:
> Arm and arm64 support running the tests under kvmtool. kvmtool has a
> different command line syntax for configuring and running a virtual
> machine, and the automated scripts know only how to use qemu.
>
> One issue with that is even though the tests have been configured for
> kvmtool (with ./configure --target=kvmtool), the scripts will use qemu to
> run the tests, and without looking at the logs there is no indication that
> the tests haven't been run with kvmtool, as configured.
>
> Another issue is that kvmtool uses a different address for the UART and
> when running the tests with qemu via the scripts, this warning is
> displayed:
>
> WARNING: early print support may not work. Found uart at 0x9000000, but early base is 0x1000000.
>
> which might trip up an unsuspected user.
>
> There are four different ways to run a test using the test infrastructure:
> with run_tests.sh, by invoking arm/run or arm/efi/run with the correct
> parameters (only the arm directory is mentioned here because the tests can
> be configured for kvmtool only on arm and arm64), and by creating
> standalone tests.
>
> run_tests.sh ends up executing either arm/run or arm/efi/run, so add a
> check to these two scripts for the test target, and refuse to run the test
> if kvm-unit-tests has been configured for kvmtool.
>
> mkstandalone.sh also executes arm/run or arm/efi run, but the usual use
> case for standalone tests is to compile them on one machine, and then to
> run them on a different machine. This two step process can be time
> consuming, so save the user time (and frustration!) and add a check
> directly to mkstandalone.sh.
>
> Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
> ---
>
> Changes v3->v4:
>
> * Renamed check_vmm_supported() to vmm_check_supported().
> * Added function vmm_get_target().
> * Added Reviewed-by from Shaoqin.
> * Fixed typo s/execuing/executing (Drew).
>
> arm/efi/run | 3 +++
> arm/run | 4 ++++
> scripts/mkstandalone.sh | 6 +++++-
> scripts/vmm.bash | 25 +++++++++++++++++++++++++
> 4 files changed, 37 insertions(+), 1 deletion(-)
> create mode 100644 scripts/vmm.bash
>
> diff --git a/arm/efi/run b/arm/efi/run
> index 8f41fc02df31..38800e8bfa13 100755
> --- a/arm/efi/run
> +++ b/arm/efi/run
> @@ -11,6 +11,9 @@ if [ ! -f config.mak ]; then
> fi
> source config.mak
> source scripts/arch-run.bash
> +source scripts/vmm.bash
> +
> +vmm_check_supported
>
> if [ -f /usr/share/qemu-efi-aarch64/QEMU_EFI.fd ]; then
> DEFAULT_UEFI=/usr/share/qemu-efi-aarch64/QEMU_EFI.fd
> diff --git a/arm/run b/arm/run
> index ef58558231b7..edf0c1dd1b41 100755
> --- a/arm/run
> +++ b/arm/run
> @@ -7,7 +7,11 @@ if [ -z "$KUT_STANDALONE" ]; then
> fi
> source config.mak
> source scripts/arch-run.bash
> + source scripts/vmm.bash
> fi
> +
> +vmm_check_supported
> +
> qemu_cpu="$TARGET_CPU"
>
> if [ "$QEMU" ] && [ -z "$ACCEL" ] &&
> diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh
> index c4ba81f18935..9c5768563757 100755
> --- a/scripts/mkstandalone.sh
> +++ b/scripts/mkstandalone.sh
> @@ -6,6 +6,9 @@ if [ ! -f config.mak ]; then
> fi
> source config.mak
> source scripts/common.bash
> +source scripts/vmm.bash
> +
> +vmm_check_supported
>
> temp_file ()
> {
> @@ -71,7 +74,8 @@ generate_test ()
> args[3]='$bin'
>
> (echo "#!/usr/bin/env bash"
> - cat scripts/arch-run.bash "$TEST_DIR/run") | temp_file RUNTIME_arch_run
> + cat scripts/vmm.bash scripts/arch-run.bash "$TEST_DIR/run") \
> + | temp_file RUNTIME_arch_run
>
> echo "exec {stdout}>&1"
> echo "RUNTIME_log_stdout () { cat >&\$stdout; }"
> diff --git a/scripts/vmm.bash b/scripts/vmm.bash
> new file mode 100644
> index 000000000000..8365c1424a3f
> --- /dev/null
> +++ b/scripts/vmm.bash
> @@ -0,0 +1,25 @@
> +function vmm_get_target()
> +{
> + if [[ -z "$TARGET" ]]; then
> + echo "qemu"
> + else
> + echo "$TARGET"
> + fi
> +}
> +
> +function vmm_check_supported()
> +{
> + # We're not interested in the return code for vmm_get_target().
> + # shellcheck disable=SC2155
> + local target=$(vmm_get_target)
> +
> + case "$target" in
> + qemu)
> + return 0
> + ;;
> + *)
> + echo "$0 does not support target '$target'"
> + exit 2
> + ;;
> + esac
> +}
> --
> 2.50.0
>
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v4 04/13] scripts: Use an associative array for qemu argument names
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 04/13] scripts: Use an associative array for qemu argument names Alexandru Elisei
@ 2025-06-26 15:29 ` Andrew Jones
0 siblings, 0 replies; 26+ messages in thread
From: Andrew Jones @ 2025-06-26 15:29 UTC (permalink / raw)
To: Alexandru Elisei
Cc: eric.auger, lvivier, thuth, frankja, imbrenda, nrb, david,
pbonzini, kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
On Wed, Jun 25, 2025 at 04:48:04PM +0100, Alexandru Elisei wrote:
> Move away from hardcoded qemu arguments and use instead an associative
> array to get the needed arguments. This paves the way for adding kvmtool
> support to the scripts, which has a different syntax for the same VM
> configuration parameters.
>
> Suggested-by: Andrew Jones <andrew.jones@linux.dev>
> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
> ---
>
> Changes v3->v4:
>
> * Renamed vmm_opts to vmm_optname.
> * Dropped entries for 'kernel' and 'initrd' in vmm_optname because they weren't
> used in this patch.
> * Use vmm_optname_nr_cpus() and vmm_optname_args() instead of directly indexing
> into vmm_optname.
> * Dropped the check for empty $test_args in scripts/runtime.bash::run() by
> having $test_args already contain --append if not empty in
> scripts/common.bash::for_each_unittest().
>
> scripts/common.bash | 11 ++++++++---
> scripts/runtime.bash | 7 +------
> scripts/vmm.bash | 15 +++++++++++++++
> 3 files changed, 24 insertions(+), 9 deletions(-)
>
> diff --git a/scripts/common.bash b/scripts/common.bash
> index 9deb87d4050d..ae127bd4e208 100644
> --- a/scripts/common.bash
> +++ b/scripts/common.bash
> @@ -1,4 +1,5 @@
> source config.mak
> +source scripts/vmm.bash
>
> function for_each_unittest()
> {
> @@ -26,8 +27,12 @@ function for_each_unittest()
> $(arch_cmd) "$cmd" "$testname" "$groups" "$smp" "$kernel" "$test_args" "$opts" "$arch" "$machine" "$check" "$accel" "$timeout"
> fi
> testname=$rematch
> - smp=1
> + smp="$(vmm_optname_nr_cpus) 1"
> kernel=""
> + # Intentionally don't use -append if test_args is empty
> + # because qemu interprets the first word after
> + # -append as a kernel parameter instead of a command
> + # line option.
> test_args=""
> opts=""
> groups=""
> @@ -39,9 +44,9 @@ function for_each_unittest()
> elif [[ $line =~ ^file\ *=\ *(.*)$ ]]; then
> kernel=$TEST_DIR/${BASH_REMATCH[1]}
> elif [[ $line =~ ^smp\ *=\ *(.*)$ ]]; then
> - smp=${BASH_REMATCH[1]}
> + smp="$(vmm_optname_nr_cpus) ${BASH_REMATCH[1]}"
> elif [[ $line =~ ^test_args\ *=\ *(.*)$ ]]; then
> - test_args=${BASH_REMATCH[1]}
> + test_args="$(vmm_optname_args) ${BASH_REMATCH[1]}"
> elif [[ $line =~ ^(extra_params|qemu_params)\ *=\ *'"""'(.*)$ ]]; then
> opts=${BASH_REMATCH[2]}$'\n'
> while read -r -u $fd; do
> diff --git a/scripts/runtime.bash b/scripts/runtime.bash
> index bc17b89f4ff5..86d8a2cd8528 100644
> --- a/scripts/runtime.bash
> +++ b/scripts/runtime.bash
> @@ -34,7 +34,7 @@ premature_failure()
> get_cmdline()
> {
> local kernel=$1
> - echo "TESTNAME=$testname TIMEOUT=$timeout MACHINE=$machine ACCEL=$accel $RUNTIME_arch_run $kernel -smp $smp $opts"
> + echo "TESTNAME=$testname TIMEOUT=$timeout MACHINE=$machine ACCEL=$accel $RUNTIME_arch_run $kernel $smp $test_args $opts"
> }
>
> skip_nodefault()
> @@ -88,11 +88,6 @@ function run()
> local accel="${10}"
> local timeout="${11:-$TIMEOUT}" # unittests.cfg overrides the default
>
> - # If $test_args is empty, qemu will interpret the first option after -append
> - # as a test argument instead of a qemu option, so make sure that doesn't
> - # happen.
> - [ -n "$test_args" ] && opts="-append $test_args $opts"
> -
> if [ "${CONFIG_EFI}" == "y" ]; then
> kernel=${kernel/%.flat/.efi}
> fi
> diff --git a/scripts/vmm.bash b/scripts/vmm.bash
> index 8365c1424a3f..7629b2b9146e 100644
> --- a/scripts/vmm.bash
> +++ b/scripts/vmm.bash
> @@ -1,3 +1,18 @@
> +declare -A vmm_optname=(
> + [qemu,args]='-append'
> + [qemu,nr_cpus]='-smp'
> +)
> +
> +function vmm_optname_args()
> +{
> + echo ${vmm_optname[$(vmm_get_target),args]}
> +}
> +
> +function vmm_optname_nr_cpus()
> +{
> + echo ${vmm_optname[$(vmm_get_target),nr_cpus]}
> +}
> +
> function vmm_get_target()
> {
> if [[ -z "$TARGET" ]]; then
> --
> 2.50.0
>
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v4 05/13] scripts: Add 'kvmtool_params' to test definition
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 05/13] scripts: Add 'kvmtool_params' to test definition Alexandru Elisei
@ 2025-06-26 15:34 ` Andrew Jones
2025-06-26 16:41 ` Alexandru Elisei
0 siblings, 1 reply; 26+ messages in thread
From: Andrew Jones @ 2025-06-26 15:34 UTC (permalink / raw)
To: Alexandru Elisei
Cc: eric.auger, lvivier, thuth, frankja, imbrenda, nrb, david,
pbonzini, kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
On Wed, Jun 25, 2025 at 04:48:05PM +0100, Alexandru Elisei wrote:
> arm/arm64 supports running tests under kvmtool, but kvmtool's syntax for
> running and configuring a virtual machine is different to qemu. To run
> tests using the automated test infrastructure, add a new test parameter,
> 'kvmtool_params'. The parameter serves the exact purpose as 'qemu_params',
> but using kvmtool's syntax.
>
> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
> ---
>
> Changes v3->v4:
>
> * Added params_name in scripts/common.bash::for_each_unittest() to avoid
> checking for $TARGET when deciding to parse kvmtool_params or
> {qemu,extra}_params.
> * Dropped factoring out parse_opts() in for_each_unittest().
>
> arm/unittests.cfg | 24 ++++++++++++++++++++++++
> docs/unittests.txt | 8 ++++++++
> scripts/common.bash | 11 +++++++----
> scripts/vmm.bash | 16 ++++++++++++++++
> 4 files changed, 55 insertions(+), 4 deletions(-)
>
> diff --git a/arm/unittests.cfg b/arm/unittests.cfg
> index 384af983cd88..343c14567f27 100644
> --- a/arm/unittests.cfg
> +++ b/arm/unittests.cfg
> @@ -17,6 +17,7 @@ file = selftest.flat
> smp = 2
> test_args = 'setup smp=2 mem=256'
> qemu_params = -m 256
> +kvmtool_params = --mem 256
> groups = selftest
>
> # Test vector setup and exception handling (kernel mode).
> @@ -48,66 +49,77 @@ groups = pci
> file = pmu.flat
> groups = pmu
> test_args = "cycle-counter 0"
> +kvmtool_params = --pmu
>
> [pmu-event-introspection]
> file = pmu.flat
> groups = pmu
> arch = arm64
> test_args = pmu-event-introspection
> +kvmtool_params = --pmu
>
> [pmu-event-counter-config]
> file = pmu.flat
> groups = pmu
> arch = arm64
> test_args = pmu-event-counter-config
> +kvmtool_params = --pmu
>
> [pmu-basic-event-count]
> file = pmu.flat
> groups = pmu
> arch = arm64
> test_args = pmu-basic-event-count
> +kvmtool_params = --pmu
>
> [pmu-mem-access]
> file = pmu.flat
> groups = pmu
> arch = arm64
> test_args = pmu-mem-access
> +kvmtool_params = --pmu
>
> [pmu-mem-access-reliability]
> file = pmu.flat
> groups = pmu
> arch = arm64
> test_args = pmu-mem-access-reliability
> +kvmtool_params = --pmu
>
> [pmu-sw-incr]
> file = pmu.flat
> groups = pmu
> arch = arm64
> test_args = pmu-sw-incr
> +kvmtool_params = --pmu
>
> [pmu-chained-counters]
> file = pmu.flat
> groups = pmu
> arch = arm64
> test_args = pmu-chained-counters
> +kvmtool_params = --pmu
>
> [pmu-chained-sw-incr]
> file = pmu.flat
> groups = pmu
> arch = arm64
> test_args = pmu-chained-sw-incr
> +kvmtool_params = --pmu
>
> [pmu-chain-promotion]
> file = pmu.flat
> groups = pmu
> arch = arm64
> test_args = pmu-chain-promotion
> +kvmtool_params = --pmu
>
> [pmu-overflow-interrupt]
> file = pmu.flat
> groups = pmu
> arch = arm64
> test_args = pmu-overflow-interrupt
> +kvmtool_params = --pmu
>
> # Test PMU support (TCG) with -icount IPC=1
> #[pmu-tcg-icount-1]
> @@ -131,6 +143,7 @@ file = gic.flat
> smp = $((($MAX_SMP < 8)?$MAX_SMP:8))
> test_args = ipi
> qemu_params = -machine gic-version=2
> +kvmtool_params = --irqchip=gicv2
> groups = gic
>
> [gicv2-mmio]
> @@ -138,6 +151,7 @@ file = gic.flat
> smp = $((($MAX_SMP < 8)?$MAX_SMP:8))
> test_args = mmio
> qemu_params = -machine gic-version=2
> +kvmtool_params = --irqchip=gicv2
> groups = gic
>
> [gicv2-mmio-up]
> @@ -145,6 +159,7 @@ file = gic.flat
> smp = 1
> test_args = mmio
> qemu_params = -machine gic-version=2
> +kvmtool_params = --irqchip=gicv2
> groups = gic
>
> [gicv2-mmio-3p]
> @@ -152,6 +167,7 @@ file = gic.flat
> smp = $((($MAX_SMP < 3)?$MAX_SMP:3))
> test_args = mmio
> qemu_params = -machine gic-version=2
> +kvmtool_params = --irqchip=gicv2
> groups = gic
>
> [gicv3-ipi]
> @@ -159,6 +175,7 @@ file = gic.flat
> smp = $MAX_SMP
> test_args = ipi
> qemu_params = -machine gic-version=3
> +kvmtool_params = --irqchip=gicv3
> groups = gic
>
> [gicv2-active]
> @@ -166,6 +183,7 @@ file = gic.flat
> smp = $((($MAX_SMP < 8)?$MAX_SMP:8))
> test_args = active
> qemu_params = -machine gic-version=2
> +kvmtool_params = --irqchip=gicv2
> groups = gic
>
> [gicv3-active]
> @@ -173,6 +191,7 @@ file = gic.flat
> smp = $MAX_SMP
> test_args = active
> qemu_params = -machine gic-version=3
> +kvmtool_params = --irqchip=gicv3
> groups = gic
>
> [its-introspection]
> @@ -180,6 +199,7 @@ file = gic.flat
> smp = $MAX_SMP
> test_args = its-introspection
> qemu_params = -machine gic-version=3
> +kvmtool_params = --irqchip=gicv3-its
> groups = its
> arch = arm64
>
> @@ -188,6 +208,7 @@ file = gic.flat
> smp = $MAX_SMP
> test_args = its-trigger
> qemu_params = -machine gic-version=3
> +kvmtool_params = --irqchip=gicv3-its
> groups = its
> arch = arm64
>
> @@ -196,6 +217,7 @@ file = gic.flat
> smp = $MAX_SMP
> test_args = its-migration
> qemu_params = -machine gic-version=3
> +kvmtool_params = --irqchip=gicv3
> groups = its migration
> arch = arm64
>
> @@ -204,6 +226,7 @@ file = gic.flat
> smp = $MAX_SMP
> test_args = its-pending-migration
> qemu_params = -machine gic-version=3
> +kvmtool_params = --irqchip=gicv3
> groups = its migration
> arch = arm64
>
> @@ -212,6 +235,7 @@ file = gic.flat
> smp = $MAX_SMP
> test_args = its-migrate-unmapped-collection
> qemu_params = -machine gic-version=3
> +kvmtool_params = --irqchip=gicv3
> groups = its migration
> arch = arm64
>
> diff --git a/docs/unittests.txt b/docs/unittests.txt
> index ea0da959f008..a9164bccc24c 100644
> --- a/docs/unittests.txt
> +++ b/docs/unittests.txt
> @@ -78,6 +78,14 @@ extra_params
> Alias for 'qemu_params', supported for compatibility purposes. Use
> 'qemu_params' for new tests.
>
> +kvmtool_params
> +--------------
> +Extra parameters supplied to the kvmtool process. Works similarly to
> +'qemu_params', but uses kvmtool's syntax for command line arguments. The
> +example for 'qemu_params', applied to kvmtool, would be:
> +
> +kvmtool_params = --mem 256
> +
> groups
> ------
> groups = <group_name1> <group_name2> ...
> diff --git a/scripts/common.bash b/scripts/common.bash
> index ae127bd4e208..7c1b89f1b3c2 100644
> --- a/scripts/common.bash
> +++ b/scripts/common.bash
> @@ -18,6 +18,9 @@ function for_each_unittest()
> local timeout
> local rematch
>
> + # shellcheck disable=SC2155
> + local params_name=$(vmm_unittest_params_name)
> +
> exec {fd}<"$unittests"
>
> while read -r -u $fd line; do
> @@ -47,8 +50,8 @@ function for_each_unittest()
> smp="$(vmm_optname_nr_cpus) ${BASH_REMATCH[1]}"
> elif [[ $line =~ ^test_args\ *=\ *(.*)$ ]]; then
> test_args="$(vmm_optname_args) ${BASH_REMATCH[1]}"
> - elif [[ $line =~ ^(extra_params|qemu_params)\ *=\ *'"""'(.*)$ ]]; then
> - opts=${BASH_REMATCH[2]}$'\n'
> + elif [[ $line =~ ^$params_name\ *=\ *'"""'(.*)$ ]]; then
> + opts=${BASH_REMATCH[1]}$'\n'
> while read -r -u $fd; do
> #escape backslash newline, but not double backslash
> if [[ $opts =~ [^\\]*(\\*)$'\n'$ ]]; then
> @@ -63,8 +66,8 @@ function for_each_unittest()
> opts+=$REPLY$'\n'
> fi
> done
> - elif [[ $line =~ ^(extra_params|qemu_params)\ *=\ *(.*)$ ]]; then
> - opts=${BASH_REMATCH[2]}
> + elif [[ $line =~ ^$params_name\ *=\ *(.*)$ ]]; then
> + opts=${BASH_REMATCH[1]}
> elif [[ $line =~ ^groups\ *=\ *(.*)$ ]]; then
> groups=${BASH_REMATCH[1]}
> elif [[ $line =~ ^arch\ *=\ *(.*)$ ]]; then
> diff --git a/scripts/vmm.bash b/scripts/vmm.bash
> index 7629b2b9146e..9a2608eb3fd4 100644
> --- a/scripts/vmm.bash
> +++ b/scripts/vmm.bash
> @@ -38,3 +38,19 @@ function vmm_check_supported()
> ;;
> esac
> }
> +
> +function vmm_unittest_params_name()
> +{
> + # shellcheck disable=SC2155
> + local target=$(vmm_get_target)
> +
> + case "$target" in
> + qemu)
> + echo "extra_params|qemu_params"
> + ;;
> + *)
> + echo "$0 does not support '$target'"
> + exit 2
> + ;;
It seems a bit odd that we've introduced kvmtool_params and applied it to
arm in this patch, but we still don't support it. Not a huge deal, though.
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
> + esac
> +}
> --
> 2.50.0
>
>
> --
> kvm-riscv mailing list
> kvm-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kvm-riscv
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v4 07/13] scripts: Add default arguments for kvmtool
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 07/13] scripts: Add default arguments " Alexandru Elisei
@ 2025-06-26 15:43 ` Andrew Jones
2025-07-11 11:32 ` Thomas Huth
1 sibling, 0 replies; 26+ messages in thread
From: Andrew Jones @ 2025-06-26 15:43 UTC (permalink / raw)
To: Alexandru Elisei
Cc: eric.auger, lvivier, thuth, frankja, imbrenda, nrb, david,
pbonzini, kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
On Wed, Jun 25, 2025 at 04:48:07PM +0100, Alexandru Elisei wrote:
> kvmtool, unless told otherwise, will do its best to make sure that a kernel
> successfully boots in a virtual machine. It does things like automatically
> creating a rootfs and adding extra parameters to the kernel command line.
> This is actively harmful to kvm-unit-tests, because some tests parse the
> kernel command line and they will fail if they encounter the options added
> by kvmtool.
>
> Fortunately for us, kvmtool commit 5613ae26b998 ("Add --nodefaults command
> line argument") addded the --nodefaults kvmtool parameter which disables
> all the implicit virtual machine configuration that cannot be disabled by
> using other parameters, like modifying the kernel command line. So always
> use --nodefaults to allow a test to run.
>
> kvmtool can also be too verbose when running a virtual machine, and this is
> controlled by several parameters. Add those to the default kvmtool command
> line to reduce this verbosity to a minimum.
>
> Before:
>
> $ vm run arm/selftest.flat --cpus 2 --mem 256 --params "setup smp=2 mem=256"
> Info: # lkvm run -k arm/selftest.flat -m 256 -c 2 --name guest-5035
> Unknown subtest
>
> EXIT: STATUS=127
> Warning: KVM compatibility warning.
> virtio-9p device was not detected.
> While you have requested a virtio-9p device, the guest kernel did not initialize it.
> Please make sure that the guest kernel was compiled with CONFIG_NET_9P_VIRTIO=y enabled in .config.
> Warning: KVM compatibility warning.
> virtio-net device was not detected.
> While you have requested a virtio-net device, the guest kernel did not initialize it.
> Please make sure that the guest kernel was compiled with CONFIG_VIRTIO_NET=y enabled in .config.
> Info: KVM session ended normally.
>
> After:
>
> $ vm run arm/selftest.flat --nodefaults --network mode=none --loglevel=warning --cpus 2 --mem 256 --params "setup smp=2 mem=256"
> PASS: selftest: setup: smp: number of CPUs matches expectation
> INFO: selftest: setup: smp: found 2 CPUs
> PASS: selftest: setup: mem: memory size matches expectation
> INFO: selftest: setup: mem: found 256 MB
> SUMMARY: 2 tests
>
> EXIT: STATUS=1
>
> Note that KVMTOOL_DEFAULT_OPTS can be overwritten by an environment
> variable with the same name, but it's not documented in the help string for
> run_tests.sh. This has been done on purpose, since overwritting
> KVMTOOL_DEFAULT_OPTS should only be necessary for debugging or development
> purposes.
>
> Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
> Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
> ---
>
> Changes v3->v4:
>
> * Use vmm_default_opts() instead of indexing into vmm_optname
> * Reworded the help test for --nodefaults as per Shaoqin's suggestion.
>
> scripts/common.bash | 6 +++---
> scripts/vmm.bash | 18 ++++++++++++++++++
> 2 files changed, 21 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/common.bash b/scripts/common.bash
> index 7c1b89f1b3c2..d5d3101c8089 100644
> --- a/scripts/common.bash
> +++ b/scripts/common.bash
> @@ -37,7 +37,7 @@ function for_each_unittest()
> # -append as a kernel parameter instead of a command
> # line option.
> test_args=""
> - opts=""
> + opts="$(vmm_default_opts)"
> groups=""
> arch=""
> machine=""
> @@ -51,7 +51,7 @@ function for_each_unittest()
> elif [[ $line =~ ^test_args\ *=\ *(.*)$ ]]; then
> test_args="$(vmm_optname_args) ${BASH_REMATCH[1]}"
> elif [[ $line =~ ^$params_name\ *=\ *'"""'(.*)$ ]]; then
> - opts=${BASH_REMATCH[1]}$'\n'
> + opts="$(vmm_defaults_opts) ${BASH_REMATCH[1]}$'\n'"
Could be opts+=" ${BASH_REMATCH[1]}$'\n'", right?
> while read -r -u $fd; do
> #escape backslash newline, but not double backslash
> if [[ $opts =~ [^\\]*(\\*)$'\n'$ ]]; then
> @@ -67,7 +67,7 @@ function for_each_unittest()
> fi
> done
> elif [[ $line =~ ^$params_name\ *=\ *(.*)$ ]]; then
> - opts=${BASH_REMATCH[1]}
> + opts="$(vmm_default_opts) ${BASH_REMATCH[1]}"
Same comment.
Not a big deal either way, though, so my r-b stands.
Thanks,
drew
> elif [[ $line =~ ^groups\ *=\ *(.*)$ ]]; then
> groups=${BASH_REMATCH[1]}
> elif [[ $line =~ ^arch\ *=\ *(.*)$ ]]; then
> diff --git a/scripts/vmm.bash b/scripts/vmm.bash
> index 0dd3f971ecdf..368690d62473 100644
> --- a/scripts/vmm.bash
> +++ b/scripts/vmm.bash
> @@ -1,3 +1,14 @@
> +# The following parameters are enabled by default when running a test with
> +# kvmtool:
> +# --nodefaults: suppress VM configuration that cannot be disabled (like
> +# modifying the supplied kernel command line). Otherwise tests
> +# that use the command line will fail without this parameter.
> +# --network mode=none: do not create a network device. kvmtool tries to help the
> +# user by automatically create one, and then prints a warning
> +# when the VM terminates if the device hasn't been initialized.
> +# --loglevel=warning: reduce verbosity
> +: "${KVMTOOL_DEFAULT_OPTS:="--nodefaults --network mode=none --loglevel=warning"}"
> +
> ##############################################################################
> # qemu_fixup_return_code translates the ambiguous exit status in Table1 to that
> # in Table2. Table3 simply documents the complete status table.
> @@ -82,11 +93,13 @@ function kvmtool_fixup_return_code()
>
> declare -A vmm_optname=(
> [qemu,args]='-append'
> + [qemu,default_opts]=''
> [qemu,fixup_return_code]=qemu_fixup_return_code
> [qemu,initrd]='-initrd'
> [qemu,nr_cpus]='-smp'
>
> [kvmtool,args]='--params'
> + [kvmtool,default_opts]="$KVMTOOL_DEFAULT_OPTS"
> [kvmtool,fixup_return_code]=kvmtool_fixup_return_code
> [kvmtool,initrd]='--initrd'
> [kvmtool,nr_cpus]='--cpus'
> @@ -97,6 +110,11 @@ function vmm_optname_args()
> echo ${vmm_optname[$(vmm_get_target),args]}
> }
>
> +function vmm_default_opts()
> +{
> + echo ${vmm_optname[$(vmm_get_target),default_opts]}
> +}
> +
> function vmm_fixup_return_code()
> {
> ${vmm_optname[$(vmm_get_target),fixup_return_code]} "$@"
> --
> 2.50.0
>
>
> --
> kvm-riscv mailing list
> kvm-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kvm-riscv
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v4 05/13] scripts: Add 'kvmtool_params' to test definition
2025-06-26 15:34 ` Andrew Jones
@ 2025-06-26 16:41 ` Alexandru Elisei
0 siblings, 0 replies; 26+ messages in thread
From: Alexandru Elisei @ 2025-06-26 16:41 UTC (permalink / raw)
To: Andrew Jones
Cc: eric.auger, lvivier, thuth, frankja, imbrenda, nrb, david,
pbonzini, kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
Hi Drew,
On Thu, Jun 26, 2025 at 05:34:05PM +0200, Andrew Jones wrote:
> On Wed, Jun 25, 2025 at 04:48:05PM +0100, Alexandru Elisei wrote:
> > arm/arm64 supports running tests under kvmtool, but kvmtool's syntax for
> > running and configuring a virtual machine is different to qemu. To run
> > tests using the automated test infrastructure, add a new test parameter,
> > 'kvmtool_params'. The parameter serves the exact purpose as 'qemu_params',
> > but using kvmtool's syntax.
> >
> > Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
> > ---
> >
> > Changes v3->v4:
> >
> > * Added params_name in scripts/common.bash::for_each_unittest() to avoid
> > checking for $TARGET when deciding to parse kvmtool_params or
> > {qemu,extra}_params.
> > * Dropped factoring out parse_opts() in for_each_unittest().
> >
> > arm/unittests.cfg | 24 ++++++++++++++++++++++++
> > docs/unittests.txt | 8 ++++++++
> > scripts/common.bash | 11 +++++++----
> > scripts/vmm.bash | 16 ++++++++++++++++
> > 4 files changed, 55 insertions(+), 4 deletions(-)
[..]
> > +function vmm_unittest_params_name()
> > +{
> > + # shellcheck disable=SC2155
> > + local target=$(vmm_get_target)
> > +
> > + case "$target" in
> > + qemu)
> > + echo "extra_params|qemu_params"
> > + ;;
> > + *)
> > + echo "$0 does not support '$target'"
> > + exit 2
> > + ;;
>
> It seems a bit odd that we've introduced kvmtool_params and applied it to
> arm in this patch, but we still don't support it. Not a huge deal, though.
Originally it was part of a huge patch that added everything in one go, it
was this patch and the next 6 or 7 patches combined. The feedback I got at
the time was to split it into more manageable chunks, which is very
understandable. So this is how I ended up with this patch, to make the
series easier to digest.
>
> Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Thanks for the review!
Alex
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script
2025-06-25 15:48 [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Alexandru Elisei
` (12 preceding siblings ...)
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 13/13] scripts: Enable kvmtool Alexandru Elisei
@ 2025-06-26 16:42 ` Andrew Jones
2025-06-26 16:48 ` Alexandru Elisei
2025-07-02 13:25 ` Andrew Jones
2025-07-04 8:41 ` Andrew Jones
15 siblings, 1 reply; 26+ messages in thread
From: Andrew Jones @ 2025-06-26 16:42 UTC (permalink / raw)
To: Alexandru Elisei
Cc: eric.auger, lvivier, thuth, frankja, imbrenda, nrb, david,
pbonzini, kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
On Wed, Jun 25, 2025 at 04:48:00PM +0100, Alexandru Elisei wrote:
> v3 can be found here [1]. Based on top of the series that add qemu_params and
> test_args [2].
>
> To goal is to allow the user to do:
>
> $ ./configure --target=kvmtool
> $ make clean && make
> $ ./run_tests.sh
>
> to run all the tests automatically with kvmtool.
>
> Reasons to use kvmtool:
>
> * kvmtool is smaller and a lot easier to modify compared to qemu, which
> means developers may prefer it when adding or prototyping new features to
> KVM, and being able to run all the tests reliably and automatically is very
> useful.
>
> * kvmtool is faster to run the tests (a couple of times faster on
> my rockpro64), making for a quick turnaround. But do keep in mind that not
> all tests work on kvmtool because of missing features compared to qemu.
>
> * kvmtool does things differently than qemu: different memory layout,
> different uart, PMU emulation is disabled by default, etc. This makes it a
> good testing vehicule for kvm-unit-tests itself.
Thanks for this Alex! I didn't test it on arm yet, but I did test it on
riscv with the quick patch below. It works great.
Applied to arm/queue
https://gitlab.com/jones-drew/kvm-unit-tests/-/commits/arm/queue
drew
diff --git a/README.md b/README.md
index 723ce04cd978..cbd8a9940ec4 100644
--- a/README.md
+++ b/README.md
@@ -65,8 +65,8 @@ or:
to run them all.
-All tests can be run using QEMU. On arm and arm64, tests can also be run using
-kvmtool.
+All tests can be run using QEMU. On arm, arm64, riscv32, and riscv64 tests can
+also be run using kvmtool.
By default the runner script searches for a suitable QEMU binary in the system.
To select a specific QEMU binary though, specify the QEMU=path/to/binary
@@ -97,8 +97,7 @@ variable. kvmtool supports only kvm as the accelerator.
Check [x86/efi/README.md](./x86/efi/README.md).
-On arm and arm64, this is only supported with QEMU; kvmtool cannot run the
-tests under UEFI.
+This is only supported with QEMU; kvmtool cannot run the tests under UEFI.
# Tests configuration file
diff --git a/configure b/configure
index 470f9d7cdb3b..4a9af4e0af30 100755
--- a/configure
+++ b/configure
@@ -90,7 +90,7 @@ usage() {
selects the best value based on the host system and the
test configuration.
--target=TARGET target platform that the tests will be running on (qemu or
- kvmtool, default is qemu) (arm/arm64 only)
+ kvmtool, default is qemu) (arm/arm64 and riscv32/riscv64 only)
--cross-prefix=PREFIX cross compiler prefix
--cc=CC c compiler to use ($cc)
--cflags=FLAGS extra options to be passed to the c compiler
@@ -284,7 +284,8 @@ fi
if [ -z "$target" ]; then
target="qemu"
else
- if [ "$arch" != "arm64" ] && [ "$arch" != "arm" ]; then
+ if [ "$arch" != "arm64" ] && [ "$arch" != "arm" ] &&
+ [ "$arch" != "riscv32" ] && [ "$arch" != "riscv64" ]; then
echo "--target is not supported for $arch"
usage
fi
@@ -393,6 +394,10 @@ elif [ "$arch" = "riscv32" ] || [ "$arch" = "riscv64" ]; then
testdir=riscv
arch_libdir=riscv
: "${uart_early_addr:=0x10000000}"
+ if [ "$target" != "qemu" ] && [ "$target" != "kvmtool" ]; then
+ echo "--target must be one of 'qemu' or 'kvmtool'!"
+ usage
+ fi
elif [ "$arch" = "s390x" ]; then
testdir=s390x
else
@@ -519,7 +524,8 @@ EFI_DIRECT=$efi_direct
CONFIG_WERROR=$werror
GEN_SE_HEADER=$gen_se_header
EOF
-if [ "$arch" = "arm" ] || [ "$arch" = "arm64" ]; then
+if [ "$arch" = "arm" ] || [ "$arch" = "arm64" ] ||
+ [ "$arch" = "riscv32" ] || [ "$arch" = "riscv64" ]; then
echo "TARGET=$target" >> config.mak
fi
diff --git a/riscv/efi/run b/riscv/efi/run
index 5a72683a6ef5..b9b75440c659 100755
--- a/riscv/efi/run
+++ b/riscv/efi/run
@@ -11,6 +11,12 @@ if [ ! -f config.mak ]; then
fi
source config.mak
source scripts/arch-run.bash
+source scripts/vmm.bash
+
+if [[ $(vmm_get_target) == "kvmtool" ]]; then
+ echo "kvmtool does not support EFI tests."
+ exit 2
+fi
if [ -f RISCV_VIRT_CODE.fd ]; then
DEFAULT_UEFI=RISCV_VIRT_CODE.fd
diff --git a/riscv/run b/riscv/run
index 0f000f0d82c6..3c242923412c 100755
--- a/riscv/run
+++ b/riscv/run
@@ -10,35 +10,75 @@ if [ -z "$KUT_STANDALONE" ]; then
source scripts/vmm.bash
fi
-# Allow user overrides of some config.mak variables
-mach=$MACHINE_OVERRIDE
-qemu_cpu=$TARGET_CPU_OVERRIDE
-firmware=$FIRMWARE_OVERRIDE
-
-: "${mach:=virt}"
-: "${qemu_cpu:=$TARGET_CPU}"
-: "${qemu_cpu:=$DEFAULT_QEMU_CPU}"
-: "${firmware:=$FIRMWARE}"
-[ "$firmware" ] && firmware="-bios $firmware"
-
-set_qemu_accelerator || exit $?
-[ "$ACCEL" = "kvm" ] && QEMU_ARCH=$HOST
-acc="-accel $ACCEL$ACCEL_PROPS"
-
-qemu=$(search_qemu_binary) || exit $?
-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 $mach"
+vmm_check_supported
-command="$qemu -nodefaults -nographic -serial mon:stdio"
-command+=" $mach $acc $firmware -cpu $qemu_cpu "
-command="$(migration_cmd) $(timeout_cmd) $command"
+function arch_run_qemu()
+{
+ # Allow user overrides of some config.mak variables
+ mach=$MACHINE_OVERRIDE
+ qemu_cpu=$TARGET_CPU_OVERRIDE
+ firmware=$FIRMWARE_OVERRIDE
-if [ "$UEFI_SHELL_RUN" = "y" ]; then
- ENVIRON_DEFAULT=n run_test_status $command "$@"
-else
- # We return the exit code via stdout, not via the QEMU return code
- run_test_status $command -kernel "$@"
-fi
+ : "${mach:=virt}"
+ : "${qemu_cpu:=$TARGET_CPU}"
+ : "${qemu_cpu:=$DEFAULT_QEMU_CPU}"
+ : "${firmware:=$FIRMWARE}"
+ [ "$firmware" ] && firmware="-bios $firmware"
+
+ set_qemu_accelerator || exit $?
+ [ "$ACCEL" = "kvm" ] && QEMU_ARCH=$HOST
+ acc="-accel $ACCEL$ACCEL_PROPS"
+
+ qemu=$(search_qemu_binary) || exit $?
+ 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 $mach"
+
+ command="$qemu -nodefaults -nographic -serial mon:stdio"
+ command+=" $mach $acc $firmware -cpu $qemu_cpu "
+ command="$(migration_cmd) $(timeout_cmd) $command"
+
+ if [ "$UEFI_SHELL_RUN" = "y" ]; then
+ ENVIRON_DEFAULT=n run_test_status $command "$@"
+ else
+ # We return the exit code via stdout, not via the QEMU return code
+ run_test_status $command -kernel "$@"
+ fi
+}
+
+function arch_run_kvmtool()
+{
+ local command
+
+ kvmtool=$(search_kvmtool_binary) ||
+ exit $?
+
+ if [ "$ACCEL" ] && [ "$ACCEL" != "kvm" ]; then
+ echo "kvmtool does not support $ACCEL" >&2
+ exit 2
+ fi
+
+ if ! kvm_available; then
+ echo "kvmtool requires KVM but not available on the host" >&2
+ exit 2
+ fi
+
+ command="$(timeout_cmd) $kvmtool run"
+ if [ "$HOST" = "riscv64" ] && [ "$ARCH" = "riscv32" ]; then
+ echo "Cannot run riscv32 on riscv64" >&2
+ exit 2
+ else
+ run_test_status $command --kernel "$@"
+ fi
+}
+
+case $(vmm_get_target) in
+qemu)
+ arch_run_qemu "$@"
+ ;;
+kvmtool)
+ arch_run_kvmtool "$@"
+ ;;
+esac
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script
2025-06-26 16:42 ` [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Andrew Jones
@ 2025-06-26 16:48 ` Alexandru Elisei
0 siblings, 0 replies; 26+ messages in thread
From: Alexandru Elisei @ 2025-06-26 16:48 UTC (permalink / raw)
To: Andrew Jones
Cc: eric.auger, lvivier, thuth, frankja, imbrenda, nrb, david,
pbonzini, kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
Hi Drew,
On Thu, Jun 26, 2025 at 06:42:01PM +0200, Andrew Jones wrote:
> On Wed, Jun 25, 2025 at 04:48:00PM +0100, Alexandru Elisei wrote:
> > v3 can be found here [1]. Based on top of the series that add qemu_params and
> > test_args [2].
> >
> > To goal is to allow the user to do:
> >
> > $ ./configure --target=kvmtool
> > $ make clean && make
> > $ ./run_tests.sh
> >
> > to run all the tests automatically with kvmtool.
> >
> > Reasons to use kvmtool:
> >
> > * kvmtool is smaller and a lot easier to modify compared to qemu, which
> > means developers may prefer it when adding or prototyping new features to
> > KVM, and being able to run all the tests reliably and automatically is very
> > useful.
> >
> > * kvmtool is faster to run the tests (a couple of times faster on
> > my rockpro64), making for a quick turnaround. But do keep in mind that not
> > all tests work on kvmtool because of missing features compared to qemu.
> >
> > * kvmtool does things differently than qemu: different memory layout,
> > different uart, PMU emulation is disabled by default, etc. This makes it a
> > good testing vehicule for kvm-unit-tests itself.
>
> Thanks for this Alex! I didn't test it on arm yet, but I did test it on
> riscv with the quick patch below. It works great.
From a glance, the patch looks ok to me.
>
> Applied to arm/queue
>
> https://gitlab.com/jones-drew/kvm-unit-tests/-/commits/arm/queue
Thanks!
Alex
>
> drew
>
>
> diff --git a/README.md b/README.md
> index 723ce04cd978..cbd8a9940ec4 100644
> --- a/README.md
> +++ b/README.md
> @@ -65,8 +65,8 @@ or:
>
> to run them all.
>
> -All tests can be run using QEMU. On arm and arm64, tests can also be run using
> -kvmtool.
> +All tests can be run using QEMU. On arm, arm64, riscv32, and riscv64 tests can
> +also be run using kvmtool.
>
> By default the runner script searches for a suitable QEMU binary in the system.
> To select a specific QEMU binary though, specify the QEMU=path/to/binary
> @@ -97,8 +97,7 @@ variable. kvmtool supports only kvm as the accelerator.
>
> Check [x86/efi/README.md](./x86/efi/README.md).
>
> -On arm and arm64, this is only supported with QEMU; kvmtool cannot run the
> -tests under UEFI.
> +This is only supported with QEMU; kvmtool cannot run the tests under UEFI.
>
> # Tests configuration file
>
> diff --git a/configure b/configure
> index 470f9d7cdb3b..4a9af4e0af30 100755
> --- a/configure
> +++ b/configure
> @@ -90,7 +90,7 @@ usage() {
> selects the best value based on the host system and the
> test configuration.
> --target=TARGET target platform that the tests will be running on (qemu or
> - kvmtool, default is qemu) (arm/arm64 only)
> + kvmtool, default is qemu) (arm/arm64 and riscv32/riscv64 only)
> --cross-prefix=PREFIX cross compiler prefix
> --cc=CC c compiler to use ($cc)
> --cflags=FLAGS extra options to be passed to the c compiler
> @@ -284,7 +284,8 @@ fi
> if [ -z "$target" ]; then
> target="qemu"
> else
> - if [ "$arch" != "arm64" ] && [ "$arch" != "arm" ]; then
> + if [ "$arch" != "arm64" ] && [ "$arch" != "arm" ] &&
> + [ "$arch" != "riscv32" ] && [ "$arch" != "riscv64" ]; then
> echo "--target is not supported for $arch"
> usage
> fi
> @@ -393,6 +394,10 @@ elif [ "$arch" = "riscv32" ] || [ "$arch" = "riscv64" ]; then
> testdir=riscv
> arch_libdir=riscv
> : "${uart_early_addr:=0x10000000}"
> + if [ "$target" != "qemu" ] && [ "$target" != "kvmtool" ]; then
> + echo "--target must be one of 'qemu' or 'kvmtool'!"
> + usage
> + fi
> elif [ "$arch" = "s390x" ]; then
> testdir=s390x
> else
> @@ -519,7 +524,8 @@ EFI_DIRECT=$efi_direct
> CONFIG_WERROR=$werror
> GEN_SE_HEADER=$gen_se_header
> EOF
> -if [ "$arch" = "arm" ] || [ "$arch" = "arm64" ]; then
> +if [ "$arch" = "arm" ] || [ "$arch" = "arm64" ] ||
> + [ "$arch" = "riscv32" ] || [ "$arch" = "riscv64" ]; then
> echo "TARGET=$target" >> config.mak
> fi
>
> diff --git a/riscv/efi/run b/riscv/efi/run
> index 5a72683a6ef5..b9b75440c659 100755
> --- a/riscv/efi/run
> +++ b/riscv/efi/run
> @@ -11,6 +11,12 @@ if [ ! -f config.mak ]; then
> fi
> source config.mak
> source scripts/arch-run.bash
> +source scripts/vmm.bash
> +
> +if [[ $(vmm_get_target) == "kvmtool" ]]; then
> + echo "kvmtool does not support EFI tests."
> + exit 2
> +fi
>
> if [ -f RISCV_VIRT_CODE.fd ]; then
> DEFAULT_UEFI=RISCV_VIRT_CODE.fd
> diff --git a/riscv/run b/riscv/run
> index 0f000f0d82c6..3c242923412c 100755
> --- a/riscv/run
> +++ b/riscv/run
> @@ -10,35 +10,75 @@ if [ -z "$KUT_STANDALONE" ]; then
> source scripts/vmm.bash
> fi
>
> -# Allow user overrides of some config.mak variables
> -mach=$MACHINE_OVERRIDE
> -qemu_cpu=$TARGET_CPU_OVERRIDE
> -firmware=$FIRMWARE_OVERRIDE
> -
> -: "${mach:=virt}"
> -: "${qemu_cpu:=$TARGET_CPU}"
> -: "${qemu_cpu:=$DEFAULT_QEMU_CPU}"
> -: "${firmware:=$FIRMWARE}"
> -[ "$firmware" ] && firmware="-bios $firmware"
> -
> -set_qemu_accelerator || exit $?
> -[ "$ACCEL" = "kvm" ] && QEMU_ARCH=$HOST
> -acc="-accel $ACCEL$ACCEL_PROPS"
> -
> -qemu=$(search_qemu_binary) || exit $?
> -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 $mach"
> +vmm_check_supported
>
> -command="$qemu -nodefaults -nographic -serial mon:stdio"
> -command+=" $mach $acc $firmware -cpu $qemu_cpu "
> -command="$(migration_cmd) $(timeout_cmd) $command"
> +function arch_run_qemu()
> +{
> + # Allow user overrides of some config.mak variables
> + mach=$MACHINE_OVERRIDE
> + qemu_cpu=$TARGET_CPU_OVERRIDE
> + firmware=$FIRMWARE_OVERRIDE
>
> -if [ "$UEFI_SHELL_RUN" = "y" ]; then
> - ENVIRON_DEFAULT=n run_test_status $command "$@"
> -else
> - # We return the exit code via stdout, not via the QEMU return code
> - run_test_status $command -kernel "$@"
> -fi
> + : "${mach:=virt}"
> + : "${qemu_cpu:=$TARGET_CPU}"
> + : "${qemu_cpu:=$DEFAULT_QEMU_CPU}"
> + : "${firmware:=$FIRMWARE}"
> + [ "$firmware" ] && firmware="-bios $firmware"
> +
> + set_qemu_accelerator || exit $?
> + [ "$ACCEL" = "kvm" ] && QEMU_ARCH=$HOST
> + acc="-accel $ACCEL$ACCEL_PROPS"
> +
> + qemu=$(search_qemu_binary) || exit $?
> + 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 $mach"
> +
> + command="$qemu -nodefaults -nographic -serial mon:stdio"
> + command+=" $mach $acc $firmware -cpu $qemu_cpu "
> + command="$(migration_cmd) $(timeout_cmd) $command"
> +
> + if [ "$UEFI_SHELL_RUN" = "y" ]; then
> + ENVIRON_DEFAULT=n run_test_status $command "$@"
> + else
> + # We return the exit code via stdout, not via the QEMU return code
> + run_test_status $command -kernel "$@"
> + fi
> +}
> +
> +function arch_run_kvmtool()
> +{
> + local command
> +
> + kvmtool=$(search_kvmtool_binary) ||
> + exit $?
> +
> + if [ "$ACCEL" ] && [ "$ACCEL" != "kvm" ]; then
> + echo "kvmtool does not support $ACCEL" >&2
> + exit 2
> + fi
> +
> + if ! kvm_available; then
> + echo "kvmtool requires KVM but not available on the host" >&2
> + exit 2
> + fi
> +
> + command="$(timeout_cmd) $kvmtool run"
> + if [ "$HOST" = "riscv64" ] && [ "$ARCH" = "riscv32" ]; then
> + echo "Cannot run riscv32 on riscv64" >&2
> + exit 2
> + else
> + run_test_status $command --kernel "$@"
> + fi
> +}
> +
> +case $(vmm_get_target) in
> +qemu)
> + arch_run_qemu "$@"
> + ;;
> +kvmtool)
> + arch_run_kvmtool "$@"
> + ;;
> +esac
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script
2025-06-25 15:48 [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Alexandru Elisei
` (13 preceding siblings ...)
2025-06-26 16:42 ` [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Andrew Jones
@ 2025-07-02 13:25 ` Andrew Jones
2025-07-04 8:41 ` Andrew Jones
15 siblings, 0 replies; 26+ messages in thread
From: Andrew Jones @ 2025-07-02 13:25 UTC (permalink / raw)
To: Alexandru Elisei
Cc: eric.auger, lvivier, thuth, frankja, imbrenda, nrb, david,
pbonzini, kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
Hi Paolo, Thomas, and others,
This series has a subject of arm, but it makes lots of changes to
common scripts. Can I get an ack on it? I'd like to merge it.
Thanks,
drew
On Wed, Jun 25, 2025 at 04:48:00PM +0100, Alexandru Elisei wrote:
> v3 can be found here [1]. Based on top of the series that add qemu_params and
> test_args [2].
>
> To goal is to allow the user to do:
>
> $ ./configure --target=kvmtool
> $ make clean && make
> $ ./run_tests.sh
>
> to run all the tests automatically with kvmtool.
>
> Reasons to use kvmtool:
>
> * kvmtool is smaller and a lot easier to modify compared to qemu, which
> means developers may prefer it when adding or prototyping new features to
> KVM, and being able to run all the tests reliably and automatically is very
> useful.
>
> * kvmtool is faster to run the tests (a couple of times faster on
> my rockpro64), making for a quick turnaround. But do keep in mind that not
> all tests work on kvmtool because of missing features compared to qemu.
>
> * kvmtool does things differently than qemu: different memory layout,
> different uart, PMU emulation is disabled by default, etc. This makes it a
> good testing vehicule for kvm-unit-tests itself.
>
> Changes v3->v4
> --------------
>
> Overview of the changes:
>
> * Gathered Reviewed-by tags - thanks for the review!
>
> * Sent patches #1 ("scripts: unittests.cfg: Rename 'extra_params' to
> 'qemu_params'") and #2 ("scripts: Add 'test_args' test definition parameter")
> as a separate series.
>
> * Fixed the typos reported during the review.
>
> * Ran shellcheck on the patches, this resulted in minor changes.
>
> * Dropped patch "configure: Export TARGET unconditionally" - now the functions
> in vmm.bash will check if TARGET is set, instead of having the other scripts use
> $TARGET to directly index the vmm_opts array.
>
> * Direct reads of $TARGET have been replaced with vmm_get_target(), to account
> for the fact that most architectures don't configure $TARGET (only arm and
> arm64 do that).
>
> * Renamed check_vmm_supported() to vmm_check_supported() to match the
> function names introduced in subsequent patches.
>
> * Renamed vmm_opts->vmm_optname to match the new function names.
>
> * Reordered the key-value pairs from vmm_optname in alphabetical order.
>
> * Use the "," separator for the composite keys of the associative array instead
> of ":" (don't remember why I originally settled on ":", but it was a really poor
> choice).
>
> * Dropped the Reviewed-by tags from Drew and Shaoqin Huang from patch #6
> ("scripts: Use an associative array for qemu argument names") - the review is
> much appreciated, but the way the vmm_opts array (now renamed to vmm_optname) is
> created, and used, has changed, and since the patch is about introducing the
> associative array, I thought it would be useful to have another round of review.
>
> * Use functions instead of indexing vmm_opts (now vmm_optname) directly.
>
> * Fixed standalone test generation by removing 'source vmm.bash' from
> scripts/arch-run.bash, $arch/run and scripts/runtime, and having
> scripts/mkstandalone.sh::generate_test() copy it directly in the final test
> script. Didn't catch that during the previous iterations because I was
> running the standalone tests from the top level source directory, and
> "source scripts/vmm.bash" happened to work.
>
> More details in the changelog for the modified patches.
>
> [1] https://lore.kernel.org/kvm/20250507151256.167769-1-alexandru.elisei@arm.com/
> [2] https://lore.kernel.org/kvm/20250625154354.27015-1-alexandru.elisei@arm.com/
>
> Alexandru Elisei (13):
> run_tests.sh: Document --probe-maxsmp argument
> scripts: Document environment variables
> scripts: Refuse to run the tests if not configured for qemu
> scripts: Use an associative array for qemu argument names
> scripts: Add 'kvmtool_params' to test definition
> scripts: Add support for kvmtool
> scripts: Add default arguments for kvmtool
> scripts: Add KVMTOOL environment variable for kvmtool binary path
> scripts: Detect kvmtool failure in premature_failure()
> scripts: Do not probe for maximum number of VCPUs when using kvmtool
> scripts/mkstandalone: Export $TARGET
> scripts: Add 'disabled_if' test definition parameter for kvmtool to
> use
> scripts: Enable kvmtool
>
> README.md | 18 +++-
> arm/efi/run | 8 ++
> arm/run | 161 ++++++++++++++++-----------
> arm/unittests.cfg | 31 ++++++
> configure | 1 -
> docs/unittests.txt | 26 ++++-
> powerpc/run | 5 +-
> riscv/run | 5 +-
> run_tests.sh | 35 +++---
> s390x/run | 3 +-
> scripts/arch-run.bash | 112 +++++++------------
> scripts/common.bash | 30 ++++--
> scripts/mkstandalone.sh | 8 +-
> scripts/runtime.bash | 35 ++----
> scripts/vmm.bash | 234 ++++++++++++++++++++++++++++++++++++++++
> x86/run | 5 +-
> 16 files changed, 525 insertions(+), 192 deletions(-)
> create mode 100644 scripts/vmm.bash
>
> --
> 2.50.0
>
>
> --
> kvm-riscv mailing list
> kvm-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kvm-riscv
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script
2025-06-25 15:48 [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Alexandru Elisei
` (14 preceding siblings ...)
2025-07-02 13:25 ` Andrew Jones
@ 2025-07-04 8:41 ` Andrew Jones
15 siblings, 0 replies; 26+ messages in thread
From: Andrew Jones @ 2025-07-04 8:41 UTC (permalink / raw)
To: Alexandru Elisei
Cc: eric.auger, lvivier, thuth, frankja, imbrenda, nrb, david,
pbonzini, kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang
On Wed, Jun 25, 2025 at 04:48:00PM +0100, Alexandru Elisei wrote:
> v3 can be found here [1]. Based on top of the series that add qemu_params and
> test_args [2].
>
> To goal is to allow the user to do:
>
> $ ./configure --target=kvmtool
> $ make clean && make
> $ ./run_tests.sh
>
> to run all the tests automatically with kvmtool.
>
> Reasons to use kvmtool:
>
> * kvmtool is smaller and a lot easier to modify compared to qemu, which
> means developers may prefer it when adding or prototyping new features to
> KVM, and being able to run all the tests reliably and automatically is very
> useful.
>
> * kvmtool is faster to run the tests (a couple of times faster on
> my rockpro64), making for a quick turnaround. But do keep in mind that not
> all tests work on kvmtool because of missing features compared to qemu.
>
> * kvmtool does things differently than qemu: different memory layout,
> different uart, PMU emulation is disabled by default, etc. This makes it a
> good testing vehicule for kvm-unit-tests itself.
>
Merged. Thanks
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v4 07/13] scripts: Add default arguments for kvmtool
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 07/13] scripts: Add default arguments " Alexandru Elisei
2025-06-26 15:43 ` Andrew Jones
@ 2025-07-11 11:32 ` Thomas Huth
2025-07-11 14:35 ` Andrew Jones
1 sibling, 1 reply; 26+ messages in thread
From: Thomas Huth @ 2025-07-11 11:32 UTC (permalink / raw)
To: Alexandru Elisei, andrew.jones, eric.auger, lvivier, frankja,
imbrenda, nrb, david, pbonzini
Cc: kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390, will,
julien.thierry.kdev, maz, oliver.upton, suzuki.poulose, yuzenghui,
joey.gouly, andre.przywara, shahuang, Boqiao Fu
On 25/06/2025 17.48, Alexandru Elisei wrote:
> kvmtool, unless told otherwise, will do its best to make sure that a kernel
> successfully boots in a virtual machine. It does things like automatically
> creating a rootfs and adding extra parameters to the kernel command line.
> This is actively harmful to kvm-unit-tests, because some tests parse the
> kernel command line and they will fail if they encounter the options added
> by kvmtool.
>
> Fortunately for us, kvmtool commit 5613ae26b998 ("Add --nodefaults command
> line argument") addded the --nodefaults kvmtool parameter which disables
> all the implicit virtual machine configuration that cannot be disabled by
> using other parameters, like modifying the kernel command line. So always
> use --nodefaults to allow a test to run.
>
> kvmtool can also be too verbose when running a virtual machine, and this is
> controlled by several parameters. Add those to the default kvmtool command
> line to reduce this verbosity to a minimum.
>
> Before:
>
> $ vm run arm/selftest.flat --cpus 2 --mem 256 --params "setup smp=2 mem=256"
> Info: # lkvm run -k arm/selftest.flat -m 256 -c 2 --name guest-5035
> Unknown subtest
>
> EXIT: STATUS=127
> Warning: KVM compatibility warning.
> virtio-9p device was not detected.
> While you have requested a virtio-9p device, the guest kernel did not initialize it.
> Please make sure that the guest kernel was compiled with CONFIG_NET_9P_VIRTIO=y enabled in .config.
> Warning: KVM compatibility warning.
> virtio-net device was not detected.
> While you have requested a virtio-net device, the guest kernel did not initialize it.
> Please make sure that the guest kernel was compiled with CONFIG_VIRTIO_NET=y enabled in .config.
> Info: KVM session ended normally.
>
> After:
>
> $ vm run arm/selftest.flat --nodefaults --network mode=none --loglevel=warning --cpus 2 --mem 256 --params "setup smp=2 mem=256"
> PASS: selftest: setup: smp: number of CPUs matches expectation
> INFO: selftest: setup: smp: found 2 CPUs
> PASS: selftest: setup: mem: memory size matches expectation
> INFO: selftest: setup: mem: found 256 MB
> SUMMARY: 2 tests
>
> EXIT: STATUS=1
>
> Note that KVMTOOL_DEFAULT_OPTS can be overwritten by an environment
> variable with the same name, but it's not documented in the help string for
> run_tests.sh. This has been done on purpose, since overwritting
> KVMTOOL_DEFAULT_OPTS should only be necessary for debugging or development
> purposes.
>
> Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
> Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
> ---
>
> Changes v3->v4:
>
> * Use vmm_default_opts() instead of indexing into vmm_optname
> * Reworded the help test for --nodefaults as per Shaoqin's suggestion.
>
> scripts/common.bash | 6 +++---
> scripts/vmm.bash | 18 ++++++++++++++++++
> 2 files changed, 21 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/common.bash b/scripts/common.bash
> index 7c1b89f1b3c2..d5d3101c8089 100644
> --- a/scripts/common.bash
> +++ b/scripts/common.bash
> @@ -37,7 +37,7 @@ function for_each_unittest()
> # -append as a kernel parameter instead of a command
> # line option.
> test_args=""
> - opts=""
> + opts="$(vmm_default_opts)"
> groups=""
> arch=""
> machine=""
> @@ -51,7 +51,7 @@ function for_each_unittest()
> elif [[ $line =~ ^test_args\ *=\ *(.*)$ ]]; then
> test_args="$(vmm_optname_args) ${BASH_REMATCH[1]}"
> elif [[ $line =~ ^$params_name\ *=\ *'"""'(.*)$ ]]; then
> - opts=${BASH_REMATCH[1]}$'\n'
> + opts="$(vmm_defaults_opts) ${BASH_REMATCH[1]}$'\n'"
> while read -r -u $fd; do
> #escape backslash newline, but not double backslash
> if [[ $opts =~ [^\\]*(\\*)$'\n'$ ]]; then
> @@ -67,7 +67,7 @@ function for_each_unittest()
> fi
> done
> elif [[ $line =~ ^$params_name\ *=\ *(.*)$ ]]; then
> - opts=${BASH_REMATCH[1]}
> + opts="$(vmm_default_opts) ${BASH_REMATCH[1]}"
> elif [[ $line =~ ^groups\ *=\ *(.*)$ ]]; then
> groups=${BASH_REMATCH[1]}
> elif [[ $line =~ ^arch\ *=\ *(.*)$ ]]; then
> diff --git a/scripts/vmm.bash b/scripts/vmm.bash
> index 0dd3f971ecdf..368690d62473 100644
> --- a/scripts/vmm.bash
> +++ b/scripts/vmm.bash
> @@ -1,3 +1,14 @@
> +# The following parameters are enabled by default when running a test with
> +# kvmtool:
> +# --nodefaults: suppress VM configuration that cannot be disabled (like
> +# modifying the supplied kernel command line). Otherwise tests
> +# that use the command line will fail without this parameter.
> +# --network mode=none: do not create a network device. kvmtool tries to help the
> +# user by automatically create one, and then prints a warning
> +# when the VM terminates if the device hasn't been initialized.
> +# --loglevel=warning: reduce verbosity
> +: "${KVMTOOL_DEFAULT_OPTS:="--nodefaults --network mode=none --loglevel=warning"}"
> +
> ##############################################################################
> # qemu_fixup_return_code translates the ambiguous exit status in Table1 to that
> # in Table2. Table3 simply documents the complete status table.
> @@ -82,11 +93,13 @@ function kvmtool_fixup_return_code()
>
> declare -A vmm_optname=(
> [qemu,args]='-append'
> + [qemu,default_opts]=''
> [qemu,fixup_return_code]=qemu_fixup_return_code
> [qemu,initrd]='-initrd'
> [qemu,nr_cpus]='-smp'
>
> [kvmtool,args]='--params'
> + [kvmtool,default_opts]="$KVMTOOL_DEFAULT_OPTS"
> [kvmtool,fixup_return_code]=kvmtool_fixup_return_code
> [kvmtool,initrd]='--initrd'
> [kvmtool,nr_cpus]='--cpus'
> @@ -97,6 +110,11 @@ function vmm_optname_args()
> echo ${vmm_optname[$(vmm_get_target),args]}
> }
>
> +function vmm_default_opts()
> +{
> + echo ${vmm_optname[$(vmm_get_target),default_opts]}
> +}
This causes now a problem on s390x:
https://gitlab.com/kvm-unit-tests/kvm-unit-tests/-/jobs/10604334029#L591
scripts/common.bash: line 56: vmm_defaults_opts: command not found
... any ideas how to fix it?
Thomas
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v4 07/13] scripts: Add default arguments for kvmtool
2025-07-11 11:32 ` Thomas Huth
@ 2025-07-11 14:35 ` Andrew Jones
2025-07-11 14:37 ` Thomas Huth
0 siblings, 1 reply; 26+ messages in thread
From: Andrew Jones @ 2025-07-11 14:35 UTC (permalink / raw)
To: Thomas Huth
Cc: Alexandru Elisei, eric.auger, lvivier, frankja, imbrenda, nrb,
david, pbonzini, kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390,
will, julien.thierry.kdev, maz, oliver.upton, suzuki.poulose,
yuzenghui, joey.gouly, andre.przywara, shahuang, Boqiao Fu
On Fri, Jul 11, 2025 at 01:32:33PM +0200, Thomas Huth wrote:
...
> > +function vmm_default_opts()
> > +{
> > + echo ${vmm_optname[$(vmm_get_target),default_opts]}
> > +}
>
>
> This causes now a problem on s390x:
>
> https://gitlab.com/kvm-unit-tests/kvm-unit-tests/-/jobs/10604334029#L591
>
> scripts/common.bash: line 56: vmm_defaults_opts: command not found
>
> ... any ideas how to fix it?
This is fixed by https://lore.kernel.org/all/20250709085938.33254-2-andrew.jones@linux.dev/
which I just pushed.
Thanks,
drew
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [kvm-unit-tests PATCH v4 07/13] scripts: Add default arguments for kvmtool
2025-07-11 14:35 ` Andrew Jones
@ 2025-07-11 14:37 ` Thomas Huth
0 siblings, 0 replies; 26+ messages in thread
From: Thomas Huth @ 2025-07-11 14:37 UTC (permalink / raw)
To: Andrew Jones
Cc: Alexandru Elisei, eric.auger, lvivier, frankja, imbrenda, nrb,
david, pbonzini, kvm, kvmarm, linuxppc-dev, kvm-riscv, linux-s390,
will, julien.thierry.kdev, maz, oliver.upton, suzuki.poulose,
yuzenghui, joey.gouly, andre.przywara, shahuang, Boqiao Fu
On 11/07/2025 16.35, Andrew Jones wrote:
> On Fri, Jul 11, 2025 at 01:32:33PM +0200, Thomas Huth wrote:
> ...
>>> +function vmm_default_opts()
>>> +{
>>> + echo ${vmm_optname[$(vmm_get_target),default_opts]}
>>> +}
>>
>>
>> This causes now a problem on s390x:
>>
>> https://gitlab.com/kvm-unit-tests/kvm-unit-tests/-/jobs/10604334029#L591
>>
>> scripts/common.bash: line 56: vmm_defaults_opts: command not found
>>
>> ... any ideas how to fix it?
>
> This is fixed by https://lore.kernel.org/all/20250709085938.33254-2-andrew.jones@linux.dev/
> which I just pushed.
Ah, right, thanks! And sorry for missing the patch!
Thomas
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2025-07-11 14:37 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-25 15:48 [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 01/13] run_tests.sh: Document --probe-maxsmp argument Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 02/13] scripts: Document environment variables Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 03/13] scripts: Refuse to run the tests if not configured for qemu Alexandru Elisei
2025-06-26 15:25 ` Andrew Jones
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 04/13] scripts: Use an associative array for qemu argument names Alexandru Elisei
2025-06-26 15:29 ` Andrew Jones
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 05/13] scripts: Add 'kvmtool_params' to test definition Alexandru Elisei
2025-06-26 15:34 ` Andrew Jones
2025-06-26 16:41 ` Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 06/13] scripts: Add support for kvmtool Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 07/13] scripts: Add default arguments " Alexandru Elisei
2025-06-26 15:43 ` Andrew Jones
2025-07-11 11:32 ` Thomas Huth
2025-07-11 14:35 ` Andrew Jones
2025-07-11 14:37 ` Thomas Huth
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 08/13] scripts: Add KVMTOOL environment variable for kvmtool binary path Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 09/13] scripts: Detect kvmtool failure in premature_failure() Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 10/13] scripts: Do not probe for maximum number of VCPUs when using kvmtool Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 11/13] scripts/mkstandalone: Export $TARGET Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 12/13] scripts: Add 'disabled_if' test definition parameter for kvmtool to use Alexandru Elisei
2025-06-25 15:48 ` [kvm-unit-tests PATCH v4 13/13] scripts: Enable kvmtool Alexandru Elisei
2025-06-26 16:42 ` [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add kvmtool to the runner script Andrew Jones
2025-06-26 16:48 ` Alexandru Elisei
2025-07-02 13:25 ` Andrew Jones
2025-07-04 8:41 ` Andrew Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).