aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2019-09-04 12:30:19 -0700
committerPeter Maydell <peter.maydell@linaro.org>2019-09-05 13:23:03 +0100
commit3949f4675d13c587078f8f423845a3a537a22595 (patch)
treee3dba58c3af9fbad0c062f1976ef4eda49d4bd0f
parentc5c426d4c680f908a1e262091a17b088b5709200 (diff)
downloadqemu-3949f4675d13c587078f8f423845a3a537a22595.zip
qemu-3949f4675d13c587078f8f423845a3a537a22595.tar.gz
qemu-3949f4675d13c587078f8f423845a3a537a22595.tar.bz2
target/arm: Diagnose writeback register in list for LDM for v7
Prior to v7, for the A32 encoding, this operation wrote an UNKNOWN value back to the base register. Starting in v7 this is UNPREDICTABLE. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20190904193059.26202-30-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--target/arm/translate.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/target/arm/translate.c b/target/arm/translate.c
index 1f3c7bb..b67e738 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -9997,6 +9997,15 @@ static bool do_ldm(DisasContext *s, arg_ldst_block *a)
static bool trans_LDM_a32(DisasContext *s, arg_ldst_block *a)
{
+ /*
+ * Writeback register in register list is UNPREDICTABLE
+ * for ArchVersion() >= 7. Prior to v7, A32 would write
+ * an UNKNOWN value to the base register.
+ */
+ if (ENABLE_ARCH_7 && a->w && (a->list & (1 << a->rn))) {
+ unallocated_encoding(s);
+ return true;
+ }
return do_ldm(s, a);
}