Skip to content

Commit

Permalink
target/arm: Diagnose writeback register in list for LDM for v7
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rth7680 authored and pm215 committed Sep 5, 2019
1 parent c5c426d commit 3949f46
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions target/arm/translate.c
Expand Up @@ -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);
}

Expand Down

0 comments on commit 3949f46

Please sign in to comment.