[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 12/30] target/arm: Fix SCTLR_B test for TCGv_i64 load/store
From: |
Richard Henderson |
Subject: |
[PATCH v3 12/30] target/arm: Fix SCTLR_B test for TCGv_i64 load/store |
Date: |
Mon, 11 Jan 2021 09:00:55 -1000 |
Just because operating on a TCGv_i64 temporary does not
mean that we're performing a 64-bit operation. Restrict
the frobbing to actual 64-bit operations.
This bug is not currently visible because all current
users of these two functions always pass MO_64.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/translate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/arm/translate.c b/target/arm/translate.c
index efcb393b99..bf1c0f7279 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -982,7 +982,7 @@ static void gen_aa32_ld_i64(DisasContext *s, TCGv_i64 val,
TCGv_i32 a32,
tcg_gen_qemu_ld_i64(val, addr, index, opc);
/* Not needed for user-mode BE32, where we use MO_BE instead. */
- if (!IS_USER_ONLY && s->sctlr_b) {
+ if (!IS_USER_ONLY && s->sctlr_b && (opc & MO_SIZE) == MO_64) {
tcg_gen_rotri_i64(val, val, 32);
}
@@ -1001,7 +1001,7 @@ static void gen_aa32_st_i64(DisasContext *s, TCGv_i64
val, TCGv_i32 a32,
TCGv addr = gen_aa32_addr(s, a32, opc);
/* Not needed for user-mode BE32, where we use MO_BE instead. */
- if (!IS_USER_ONLY && s->sctlr_b) {
+ if (!IS_USER_ONLY && s->sctlr_b && (opc & MO_SIZE) == MO_64) {
TCGv_i64 tmp = tcg_temp_new_i64();
tcg_gen_rotri_i64(tmp, val, 32);
tcg_gen_qemu_st_i64(tmp, addr, index, opc);
--
2.25.1
- [PATCH v3 03/30] target/arm: Rename TBFLAG_ANY, PSTATE_SS, (continued)
- [PATCH v3 03/30] target/arm: Rename TBFLAG_ANY, PSTATE_SS, Richard Henderson, 2021/01/11
- [PATCH v3 02/30] target/arm: Rename TBFLAG_A32, SCTLR_B, Richard Henderson, 2021/01/11
- [PATCH v3 04/30] target/arm: Add wrapper macros for accessing tbflags, Richard Henderson, 2021/01/11
- [PATCH v3 05/30] target/arm: Introduce CPUARMTBFlags, Richard Henderson, 2021/01/11
- [PATCH v3 06/30] target/arm: Move mode specific TB flags to tb->cs_base, Richard Henderson, 2021/01/11
- [PATCH v3 07/30] target/arm: Move TBFLAG_AM32 bits to the top, Richard Henderson, 2021/01/11
- [PATCH v3 08/30] target/arm: Move TBFLAG_ANY bits to the bottom, Richard Henderson, 2021/01/11
- [PATCH v3 09/30] target/arm: Add ALIGN_MEM to TBFLAG_ANY, Richard Henderson, 2021/01/11
- [PATCH v3 10/30] target/arm: Adjust gen_aa32_{ld, st}_i32 for align+endianness, Richard Henderson, 2021/01/11
- [PATCH v3 11/30] target/arm: Merge gen_aa32_frob64 into gen_aa32_ld_i64, Richard Henderson, 2021/01/11
- [PATCH v3 12/30] target/arm: Fix SCTLR_B test for TCGv_i64 load/store,
Richard Henderson <=
- [PATCH v3 13/30] target/arm: Adjust gen_aa32_{ld, st}_i64 for align+endianness, Richard Henderson, 2021/01/11
- [PATCH v3 14/30] target/arm: Enforce word alignment for LDRD/STRD, Richard Henderson, 2021/01/11
- [PATCH v3 20/30] target/arm: Enforce alignment for VLDR/VSTR, Richard Henderson, 2021/01/11
- [PATCH v3 21/30] target/arm: Enforce alignment for VLDn (all lanes), Richard Henderson, 2021/01/11
- [PATCH v3 17/30] target/arm: Enforce alignment for RFE, Richard Henderson, 2021/01/11
- [PATCH v3 18/30] target/arm: Enforce alignment for SRS, Richard Henderson, 2021/01/11
- [PATCH v3 23/30] target/arm: Enforce alignment for VLDn/VSTn (single), Richard Henderson, 2021/01/11
- [PATCH v3 28/30] target/arm: Enforce alignment for aa64 vector LDn/STn (multiple), Richard Henderson, 2021/01/11
- [PATCH v3 27/30] target/arm: Use MemOp for size + endian in aa64 vector ld/st, Richard Henderson, 2021/01/11
- [PATCH v3 16/30] target/arm: Enforce alignment for LDM/STM, Richard Henderson, 2021/01/11