Skip to contentSkip to conversation

target/xtensa: fix s32c1i TCGMemOp flags

PATCH In review Max Filippov 2 participants 2 messages Sep 11, 2018 – Sep 12, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/xtensa: fix s32c1i TCGMemOp flags

s32c1i must load and store value with target endianness, not host. This results in an infinite loop in atomic cmpxchg sequences when target endianness doesn't match host endianness.

Fixes 9fb40342d4b3 ("target/xtensa: support MTTCG")
---
 target/xtensa/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/xtensa/translate.c +1 -1
index 25399058a0db..c626583cd952 100644
@@ -2288,7 +2288,7 @@ static void translate_s32c1i(DisasContext *dc, const uint32_t arg[],
         gen_load_store_alignment(dc, 2, addr, true);
         gen_check_atomctl(dc, addr);
         tcg_gen_atomic_cmpxchg_i32(cpu_R[arg[0]], addr, cpu_SR[SCOMPARE1],
-                                   tmp, dc->cring, MO_32);
+                                   tmp, dc->cring, MO_TEUL);
         tcg_temp_free(addr);
         tcg_temp_free(tmp);
     }
Signature · 1 line
2.11.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Max Filippov

s32c1i must load and store value with target endianness, not host. This results in an infinite loop in atomic cmpxchg sequences when target endianness doesn't match host endianness.

Fixes 9fb40342d4b3 ("target/xtensa: support MTTCG")
---
 target/xtensa/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

r~