[kvm-unit-tests PATCH v4 13/13] scripts: Enable kvmtool
Alexandru Elisei
alexandru.elisei at arm.com
Thu Jun 26 01:48:13 AEST 2025
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 at linux.dev>
Reviewed-by: Shaoqin Huang <shahuang at redhat.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei at 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
More information about the Linuxppc-dev
mailing list