linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH v2 00/18] arm/arm64: Add kvmtool to the runner script
@ 2025-01-20 16:42 Alexandru Elisei
  2025-01-20 16:42 ` [kvm-unit-tests PATCH v2 01/18] run_tests: Document --probe-maxsmp argument Alexandru Elisei
                   ` (17 more replies)
  0 siblings, 18 replies; 51+ messages in thread
From: Alexandru Elisei @ 2025-01-20 16:42 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

Finally got fed up with manually running a test with kvmtool, so I've
decided to send v2 of the series [1] that adds kvmtool support to
run_tests.sh. The series has significantly more patches now, but that's
mostly because I split a large patch into several smaller ones (as per
Andre's suggestion), which I hope will make reviewing easier. Because of
this I removed two Reviewed-by tags from Drew and Thomas Huth - your review
is much appreciated!

To goal is to have an user 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 hack than qemu, which means
developers may prefer it when adding or prototyping new features to KVM.
Being able to run all the tests reliably and automatically is very useful
in the development process.

* 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.

The series has been rewritten since v1 [1]. This is a brief overview of the
major changes:

* Split into smaller patches.
* Document environment variables and --probe-maxsmp options.
* New unittest parameter, qemu_params, to replace extra_params going
forward (extra_params has been kept for compatibility)
* New unittest parameter, kvmtool_params, for kvmtool specific arguments
needed to run a test.
* New unittest parameter, disabled_if, to disable a test that cannot run
under kvmtool.

I would very much like more input regarding disabled_if. Allows all sorts
of combinations, like:

[ "$TARGET" = kvmtool ] && ([ -z "$CONFIG_EFI" ] || [ "$CONFIG_EFI" = n ])

and that's because it's evaluated as-is in a bash if statement - might have
security implications. I could have just added something like
supported_vmms, but I thought the current approach looks more flexible.
Although that might just be premature optimization.

There's only one limitation as far as I know - UEFI tests don't work. I
tried to run a .efi test with kvmtool manually, but kvmtool froze and I
didn't get any output. I am not familiar with EDK2, so I thought I can send
the this series and get feedback on it while I make time to figure out what
is going on - it might be something with kvm-unit-tests, EDK2, kvmtool, or
a combination of them. And I don't think UEFI support is very important at
the moment, no distro ships a EDK2 binary compiled for kvmtool so I don't
think there would be many users for it.

[1] https://lore.kernel.org/kvm/20210702163122.96110-1-alexandru.elisei@arm.com/

Please review,
Alex

Alexandru Elisei (18):
  run_tests: Document --probe-maxsmp argument
  Document environment variables
  scripts: Refuse to run the tests if not configured for qemu
  run_tests: Introduce unittest parameter 'qemu_params'
  scripts: Rename run_qemu_status -> run_test_status
  scripts: Merge the qemu parameter -smp into $qemu_opts
  scripts: Introduce kvmtool_opts
  scripts/runtime: Detect kvmtool failure in premature_failure()
  scripts/runtime: Skip test when kvmtool and $accel is not KVM
  scripts/arch-run: Add support for kvmtool
  arm/run: Add support for kvmtool
  scripts/runtime: Add default arguments for kvmtool
  run_tests: Do not probe for maximum number of VCPUs when using kvmtool
  run_tests: Add KVMTOOL environment variable for kvmtool binary path
  Add kvmtool_params to test specification
  scripts/mkstandalone: Export $TARGET
  unittest: Add disabled_if parameter and use it for kvmtool
  run_tests: Enable kvmtool

 arm/efi/run             |   8 ++
 arm/run                 | 164 +++++++++++++++++++++++++---------------
 arm/unittests.cfg       |  34 +++++++++
 docs/unittests.txt      |  43 +++++++++--
 powerpc/run             |   2 +-
 riscv/run               |   4 +-
 run_tests.sh            |  50 ++++++++----
 s390x/run               |   2 +-
 scripts/arch-run.bash   |  80 ++++++++++++++++++--
 scripts/common.bash     |  63 +++++++++------
 scripts/mkstandalone.sh |   9 +++
 scripts/runtime.bash    |  64 +++++++++++++---
 12 files changed, 399 insertions(+), 124 deletions(-)


base-commit: 0ed2cdf3c80ee803b9150898e687e77e4d6f5db2
-- 
2.34.1



^ permalink raw reply	[flat|nested] 51+ messages in thread

end of thread, other threads:[~2025-02-17 16:04 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-20 16:42 [kvm-unit-tests PATCH v2 00/18] arm/arm64: Add kvmtool to the runner script Alexandru Elisei
2025-01-20 16:42 ` [kvm-unit-tests PATCH v2 01/18] run_tests: Document --probe-maxsmp argument Alexandru Elisei
2025-01-21 14:41   ` Andrew Jones
2025-01-20 16:43 ` [kvm-unit-tests PATCH v2 02/18] Document environment variables Alexandru Elisei
2025-01-21 14:41   ` Andrew Jones
2025-01-20 16:43 ` [kvm-unit-tests PATCH v2 03/18] scripts: Refuse to run the tests if not configured for qemu Alexandru Elisei
2025-01-21 14:48   ` Andrew Jones
2025-01-21 15:54     ` Alexandru Elisei
2025-01-21 16:17       ` Andrew Jones
2025-01-21 16:20         ` Alexandru Elisei
2025-02-10 10:41     ` Alexandru Elisei
2025-02-10 13:56       ` Andrew Jones
2025-02-10 18:04         ` Alexandru Elisei
2025-02-17 16:02           ` Al Dunsmuir
2025-01-20 16:43 ` [kvm-unit-tests PATCH v2 04/18] run_tests: Introduce unittest parameter 'qemu_params' Alexandru Elisei
2025-01-21 15:46   ` Andrew Jones
2025-02-12 13:40     ` Alexandru Elisei
2025-02-12 15:48       ` Andrew Jones
2025-01-20 16:43 ` [kvm-unit-tests PATCH v2 05/18] scripts: Rename run_qemu_status -> run_test_status Alexandru Elisei
2025-01-21 15:55   ` Andrew Jones
2025-01-20 16:43 ` [kvm-unit-tests PATCH v2 06/18] scripts: Merge the qemu parameter -smp into $qemu_opts Alexandru Elisei
2025-01-21 16:12   ` Andrew Jones
2025-01-20 16:43 ` [kvm-unit-tests PATCH v2 07/18] scripts: Introduce kvmtool_opts Alexandru Elisei
2025-01-21 16:24   ` Andrew Jones
2025-01-20 16:43 ` [kvm-unit-tests PATCH v2 08/18] scripts/runtime: Detect kvmtool failure in premature_failure() Alexandru Elisei
2025-01-21 16:29   ` Andrew Jones
2025-01-20 16:43 ` [kvm-unit-tests PATCH v2 09/18] scripts/runtime: Skip test when kvmtool and $accel is not KVM Alexandru Elisei
2025-01-21 16:30   ` Andrew Jones
2025-01-20 16:43 ` [kvm-unit-tests PATCH v2 10/18] scripts/arch-run: Add support for kvmtool Alexandru Elisei
2025-01-21 16:46   ` Andrew Jones
2025-01-20 16:43 ` [kvm-unit-tests PATCH v2 11/18] arm/run: " Alexandru Elisei
2025-01-21 16:50   ` Andrew Jones
2025-01-20 16:43 ` [kvm-unit-tests PATCH v2 12/18] scripts/runtime: Add default arguments " Alexandru Elisei
2025-01-23 14:07   ` Andrew Jones
2025-01-23 14:20     ` Alexandru Elisei
2025-01-20 16:43 ` [kvm-unit-tests PATCH v2 13/18] run_tests: Do not probe for maximum number of VCPUs when using kvmtool Alexandru Elisei
2025-01-23 15:36   ` Andrew Jones
2025-01-20 16:43 ` [kvm-unit-tests PATCH v2 14/18] run_tests: Add KVMTOOL environment variable for kvmtool binary path Alexandru Elisei
2025-01-23 15:43   ` Andrew Jones
2025-01-20 16:43 ` [kvm-unit-tests PATCH v2 15/18] Add kvmtool_params to test specification Alexandru Elisei
2025-01-23 15:53   ` Andrew Jones
2025-02-11 15:03     ` Alexandru Elisei
2025-02-12 15:56       ` Andrew Jones
2025-02-12 16:34         ` Alexandru Elisei
2025-02-13 13:59           ` Andrew Jones
2025-01-20 16:43 ` [kvm-unit-tests PATCH v2 16/18] scripts/mkstandalone: Export $TARGET Alexandru Elisei
2025-01-23 15:53   ` Andrew Jones
2025-01-20 16:43 ` [kvm-unit-tests PATCH v2 17/18] unittest: Add disabled_if parameter and use it for kvmtool Alexandru Elisei
2025-01-23 16:08   ` Andrew Jones
2025-01-20 16:43 ` [kvm-unit-tests PATCH v2 18/18] run_tests: Enable kvmtool Alexandru Elisei
2025-01-23 16:12   ` 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).