From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org
Subject: [PATCH 2/2] target/arm: Check V7VE as well as LPAE in arm_pamax
Date: Sat, 18 Jun 2022 17:15:41 -0700 [thread overview]
Message-ID: <20220619001541.131672-3-richard.henderson@linaro.org> (raw)
In-Reply-To: <20220619001541.131672-1-richard.henderson@linaro.org>
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>
---
target/arm/ptw.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/target/arm/ptw.c b/target/arm/ptw.c
index 07f7a21861..da478104f0 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;
}
--
2.34.1
next prev parent reply other threads:[~2022-06-19 0:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-19 0:15 [PATCH 0/2] target/arm: Fix issue 1078 Richard Henderson
2022-06-19 0:15 ` [PATCH 1/2] target/arm: Extend arm_pamax to more than aarch64 Richard Henderson
2022-06-24 16:25 ` Peter Maydell
2022-06-19 0:15 ` Richard Henderson [this message]
2022-06-24 16:27 ` [PATCH 2/2] target/arm: Check V7VE as well as LPAE in arm_pamax Peter Maydell
2022-06-24 17:42 ` Richard Henderson
2022-06-21 2:57 ` [PATCH 0/2] target/arm: Fix issue 1078 He Zhe
2022-06-24 16:32 ` 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=20220619001541.131672-3-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.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).