From: "Alex Bennée" <alex.bennee@linaro.org>
To: Thomas Huth <huth@tuxfamily.org>
Cc: buildroot@buildroot.org, Cyril Bur <cyrilbur@gmail.com>
Subject: Re: [Buildroot] [RFC PATCH v2 3/7] package/kvm-unit-tests: update dependencies
Date: Mon, 21 Jul 2025 09:29:39 +0100 [thread overview]
Message-ID: <87freqvte4.fsf@draig.linaro.org> (raw)
In-Reply-To: <20250720191413.47715a92@tpx1> (Thomas Huth's message of "Sun, 20 Jul 2025 19:14:13 +0200")
Thomas Huth <huth@tuxfamily.org> writes:
> Am Tue, 15 Jul 2025 10:19:38 +0100
> schrieb Alex Bennée <alex.bennee@linaro.org>:
>
>> Thomas Huth <huth@tuxfamily.org> writes:
>>
>> > Am Fri, 11 Jul 2025 17:44:01 +0100
>> > schrieb Alex Bennée <alex.bennee@linaro.org>:
>> >
>> >> To run the tests we need a system QEMU, timeout, getconf and nmap-ncat
>> >> so update the select/depends for them. As we need at least GCC 8 we
>> >> can drop the specific requirement for old x86-64 tests.
>> >>
>> >> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> >>
>> >> ---
>> >> v2
>> >> - remove old gcc notes as we need at least 8 anyway
>> >> - select QEMU and other runtime deps
>> >> - mention the runtime deps
>> >> - add support for getconf from external toolchain
>> >> - update comment fallback
>> >> ---
>> >> package/kvm-unit-tests/Config.in | 24 +++++++++++++++++-------
>> >> 1 file changed, 17 insertions(+), 7 deletions(-)
>> >>
>> >> diff --git a/package/kvm-unit-tests/Config.in b/package/kvm-unit-tests/Config.in
>> >> index 87b075c4b9..775b250d5f 100644
>> >> --- a/package/kvm-unit-tests/Config.in
>> >> +++ b/package/kvm-unit-tests/Config.in
>> >> @@ -14,12 +14,19 @@ config BR2_PACKAGE_KVM_UNIT_TESTS_ARCH_SUPPORTS
>> >>
>> >> config BR2_PACKAGE_KVM_UNIT_TESTS
>> >> bool "kvm-unit-tests"
>> >> - depends on BR2_PACKAGE_KVM_UNIT_TESTS_ARCH_SUPPORTS
>> >> - # on i386 and x86-64, __builtin_reachable is used, so we need
>> >> - # gcc 4.5 at least. on i386, we use the target gcc, while on
>> >> - # x86-64 we use the host gcc (see .mk file for details)
>> >> - depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_5 || !BR2_i386
>> >> depends on BR2_HOSTARCH = "x86_64" || !BR2_x86_64
>> >> + depends on BR2_PACKAGE_KVM_UNIT_TESTS_ARCH_SUPPORTS
>> >> + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_8 # qemu
>> >> + depends on BR2_PACKAGE_QEMU_ARCH_SUPPORTS_TARGET
>> >> + 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
>> >
>> > AFAIK kvm-unit-tests can be used with kvmtool instead of QEMU, too ... so
>> > hard-coding QEMU high might not be the best solution for the user?
>>
>> The current build doesn't support kvmtool but maybe something like this
>> as a follow-on patch:
>>
>> --8<---------------cut here---------------start------------->8---
>> modified package/kvm-unit-tests/Config.in
>> @@ -21,8 +21,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_KVMTOOL
>> + select BR2_PACKAGE_QEMU_SYSTEM if !BR2_PACKAGE_KVMTOOL # runtime for qemu-system-$ARCH
>> select BR2_PACKAGE_COREUTILS # runtime for timeout
>> select BR2_PACKAGE_BASH # runtime
>> select BR2_PACKAGE_NMAP
>> modified package/kvm-unit-tests/kvm-unit-tests.mk
>> @@ -36,6 +36,13 @@ KVM_UNIT_TESTS_CONF_OPTS =\
>> --processor="$(GCC_TARGET_CPU)" \
>> --endian="$(KVM_UNIT_TESTS_ENDIAN)"
>>
>> +# The default runner is QEMU but kvmtool can be used
>> +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
>> +
>> ifeq ($(BR2_ARM64_PAGE_SIZE_4K),y)
>> KVM_UNIT_TESTS_CONF_OPTS += --page-size=4k
>> else ifeq ($(BR2_ARM64_PAGE_SIZE_16K),y)
>> --8<---------------cut here---------------end--------------->8---
>>
>> What do you think?
>
> Looks good! ... though kvmtool can only be used for aarch64/arm or riscv
> as far as I know. Not sure whether that additional dependency should be
> reflected here, too, though.
I think I need to reflect this in Config.in instead as I don't think
BR2_PACKAGE_QEMU_SYSTEM/BR2_PACKAGE_KVMTOOL is available to the
KVM_UNIT_TESTS makefile.
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2025-07-21 8:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-11 16:43 [Buildroot] [RFC PATCH v2 0/7] kvm-unit-tests: update deps and fine tune qemu Alex Bennée
2025-07-11 16:43 ` [Buildroot] [RFC PATCH v2 1/7] toolchain/external: allow installing of libc utils Alex Bennée
2025-07-11 16:44 ` [Buildroot] [RFC PATCH v2 2/7] package/kvm-unit-tests: assume AArch64 supports KVM Alex Bennée
2025-07-12 6:32 ` Thomas Huth
2025-07-11 16:44 ` [Buildroot] [RFC PATCH v2 3/7] package/kvm-unit-tests: update dependencies Alex Bennée
2025-07-12 6:34 ` Thomas Huth
2025-07-15 9:19 ` Alex Bennée
2025-07-20 17:14 ` Thomas Huth
2025-07-21 8:29 ` Alex Bennée [this message]
2025-07-11 16:44 ` [Buildroot] [RFC PATCH v2 4/7] package/qemu: introduce kvm and tcg system options Alex Bennée
2025-07-11 16:44 ` [Buildroot] [RFC PATCH v2 5/7] package/kvm-unit-tests: bump to 2025-06-05 Alex Bennée
2025-07-12 6:29 ` Thomas Huth
2025-07-11 16:44 ` [Buildroot] [RFC PATCH v2 6/7] package/kvm-unit-tests: honour BR2_ARM64_PAGE_SIZE Alex Bennée
2025-07-12 6:35 ` Thomas Huth
2025-07-11 16:44 ` [Buildroot] [RFC PATCH v2 7/7] support/testing: add test for kvm-unit-tests Alex Bennée
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=87freqvte4.fsf@draig.linaro.org \
--to=alex.bennee@linaro.org \
--cc=buildroot@buildroot.org \
--cc=cyrilbur@gmail.com \
--cc=huth@tuxfamily.org \
/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