qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/4] target/ppc: Fix lqarx to set cpu_reserve
@ 2023-06-05  2:54 Nicholas Piggin
  2023-06-05  2:54 ` [PATCH v2 2/4] target/ppc: Ensure stcx size matches larx Nicholas Piggin
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Nicholas Piggin @ 2023-06-05  2:54 UTC (permalink / raw)
  To: Daniel Henrique Barboza
  Cc: Nicholas Piggin, Richard Henderson, qemu-ppc, qemu-devel,
	qemu-stable

lqarx does not set cpu_reserve, which causes stqcx. to never succeed.

Cc: qemu-stable@nongnu.org
Fixes: 94bf2658676 ("target/ppc: Use atomic load for LQ and LQARX")
Fixes: 57b38ffd0c6 ("target/ppc: Use tcg_gen_qemu_{ld,st}_i128 for LQARX, LQ, STQ")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
v2:
- Fix bugs vs memory access fault [Richard]

 target/ppc/translate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 3650d2985d..7a5bf1d820 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -3881,6 +3881,7 @@ static void gen_lqarx(DisasContext *ctx)
     tcg_gen_qemu_ld_i128(t16, EA, ctx->mem_idx, DEF_MEMOP(MO_128 | MO_ALIGN));
     tcg_gen_extr_i128_i64(lo, hi, t16);
 
+    tcg_gen_mov_tl(cpu_reserve, EA);
     tcg_gen_st_tl(hi, cpu_env, offsetof(CPUPPCState, reserve_val));
     tcg_gen_st_tl(lo, cpu_env, offsetof(CPUPPCState, reserve_val2));
 }
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-06-05 13:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-05  2:54 [PATCH v2 1/4] target/ppc: Fix lqarx to set cpu_reserve Nicholas Piggin
2023-06-05  2:54 ` [PATCH v2 2/4] target/ppc: Ensure stcx size matches larx Nicholas Piggin
2023-06-05 13:42   ` Daniel Henrique Barboza
2023-06-05  2:54 ` [PATCH v2 3/4] target/ppc: Remove larx/stcx. memory barrier semantics Nicholas Piggin
2023-06-05 13:42   ` Daniel Henrique Barboza
2023-06-05  2:54 ` [PATCH v2 4/4] target/ppc: Rework store conditional to avoid branch Nicholas Piggin
2023-06-05 13:42   ` Daniel Henrique Barboza
2023-06-05  3:09 ` [PATCH v2 1/4] target/ppc: Fix lqarx to set cpu_reserve Richard Henderson
2023-06-05 13:42 ` Daniel Henrique Barboza

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).