aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2022-02-04 17:04:42 +0000
committerPeter Maydell <peter.maydell@linaro.org>2022-02-08 10:56:27 +0000
commit63888fa78be5825647ce1187dcd7b2470d8bb452 (patch)
treefc0fa0d2a9dde0b54ef10f115035c7037be26d8d /target
parent55ef0b702bc2c90c3c4ed97f97676d8f139e5ca1 (diff)
downloadqemu-63888fa78be5825647ce1187dcd7b2470d8bb452.zip
qemu-63888fa78be5825647ce1187dcd7b2470d8bb452.tar.gz
qemu-63888fa78be5825647ce1187dcd7b2470d8bb452.tar.bz2
target/arm: Fix sve_zcr_len_for_el for VHE mode running
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> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Zenghui Yu <yuzenghui@huawei.com> Message-id: 20220127063428.30212-2-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target')
-rw-r--r--target/arm/helper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 6dd241f..649958a 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)) {