[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 07/12] qtest/arm-cpu-features: Use generic qtest_has_accel() t
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v4 07/12] qtest/arm-cpu-features: Use generic qtest_has_accel() to check for TCG |
Date: |
Thu, 15 Apr 2021 18:32:59 +0200 |
Now than we can probe if the TCG accelerator is available
at runtime with a QMP command, only run these tests if TCG
is built into the QEMU binary.
Suggested-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
tests/qtest/arm-cpu-features.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c
index b1d406542f7..0d9145dd168 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 "
#define QUERY_HEAD "{ 'execute': 'query-cpu-model-expansion', " \
" 'arguments': { 'type': 'full', "
@@ -337,7 +337,7 @@ 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");
assert_sve_vls(qts, "max", BIT_ULL(8) - 1, NULL);
@@ -372,7 +372,7 @@ 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");
/* SVE is off, so the map should be empty. */
assert_sve_vls(qts, "max", 0, NULL);
@@ -428,7 +428,7 @@ 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");
/* Test common query-cpu-model-expansion input validation */
assert_type_full(qts);
@@ -593,8 +593,10 @@ int main(int argc, char **argv)
{
g_test_init(&argc, &argv, NULL);
- qtest_add_data_func("/arm/query-cpu-model-expansion",
- NULL, test_query_cpu_model_expansion);
+ if (qtest_has_accel("tcg")) {
+ qtest_add_data_func("/arm/query-cpu-model-expansion",
+ NULL, test_query_cpu_model_expansion);
+ }
/*
* For now we only run KVM specific tests with AArch64 QEMU in
@@ -608,7 +610,7 @@ int main(int argc, char **argv)
NULL, sve_tests_sve_off_kvm);
}
- if (g_str_equal(qtest_get_arch(), "aarch64")) {
+ if (g_str_equal(qtest_get_arch(), "aarch64") && qtest_has_accel("tcg")) {
qtest_add_data_func("/arm/max/query-cpu-model-expansion/sve-max-vq-8",
NULL, sve_tests_sve_max_vq_8);
qtest_add_data_func("/arm/max/query-cpu-model-expansion/sve-off",
--
2.26.3
- Re: [PATCH v4 03/12] tests/qtest: Add qtest_has_accel() method, (continued)
- [PATCH v4 04/12] qtest/arm-cpu-features: Use generic qtest_has_accel() to check for KVM, Philippe Mathieu-Daudé, 2021/04/15
- [PATCH v4 05/12] qtest/arm-cpu-features: Restrict sve_tests_sve_off_kvm test to KVM, Philippe Mathieu-Daudé, 2021/04/15
- [PATCH v4 06/12] qtest/arm-cpu-features: Remove TCG fallback to KVM specific tests, Philippe Mathieu-Daudé, 2021/04/15
- [PATCH v4 07/12] qtest/arm-cpu-features: Use generic qtest_has_accel() to check for TCG,
Philippe Mathieu-Daudé <=
- [PATCH v4 08/12] qtest/bios-tables-test: Make test build-independent from accelerator, Philippe Mathieu-Daudé, 2021/04/15
- [PATCH v4 09/12] qtest/migration-test: Skip tests if KVM not builtin on s390x/ppc64, Philippe Mathieu-Daudé, 2021/04/15
- [PATCH v4 10/12] qtest/qmp-cmd-test: Make test build-independent from accelerator, Philippe Mathieu-Daudé, 2021/04/15