[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 12/12] target/arm: spe: Add corresponding test.
From: |
Haibo Xu |
Subject: |
[PATCH v3 12/12] target/arm: spe: Add corresponding test. |
Date: |
Tue, 15 Sep 2020 03:11:48 +0000 |
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Haibo Xu <haibo.xu@linaro.org>
---
target/arm/monitor.c | 2 +-
tests/qtest/arm-cpu-features.c | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/target/arm/monitor.c b/target/arm/monitor.c
index ba6e01abd0..1b8f08988a 100644
--- a/target/arm/monitor.c
+++ b/target/arm/monitor.c
@@ -99,7 +99,7 @@ QEMU_BUILD_BUG_ON(ARM_MAX_VQ > 16);
* then the order that considers those dependencies must be used.
*/
static const char *cpu_model_advertised_features[] = {
- "aarch64", "pmu", "sve",
+ "aarch64", "pmu", "spe", "sve",
"sve128", "sve256", "sve384", "sve512",
"sve640", "sve768", "sve896", "sve1024", "sve1152", "sve1280",
"sve1408", "sve1536", "sve1664", "sve1792", "sve1920", "sve2048",
diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c
index 77b5e30a9c..4d393fb2e2 100644
--- a/tests/qtest/arm-cpu-features.c
+++ b/tests/qtest/arm-cpu-features.c
@@ -494,6 +494,7 @@ static void test_query_cpu_model_expansion_kvm(const void
*data)
if (g_str_equal(qtest_get_arch(), "aarch64")) {
bool kvm_supports_sve;
+ bool kvm_supports_spe;
char max_name[8], name[8];
uint32_t max_vq, vq;
uint64_t vls;
@@ -512,8 +513,10 @@ static void test_query_cpu_model_expansion_kvm(const void
*data)
"with KVM on this host", NULL);
assert_has_feature(qts, "host", "sve");
+ assert_has_feature(qts, "host", "spe");
resp = do_query_no_props(qts, "host");
kvm_supports_sve = resp_get_feature(resp, "sve");
+ kvm_supports_spe = resp_get_feature(resp, "spe");
vls = resp_get_sve_vls(resp);
qobject_unref(resp);
@@ -573,10 +576,16 @@ static void test_query_cpu_model_expansion_kvm(const void
*data)
} else {
g_assert(vls == 0);
}
+
+ if (kvm_supports_spe) {
+ assert_set_feature(qts, "host", "spe", false);
+ assert_set_feature(qts, "host", "spe", true);
+ }
} else {
assert_has_not_feature(qts, "host", "aarch64");
assert_has_not_feature(qts, "host", "pmu");
assert_has_not_feature(qts, "host", "sve");
+ assert_has_not_feature(qts, "host", "spe");
}
qtest_quit(qts);
--
2.17.1
- [PATCH v3 07/12] hw/arm/virt: Move post cpu realize check into its own function, (continued)
[PATCH v3 08/12] hw/arm/virt: Move kvm pmu setup to virt_cpu_post_init, Haibo Xu, 2020/09/14
[PATCH v3 09/12] hw/arm/virt: spe: Add vSPE device and corresponding interrupt support, Haibo Xu, 2020/09/14
[PATCH v3 10/12] target/arm/cpu: spe: Enable spe to work with host cpu, Haibo Xu, 2020/09/14
[PATCH v3 11/12] target/arm/kvm: spe: Enable userspace irqchip support., Haibo Xu, 2020/09/14
[PATCH v3 12/12] target/arm: spe: Add corresponding test.,
Haibo Xu <=