Skip to contentSkip to conversation

target-mips: generate fences

PATCH Superseded Leon Alrae 2 participants 2 messages Sep 8, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Leon Alrae

author
#0 lore raw

PATCH 1/1 target-mips: generate fences

Make use of memory barrier TCG opcode in MIPS front end.

---
This patch complements the following series:
https://lists.nongnu.org/archive/html/qemu-devel/2016-07/msg03283.html

---
 target-mips/translate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target-mips/translate.c +2 -2
index c212e4f..f4513bf 100644
@@ -13384,7 +13384,7 @@ static void gen_pool32axf (CPUMIPSState *env, DisasContext *ctx, int rt, int rs)
     case 0x2d:
         switch (minor) {
         case SYNC:
-            /* NOP */
+            tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC);
             break;
         case SYSCALL:
             generate_exception_end(ctx, EXCP_SYSCALL);
@@ -17201,7 +17201,7 @@ static void decode_opc_special(CPUMIPSState *env, DisasContext *ctx)
         break;
     case OPC_SYNC:
         check_insn(ctx, ISA_MIPS2);
-        /* Treat as NOP. */
+        tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC);
         break;
 
 #if defined(TARGET_MIPS64)
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Leon Alrae

Make use of memory barrier TCG opcode in MIPS front end.

---
This patch complements the following series:
https://lists.nongnu.org/archive/html/qemu-devel/2016-07/msg03283.html

---
 target-mips/translate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

I've sent a pull request that includes the barrier code. You should be able to include this in your next mips pull.

r~