[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 23/35] target/ppc: Implement the rest of gen_st_atomic
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 23/35] target/ppc: Implement the rest of gen_st_atomic |
Date: |
Tue, 3 Jul 2018 15:57:52 +1000 |
From: Richard Henderson <address@hidden>
The store twin case was stubbed out. For now, implement it only within
a serial context, forcing parallel execution to synchronize. It would
be possible to implement with a cmpxchg loop, if we care, but the loose
alignment requirements (simply no crossing 32-byte boundary) might send
us back to the serial context anyway.
Signed-off-by: Richard Henderson <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
target/ppc/translate.c | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 597a37d3ec..e120f2ed0b 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -3254,7 +3254,31 @@ static void gen_st_atomic(DisasContext *ctx, TCGMemOp
memop)
tcg_gen_atomic_smin_fetch_tl(discard, EA, src, ctx->mem_idx, memop);
break;
case 24: /* Store twin */
- gen_invalid(ctx);
+ if (tb_cflags(ctx->base.tb) & CF_PARALLEL) {
+ /* Restart with exclusive lock. */
+ gen_helper_exit_atomic(cpu_env);
+ ctx->base.is_jmp = DISAS_NORETURN;
+ } else {
+ TCGv t = tcg_temp_new();
+ TCGv t2 = tcg_temp_new();
+ TCGv s = tcg_temp_new();
+ TCGv s2 = tcg_temp_new();
+ TCGv ea_plus_s = tcg_temp_new();
+
+ tcg_gen_qemu_ld_tl(t, EA, ctx->mem_idx, memop);
+ tcg_gen_addi_tl(ea_plus_s, EA, MEMOP_GET_SIZE(memop));
+ tcg_gen_qemu_ld_tl(t2, ea_plus_s, ctx->mem_idx, memop);
+ tcg_gen_movcond_tl(TCG_COND_EQ, s, t, t2, src, t);
+ tcg_gen_movcond_tl(TCG_COND_EQ, s2, t, t2, src, t2);
+ tcg_gen_qemu_st_tl(s, EA, ctx->mem_idx, memop);
+ tcg_gen_qemu_st_tl(s2, ea_plus_s, ctx->mem_idx, memop);
+
+ tcg_temp_free(ea_plus_s);
+ tcg_temp_free(s2);
+ tcg_temp_free(s);
+ tcg_temp_free(t2);
+ tcg_temp_free(t);
+ }
break;
default:
/* invoke data storage error handler */
--
2.17.1
- [Qemu-ppc] [PULL 33/35] target/ppc: set is_jmp on ppc_tr_breakpoint_check, (continued)
- [Qemu-ppc] [PULL 33/35] target/ppc: set is_jmp on ppc_tr_breakpoint_check, David Gibson, 2018/07/03
- [Qemu-ppc] [PULL 28/35] sam460ex: Add RTC device, David Gibson, 2018/07/03
- [Qemu-ppc] [PULL 35/35] ppc: Include vga cirrus card into the compiling process, David Gibson, 2018/07/03
- Re: [Qemu-ppc] [Qemu-devel] [PULL 35/35] ppc: Include vga cirrus card into the compiling process, Mark Cave-Ayland, 2018/07/03
- Re: [Qemu-ppc] [Qemu-devel] [PULL 35/35] ppc: Include vga cirrus card into the compiling process, Sebastian Bauer, 2018/07/03
- Re: [Qemu-ppc] [Qemu-devel] [PULL 35/35] ppc: Include vga cirrus card into the compiling process, Mark Cave-Ayland, 2018/07/04
- Re: [Qemu-ppc] [Qemu-devel] [PULL 35/35] ppc: Include vga cirrus card into the compiling process, Sebastian Bauer, 2018/07/04
- Re: [Qemu-ppc] [Qemu-devel] [PULL 35/35] ppc: Include vga cirrus card into the compiling process, Mark Cave-Ayland, 2018/07/04
- Re: [Qemu-ppc] [Qemu-devel] [PULL 35/35] ppc: Include vga cirrus card into the compiling process, Sebastian Bauer, 2018/07/04
- Re: [Qemu-ppc] [Qemu-devel] [PULL 35/35] ppc: Include vga cirrus card into the compiling process, BALATON Zoltan, 2018/07/04
[Qemu-ppc] [PULL 23/35] target/ppc: Implement the rest of gen_st_atomic,
David Gibson <=
[Qemu-ppc] [PULL 08/35] ppc/xics: move the vmstate structures under the ics-base class, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 04/35] ppc/xics: introduce ICP DeviceRealize and DeviceReset handlers, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 05/35] ppc/xics: introduce a parent_realize in ICSStateClass, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 32/35] spapr: compute default value of "hpt-max-page-size" later, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 21/35] target/ppc: Use atomic min/max helpers, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 26/35] ppc4xx_i2c: Rewrite to model hardware more closely, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 14/35] target/ppc: Use atomic cmpxchg for STQCX, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 17/35] target/ppc: Split out gen_load_locked, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 13/35] target/ppc: Use atomic store for STQ, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 25/35] hw/ppc: Give sam46ex its own config option, David Gibson, 2018/07/03