From: "Alex Bennée" <alex.bennee@linaro.org>
To: buildroot@buildroot.org
Cc: Thomas Huth <huth@tuxfamily.org>,
Thomas Huth <th.huth+br@posteo.eu>,
Cyril Bur <cyrilbur@gmail.com>
Subject: [Buildroot] [PATCH v6 6/6] package/kvm-unit-tests: allow kvmtool to be used
Date: Wed, 25 Feb 2026 10:55:35 +0000 [thread overview]
Message-ID: <20260225105537.1420002-7-alex.bennee@linaro.org> (raw)
In-Reply-To: <20260225105537.1420002-1-alex.bennee@linaro.org>
For some targets launching tests with kvmtool is an option which makes
for an even smaller test image. Create a new symbol which can be
expanded with additional targets that will allow the skipping of the
selection of QEMU if not needed.
Reviewed-by: Thomas Huth <huth@tuxfamily.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
v2
- expand to include riscv, didn't bother with 32 bit arm given its deprecated
- only expand target when arch can support it
- update comment depends
---
package/kvm-unit-tests/Config.in | 12 +++++++++---
package/kvm-unit-tests/kvm-unit-tests.mk | 11 +++++++++++
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/package/kvm-unit-tests/Config.in b/package/kvm-unit-tests/Config.in
index 74c32f46e0..f5b4177106 100644
--- a/package/kvm-unit-tests/Config.in
+++ b/package/kvm-unit-tests/Config.in
@@ -13,6 +13,11 @@ config BR2_PACKAGE_KVM_UNIT_TESTS_ARCH_SUPPORTS
default y if BR2_powerpc64 || BR2_powerpc64le
default y if BR2_s390x
+# Some architectures can use kvmtool instead of QEMU to launch the tests
+config BR2_PACKAGE_KVM_UNIT_TESTS_CAN_USE_KVMTOOL
+ bool
+ default y if (BR2_aarch64 || BR2_riscv) && BR2_PACKAGE_KVMTOOL
+
config BR2_PACKAGE_KVM_UNIT_TESTS
bool "kvm-unit-tests"
depends on BR2_PACKAGE_KVM_UNIT_TESTS_ARCH_SUPPORTS
@@ -24,8 +29,8 @@ config BR2_PACKAGE_KVM_UNIT_TESTS
depends on (BR2_PACKAGE_GLIBC_UTILS || \
BR2_UCLIBC_INSTALL_UTILS || \
BR2_TOOLCHAIN_EXTERNAL_LIBC_UTILS_COPY) # runtime getconf
- select BR2_PACKAGE_QEMU
- select BR2_PACKAGE_QEMU_SYSTEM # runtime for qemu-system-$ARCH
+ select BR2_PACKAGE_QEMU if !BR2_PACKAGE_KVM_UNIT_TESTS_CAN_USE_KVMTOOL
+ select BR2_PACKAGE_QEMU_SYSTEM if !BR2_PACKAGE_KVM_UNIT_TESTS_CAN_USE_KVMTOOL # runtime for qemu-system-$ARCH
select BR2_PACKAGE_COREUTILS # runtime for timeout
select BR2_PACKAGE_BASH # runtime
select BR2_PACKAGE_NMAP
@@ -55,4 +60,5 @@ comment "kvm-unit-tests needs a toolchain w/ utils, gcc >= 8 and qemu"
depends on !(BR2_PACKAGE_GLIBC_UTILS || \
BR2_UCLIBC_INSTALL_UTILS || \
BR2_TOOLCHAIN_EXTERNAL_LIBC_UTILS_COPY)
- depends on !BR2_PACKAGE_QEMU_ARCH_SUPPORTS_TARGET
+ depends on !(BR2_PACKAGE_QEMU_ARCH_SUPPORTS_TARGET || \
+ BR2_PACKAGE_KVM_UNIT_TESTS_CAN_USE_KVMTOOL)
diff --git a/package/kvm-unit-tests/kvm-unit-tests.mk b/package/kvm-unit-tests/kvm-unit-tests.mk
index efc3c859aa..02191275a2 100644
--- a/package/kvm-unit-tests/kvm-unit-tests.mk
+++ b/package/kvm-unit-tests/kvm-unit-tests.mk
@@ -40,6 +40,17 @@ KVM_UNIT_TESTS_CONF_OPTS =\
--processor="$(GCC_TARGET_CPU)" \
--endian="$(KVM_UNIT_TESTS_ENDIAN)"
+# The default runner is QEMU but kvmtool can also be used on some
+# architectures. The flag only works for those architectures that can
+# support both.
+ifeq ($(BR2_PACKAGE_KVM_UNIT_TESTS_CAN_USE_KVMTOOL), y)
+ifeq ($(BR2_PACKAGE_QEMU_SYSTEM),y)
+KVM_UNIT_TESTS_CONF_OPTS += --target=qemu
+else ifeq ($(BR2_PACKAGE_KVMTOOL),y)
+KVM_UNIT_TESTS_CONF_OPTS += --target=kvmtool
+endif
+endif
+
ifeq ($(BR2_ARM64_PAGE_SIZE_4K),y)
KVM_UNIT_TESTS_CONF_OPTS += --page-size=4k
else ifeq ($(BR2_ARM64_PAGE_SIZE_16K),y)
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2026-02-25 10:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 10:55 [Buildroot] [PATCH v6 0/6] kvm-unit-tests: update deps and fine tune qemu Alex Bennée
2026-02-25 10:55 ` [Buildroot] [PATCH v6 1/6] toolchain/external: allow installing of libc utils Alex Bennée
2026-03-10 21:53 ` Romain Naour via buildroot
2026-02-25 10:55 ` [Buildroot] [PATCH v6 2/6] package/kvm-unit-tests: update dependencies Alex Bennée
2026-03-10 22:02 ` Romain Naour via buildroot
2026-03-10 22:07 ` Romain Naour via buildroot
2026-02-25 10:55 ` [Buildroot] [PATCH v6 3/6] package/kvm-unit-tests: bump to v2025-07-31 Alex Bennée
2026-03-10 22:09 ` Romain Naour via buildroot
2026-02-25 10:55 ` [Buildroot] [PATCH v6 4/6] package/kvm-unit-tests: honour BR2_ARM64_PAGE_SIZE Alex Bennée
2026-03-10 22:16 ` Romain Naour via buildroot
2026-02-25 10:55 ` [Buildroot] [PATCH v6 5/6] support/testing: add test for kvm-unit-tests Alex Bennée
2026-03-10 22:31 ` Romain Naour via buildroot
2026-02-25 10:55 ` Alex Bennée [this message]
2026-03-10 22:44 ` [Buildroot] [PATCH v6 6/6] package/kvm-unit-tests: allow kvmtool to be used Romain Naour via buildroot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260225105537.1420002-7-alex.bennee@linaro.org \
--to=alex.bennee@linaro.org \
--cc=buildroot@buildroot.org \
--cc=cyrilbur@gmail.com \
--cc=huth@tuxfamily.org \
--cc=th.huth+br@posteo.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox