From: Haibo Xu <haibo.xu@linaro.org>
To: qemu-devel@nongnu.org, qemu-arm@nongnu.org
Cc: peter.maydell@linaro.org, drjones@redhat.com,
richard.henderson@linaro.org, abologna@redhat.com,
Haibo Xu <haibo.xu@linaro.org>,
philmd@redhat.com
Subject: [PATCH RESEND v2 6/6] target/arm: Add vCPU feature 'el2' test.
Date: Thu, 1 Apr 2021 12:55:38 +0000 [thread overview]
Message-ID: <50db1700b4df48acbecfda077b2220a0e3cf6b49.1617281290.git.haibo.xu@linaro.org> (raw)
In-Reply-To: <cover.1617281290.git.haibo.xu@linaro.org>
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 80c64fa355..6c39238925 100644
--- a/target/arm/monitor.c
+++ b/target/arm/monitor.c
@@ -90,7 +90,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", "sve", "el2",
"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 8252b85bb8..be07bf0c76 100644
--- a/tests/qtest/arm-cpu-features.c
+++ b/tests/qtest/arm-cpu-features.c
@@ -509,6 +509,7 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
if (g_str_equal(qtest_get_arch(), "aarch64")) {
bool kvm_supports_steal_time;
bool kvm_supports_sve;
+ bool kvm_supports_el2;
char max_name[8], name[8];
uint32_t max_vq, vq;
uint64_t vls;
@@ -533,10 +534,12 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
*/
assert_has_feature(qts, "host", "kvm-steal-time");
assert_has_feature(qts, "host", "sve");
+ assert_has_feature(qts, "host", "el2");
resp = do_query_no_props(qts, "host");
kvm_supports_steal_time = resp_get_feature(resp, "kvm-steal-time");
kvm_supports_sve = resp_get_feature(resp, "sve");
+ kvm_supports_el2 = resp_get_feature(resp, "el2");
vls = resp_get_sve_vls(resp);
qobject_unref(resp);
@@ -602,11 +605,17 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
} else {
g_assert(vls == 0);
}
+
+ if (kvm_supports_el2) {
+ assert_set_feature(qts, "host", "el2", false);
+ assert_set_feature(qts, "host", "el2", 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", "kvm-steal-time");
+ assert_has_not_feature(qts, "host", "el2");
}
qtest_quit(qts);
--
2.17.1
next prev parent reply other threads:[~2021-04-01 13:01 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-01 12:55 [PATCH RESEND v2 0/6] target/arm: Add nested virtualization support Haibo Xu
2021-04-01 12:55 ` [PATCH RESEND v2 1/6] Update linux header with new arm64 NV macro Haibo Xu
2021-04-01 12:55 ` [PATCH RESEND v2 2/6] target/arm/kvm: Add helper to detect el2 when using KVM Haibo Xu
2021-04-27 8:27 ` Andrew Jones
2021-04-01 12:55 ` [PATCH RESEND v2 3/6] target/arm/kvm: Add an option to turn on/off el2 support Haibo Xu
2021-04-27 8:38 ` Andrew Jones
2021-04-27 9:29 ` Peter Maydell
2021-04-01 12:55 ` [PATCH RESEND v2 4/6] hw/intc/arm_gicv3: Enable support for setting vGIC maintenance IRQ Haibo Xu
2021-04-27 8:55 ` Andrew Jones
2021-04-01 12:55 ` [PATCH RESEND v2 5/6] target/arm/cpu: Enable 'el2' to work with host/max cpu Haibo Xu
2021-04-27 9:24 ` Andrew Jones
2021-04-27 9:38 ` Peter Maydell
2021-04-27 9:49 ` Andrew Jones
2021-04-27 12:04 ` Peter Maydell
2021-04-01 12:55 ` Haibo Xu [this message]
2021-04-27 9:37 ` [PATCH RESEND v2 6/6] target/arm: Add vCPU feature 'el2' test Andrew Jones
2021-04-01 17:53 ` [PATCH RESEND v2 0/6] target/arm: Add nested virtualization support Andrea Bolognani
2021-04-27 9:40 ` Andrew Jones
2021-04-27 9:42 ` Peter Maydell
2021-04-27 9:54 ` Andrew Jones
2021-04-27 12:15 ` Peter Maydell
2021-04-27 14:48 ` Andrew Jones
2021-04-27 14:58 ` Peter Maydell
2021-04-27 15:01 ` Peter Maydell
2021-04-27 16:17 ` Andrew Jones
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=50db1700b4df48acbecfda077b2220a0e3cf6b49.1617281290.git.haibo.xu@linaro.org \
--to=haibo.xu@linaro.org \
--cc=abologna@redhat.com \
--cc=drjones@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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;
as well as URLs for NNTP newsgroup(s).