diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2022-06-18 17:15:41 -0700 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2022-06-27 11:18:17 +0100 |
commit | 59e1b8a22ea9f947d038ccac784de1020f266e14 (patch) | |
tree | a0bd532283b2a545635bae5cc1d6affbfad6be45 | |
parent | 22536b13247cf041b6dcabf0d708f486058989a9 (diff) | |
download | qemu-59e1b8a22ea9f947d038ccac784de1020f266e14.zip qemu-59e1b8a22ea9f947d038ccac784de1020f266e14.tar.gz qemu-59e1b8a22ea9f947d038ccac784de1020f266e14.tar.bz2 |
target/arm: Check V7VE as well as LPAE in arm_pamax
In machvirt_init we create a cpu but do not fully initialize it.
Thus the propagation of V7VE to LPAE has not been done, and we
compute the wrong value for some v7 cpus, e.g. cortex-a15.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1078
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reported-by: He Zhe <zhe.he@windriver.com>
Message-id: 20220619001541.131672-3-richard.henderson@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | target/arm/ptw.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 07f7a21..da47810 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -47,7 +47,13 @@ unsigned int arm_pamax(ARMCPU *cpu) assert(parange < ARRAY_SIZE(pamax_map)); return pamax_map[parange]; } - if (arm_feature(&cpu->env, ARM_FEATURE_LPAE)) { + + /* + * In machvirt_init, we call arm_pamax on a cpu that is not fully + * initialized, so we can't rely on the propagation done in realize. + */ + if (arm_feature(&cpu->env, ARM_FEATURE_LPAE) || + arm_feature(&cpu->env, ARM_FEATURE_V7VE)) { /* v7 with LPAE */ return 40; } |