aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndrew Jones <drjones@redhat.com>2019-10-31 15:27:34 +0100
committerPeter Maydell <peter.maydell@linaro.org>2019-11-01 20:40:59 +0000
commit87014c6b3660ce54a57cb72171d6f93306b0c44a (patch)
treeb6d4c629d56e000b1245ca7f47db35128367d051 /tests
parent6fa8a37949d912bb463caa0c139ff0ca88c6ec33 (diff)
downloadqemu-87014c6b3660ce54a57cb72171d6f93306b0c44a.zip
qemu-87014c6b3660ce54a57cb72171d6f93306b0c44a.tar.gz
qemu-87014c6b3660ce54a57cb72171d6f93306b0c44a.tar.bz2
target/arm/kvm: host cpu: Add support for sve<N> properties
Allow cpu 'host' to enable SVE when it's available, unless the user chooses to disable it with the added 'sve=off' cpu property. Also give the user the ability to select vector lengths with the sve<N> properties. We don't adopt 'max' cpu's other sve property, sve-max-vq, because that property is difficult to use with KVM. That property assumes all vector lengths in the range from 1 up to and including the specified maximum length are supported, but there may be optional lengths not supported by the host in that range. With KVM one must be more specific when enabling vector lengths. Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Tested-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com> Message-id: 20191031142734.8590-10-drjones@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/arm-cpu-features.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/arm-cpu-features.c b/tests/arm-cpu-features.c
index ffdbc3f..6e99aa9 100644
--- a/tests/arm-cpu-features.c
+++ b/tests/arm-cpu-features.c
@@ -458,8 +458,8 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
"We cannot guarantee the CPU type 'cortex-a15' works "
"with KVM on this host", NULL);
- assert_has_feature(qts, "max", "sve");
- resp = do_query_no_props(qts, "max");
+ assert_has_feature(qts, "host", "sve");
+ resp = do_query_no_props(qts, "host");
kvm_supports_sve = resp_get_feature(resp, "sve");
vls = resp_get_sve_vls(resp);
qobject_unref(resp);
@@ -470,7 +470,7 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
sprintf(max_name, "sve%d", max_vq * 128);
/* Enabling a supported length is of course fine. */
- assert_sve_vls(qts, "max", vls, "{ %s: true }", max_name);
+ assert_sve_vls(qts, "host", vls, "{ %s: true }", max_name);
/* Get the next supported length smaller than max-vq. */
vq = 64 - __builtin_clzll(vls & ~BIT_ULL(max_vq - 1));
@@ -479,7 +479,7 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
* We have at least one length smaller than max-vq,
* so we can disable max-vq.
*/
- assert_sve_vls(qts, "max", (vls & ~BIT_ULL(max_vq - 1)),
+ assert_sve_vls(qts, "host", (vls & ~BIT_ULL(max_vq - 1)),
"{ %s: false }", max_name);
/*
@@ -489,7 +489,7 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
*/
sprintf(name, "sve%d", vq * 128);
error = g_strdup_printf("cannot disable %s", name);
- assert_error(qts, "max", error,
+ assert_error(qts, "host", error,
"{ %s: true, %s: false }",
max_name, name);
g_free(error);
@@ -502,7 +502,7 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
vq = __builtin_ffsll(vls);
sprintf(name, "sve%d", vq * 128);
error = g_strdup_printf("cannot disable %s", name);
- assert_error(qts, "max", error, "{ %s: false }", name);
+ assert_error(qts, "host", error, "{ %s: false }", name);
g_free(error);
/* Get an unsupported length. */
@@ -514,7 +514,7 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
if (vq <= SVE_MAX_VQ) {
sprintf(name, "sve%d", vq * 128);
error = g_strdup_printf("cannot enable %s", name);
- assert_error(qts, "max", error, "{ %s: true }", name);
+ assert_error(qts, "host", error, "{ %s: true }", name);
g_free(error);
}
} else {
@@ -523,8 +523,7 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
} else {
assert_has_not_feature(qts, "host", "aarch64");
assert_has_not_feature(qts, "host", "pmu");
-
- assert_has_not_feature(qts, "max", "sve");
+ assert_has_not_feature(qts, "host", "sve");
}
qtest_quit(qts);