From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: yuzenghui@huawei.com, peter.maydell@linaro.org
Subject: [PATCH 1/4] target/arm: Fix sve_zcr_len_for_el for VHE mode running
Date: Thu, 27 Jan 2022 17:34:25 +1100 [thread overview]
Message-ID: <20220127063428.30212-2-richard.henderson@linaro.org> (raw)
In-Reply-To: <20220127063428.30212-1-richard.henderson@linaro.org>
When HCR_EL2.{E2H,TGE} == '11', ZCR_EL1 is unused.
Reported-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/helper.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/target/arm/helper.c b/target/arm/helper.c
index cfca0f5ba6..d9ee2ba5f4 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -6225,7 +6225,8 @@ uint32_t sve_zcr_len_for_el(CPUARMState *env, int el)
ARMCPU *cpu = env_archcpu(env);
uint32_t zcr_len = cpu->sve_max_vq - 1;
- if (el <= 1) {
+ if (el <= 1 &&
+ (arm_hcr_el2_eff(env) & (HCR_E2H | HCR_TGE)) != (HCR_E2H | HCR_TGE)) {
zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[1]);
}
if (el <= 2 && arm_feature(env, ARM_FEATURE_EL2)) {
--
2.25.1
next prev parent reply other threads:[~2022-01-27 7:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-27 6:34 [PATCH 0/4] target/arm: SVE fixes versus VHE Richard Henderson
2022-01-27 6:34 ` Richard Henderson [this message]
2022-01-28 18:18 ` [PATCH 1/4] target/arm: Fix sve_zcr_len_for_el for VHE mode running Peter Maydell
2022-01-29 6:49 ` Zenghui Yu via
2022-01-27 6:34 ` [PATCH 2/4] target/arm: Tidy sve_exception_el for CPACR_EL1 access Richard Henderson
2022-01-28 18:15 ` Peter Maydell
2022-01-29 6:50 ` Zenghui Yu via
2022-01-27 6:34 ` [PATCH 3/4] target/arm: Fix {fp, sve}_exception_el for VHE mode running Richard Henderson
2022-01-28 18:23 ` Peter Maydell
2022-01-29 6:50 ` [PATCH 3/4] target/arm: Fix {fp,sve}_exception_el " Zenghui Yu via
2022-01-27 6:34 ` [PATCH 4/4] target/arm: Use CPTR_TFP with CPTR_EL3 in fp_exception_el Richard Henderson
2022-01-28 18:13 ` Peter Maydell
2022-01-29 6:55 ` Zenghui Yu via
2022-02-03 11:31 ` [PATCH 0/4] target/arm: SVE fixes versus VHE Peter Maydell
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=20220127063428.30212-2-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=yuzenghui@huawei.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).