[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [Qemu-devel] [PATCH 04/15] target/arm: Tighten up Thumb d
From: |
Richard Henderson |
Subject: |
Re: [Qemu-arm] [Qemu-devel] [PATCH 04/15] target/arm: Tighten up Thumb decode where new v8M insns will be |
Date: |
Thu, 3 Aug 2017 14:33:50 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 08/02/2017 09:43 AM, Peter Maydell wrote:
> Tighten up the T32 decoder in the places where new v8M instructions
> will be:
> * TT/TTT/TTA/TTAT are in what was nominally LDREX/STREX r15, ...
> which is UNPREDICTABLE:
> make the UNPREDICTABLE behaviour be to UNDEF
> * BXNS/BLXNS are distinguished from BX/BLX via the low 3 bits,
> which in previous architectural versions are SBZ:
> enforce the SBZ via UNDEF rather than ignoring it, and move
> the "ARCH(5)" UNDEF case up so we don't leak a TCG temporary
> * SG is in the encoding which would be LDRD/STRD with rn = r15;
> this is UNPREDICTABLE and we currently UNDEF:
> move this check further up the code so that we don't leak
> TCG temporaries in the UNDEF case and have a better place
> to put the SG decode.
>
> This means that if a v8M binary is accidentally run on v7M
> or if a test case hits something that we haven't implemented
> yet the behaviour will be obvious (UNDEF) rather than obscure
> (plough on treating it as a different instruction).
>
> In the process, add some comments about the instruction patterns
> at these points in the decode. Our Thumb and ARM decoders are
> very difficult to understand currently, but gradually adding
> comments like this should help to clarify what exactly has
> been decoded when.
>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> target/arm/translate.c | 48 +++++++++++++++++++++++++++++++++++++++---------
> 1 file changed, 39 insertions(+), 9 deletions(-)
Reviewed-by: Richard Henderson <address@hidden>
r~
- Re: [Qemu-arm] [Qemu-devel] [PATCH 07/15] target/arm: Fix outdated comment about exception exit, (continued)
- [Qemu-arm] [PATCH 08/15] target/arm: Define and use XPSR bit masks, Peter Maydell, 2017/08/02
- [Qemu-arm] [PATCH 05/15] hw/intc/armv7m_nvic.c: Remove out of date comment, Peter Maydell, 2017/08/02
- [Qemu-arm] [PATCH 04/15] target/arm: Tighten up Thumb decode where new v8M insns will be, Peter Maydell, 2017/08/02
- [Qemu-arm] [PATCH 03/15] target/arm: Consolidate PMSA handling in get_phys_addr(), Peter Maydell, 2017/08/02
- [Qemu-arm] [PATCH 02/15] target/arm: Don't trap WFI/WFE for M profile, Peter Maydell, 2017/08/02