From: Claudio Fontana <cfontana@suse.de>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: Laurent Vivier <lvivier@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Thomas Huth <thuth@redhat.com>,
qemu-block@nongnu.org, Andrew Jones <drjones@redhat.com>,
Roman Bolshakov <r.bolshakov@yadro.com>,
qemu-arm@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
John Snow <jsnow@redhat.com>
Subject: Re: [RFC PATCH 9/9] tests/qtest/arm-cpu-features: Restrict TCG-only tests
Date: Fri, 5 Feb 2021 16:20:43 +0100 [thread overview]
Message-ID: <17a58366-a25e-1c9b-eeba-2924803a48e7@suse.de> (raw)
In-Reply-To: <20210205144345.2068758-10-f4bug@amsat.org>
On 2/5/21 3:43 PM, Philippe Mathieu-Daudé wrote:
> Some tests explicitly request the TCG accelerator. As these
> tests will obviously fails if TCG is not present, disable
> them in such case.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> Cc: Roman Bolshakov <r.bolshakov@yadro.com>
> Cc: Claudio Fontana <cfontana@suse.de>
>
> RFC because of the TODO.
>
> Roman posted a series to have a QMP command to query enabled
> accelerators.
> ---
> tests/qtest/arm-cpu-features.c | 33 +++++++++++++++++++++++++++++----
> 1 file changed, 29 insertions(+), 4 deletions(-)
>
> diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c
> index c59c3cb002b..c6e86282b66 100644
> --- a/tests/qtest/arm-cpu-features.c
> +++ b/tests/qtest/arm-cpu-features.c
> @@ -20,7 +20,7 @@
> */
> #define SVE_MAX_VQ 16
>
> -#define MACHINE "-machine virt,gic-version=max -accel tcg "
> +#define MACHINE_TCG "-machine virt,gic-version=max -accel tcg "
> #define MACHINE_KVM "-machine virt,gic-version=max -accel kvm -accel tcg "
> #define QUERY_HEAD "{ 'execute': 'query-cpu-model-expansion', " \
> " 'arguments': { 'type': 'full', "
> @@ -41,6 +41,16 @@ static bool kvm_enabled(QTestState *qts)
> return enabled;
> }
>
> +static bool tcg_enabled(QTestState *qts)
> +{
> + /* TODO: Implement QMP query-accel? */
> +#ifdef CONFIG_TCG
> + return true;
> +#else
> + return false;
> +#endif /* CONFIG_TCG */
I would not use the same name as the existing tcg_enabled(), which has different semantics, even in test code;
what you mean here is tcg_available() right?
> +}
> +
> static QDict *do_query_no_props(QTestState *qts, const char *cpu_type)
> {
> return qtest_qmp(qts, QUERY_HEAD "'model': { 'name': %s }"
> @@ -352,7 +362,12 @@ static void sve_tests_sve_max_vq_8(const void *data)
> {
> QTestState *qts;
>
> - qts = qtest_init(MACHINE "-cpu max,sve-max-vq=8");
> + qts = qtest_init(MACHINE_TCG "-cpu max,sve-max-vq=8");
> +
> + if (!tcg_enabled(qts)) {
> + qtest_quit(qts);
> + return;
> + }
>
> assert_sve_vls(qts, "max", BIT_ULL(8) - 1, NULL);
>
> @@ -387,7 +402,12 @@ static void sve_tests_sve_off(const void *data)
> {
> QTestState *qts;
>
> - qts = qtest_init(MACHINE "-cpu max,sve=off");
> + qts = qtest_init(MACHINE_TCG "-cpu max,sve=off");
> +
> + if (!tcg_enabled(qts)) {
> + qtest_quit(qts);
> + return;
> + }
>
> /* SVE is off, so the map should be empty. */
> assert_sve_vls(qts, "max", 0, NULL);
> @@ -443,7 +463,12 @@ static void test_query_cpu_model_expansion(const void *data)
> {
> QTestState *qts;
>
> - qts = qtest_init(MACHINE "-cpu max");
> + qts = qtest_init(MACHINE_TCG "-cpu max");
> +
> + if (!tcg_enabled(qts)) {
> + qtest_quit(qts);
> + return;
> + }
>
> /* Test common query-cpu-model-expansion input validation */
> assert_type_full(qts);
>
next prev parent reply other threads:[~2021-02-05 15:27 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-05 14:43 [PATCH 0/9] hw/arm/virt: Improve CPU help and fix testing under KVM Philippe Mathieu-Daudé
2021-02-05 14:43 ` [PATCH 1/9] tests/qtest/arm-cpu-features: Remove Cortex-A15 check Philippe Mathieu-Daudé
2021-02-05 14:59 ` Andrew Jones
2021-02-05 15:15 ` Philippe Mathieu-Daudé
2021-02-05 15:33 ` Andrew Jones
2021-02-05 16:03 ` Philippe Mathieu-Daudé
2021-02-06 10:40 ` Andrew Jones
2021-02-08 14:22 ` John Snow
2021-02-05 14:43 ` [PATCH 2/9] tests/qtest: Restrict xlnx-can-test to TCG builds Philippe Mathieu-Daudé
2021-02-05 16:53 ` Alistair Francis
2021-02-05 16:57 ` Peter Maydell
2021-02-05 17:20 ` Philippe Mathieu-Daudé
2021-02-05 14:43 ` [PATCH 3/9] tests/qtest/boot-serial-test: Test Virt machine with 'max' Philippe Mathieu-Daudé
2021-02-05 15:02 ` Andrew Jones
2021-02-05 14:43 ` [PATCH 4/9] tests/qtest/cdrom-test: Only allow the Virt machine under KVM Philippe Mathieu-Daudé
2021-02-05 15:08 ` Andrew Jones
2021-02-05 15:15 ` Peter Maydell
2021-02-05 15:19 ` Philippe Mathieu-Daudé
2021-02-05 14:43 ` [PATCH 5/9] hw/arm/virt: Improve CPU name in help message Philippe Mathieu-Daudé
2021-02-05 14:58 ` Philippe Mathieu-Daudé
2021-02-05 15:09 ` Andrew Jones
2021-02-05 14:43 ` [PATCH 6/9] hw/arm/virt: Display list of valid CPUs for the Virt machine Philippe Mathieu-Daudé
2021-02-05 15:12 ` Andrew Jones
2021-02-05 15:27 ` Philippe Mathieu-Daudé
2021-02-05 14:43 ` [PATCH 7/9] hw/arm/virt: Do not include 64-bit CPUs in 32-bit build Philippe Mathieu-Daudé
2021-02-05 15:14 ` Andrew Jones
2021-02-05 14:43 ` [PATCH 8/9] hw/arm/virt: Restrict 32-bit CPUs to TCG Philippe Mathieu-Daudé
2021-02-05 15:19 ` Andrew Jones
2021-03-04 11:31 ` Claudio Fontana
2021-03-04 11:40 ` Peter Maydell
2021-02-05 14:43 ` [RFC PATCH 9/9] tests/qtest/arm-cpu-features: Restrict TCG-only tests Philippe Mathieu-Daudé
2021-02-05 15:20 ` Claudio Fontana [this message]
2021-02-05 15:30 ` Philippe Mathieu-Daudé
2021-02-05 15:44 ` Claudio Fontana
2021-02-05 15:27 ` Andrew Jones
2021-02-05 15:31 ` [PATCH 0/9] hw/arm/virt: Improve CPU help and fix testing under KVM Philippe Mathieu-Daudé
2021-03-04 11:13 ` Claudio Fontana
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=17a58366-a25e-1c9b-eeba-2924803a48e7@suse.de \
--to=cfontana@suse.de \
--cc=drjones@redhat.com \
--cc=f4bug@amsat.org \
--cc=jsnow@redhat.com \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=r.bolshakov@yadro.com \
--cc=thuth@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).