tcg: Add guest_mo to TCGContext
authorRichard Henderson <richard.henderson@linaro.org>
Sat, 1 Apr 2023 05:56:55 +0000 (22:56 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 5 Jun 2023 19:04:29 +0000 (12:04 -0700)
This replaces of TCG_GUEST_DEFAULT_MO in tcg-op-ldst.c.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
accel/tcg/translate-all.c
include/tcg/tcg.h
tcg/tcg-op-ldst.c

index 67b838e16bff3209a2648d88456d542a1167ceef..200de2793c0d4faaaeaf52a584ae3d1baecda422 100644 (file)
@@ -364,6 +364,11 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
         (int)offsetof(ArchCPU, neg.tlb.f) - (int)offsetof(ArchCPU, env);
 #endif
     tcg_ctx->insn_start_words = TARGET_INSN_START_WORDS;
+#ifdef TCG_GUEST_DEFAULT_MO
+    tcg_ctx->guest_mo = TCG_GUEST_DEFAULT_MO;
+#else
+    tcg_ctx->guest_mo = TCG_MO_ALL;
+#endif
 
  tb_overflow:
 
index 813c733910f45d57e3921b7717ad7d2dcaa9f59b..9f607e2664488a1bff8a4ad1d2a0dcefbff667f8 100644 (file)
@@ -521,6 +521,7 @@ struct TCGContext {
     uint8_t tlb_dyn_max_bits;
 #endif
     uint8_t insn_start_words;
+    TCGBar guest_mo;
 
     TCGRegSet reserved_regs;
     intptr_t current_frame_offset;
index 3c00bf0c95262f9b6017e207957be73269941e5e..9bcf63b0419e4764099d5eaff01b93716a71c26d 100644 (file)
@@ -104,9 +104,7 @@ static void gen_ldst_i64(TCGOpcode opc, TCGv_i64 v, TCGTemp *addr, MemOpIdx oi)
 
 static void tcg_gen_req_mo(TCGBar type)
 {
-#ifdef TCG_GUEST_DEFAULT_MO
-    type &= TCG_GUEST_DEFAULT_MO;
-#endif
+    type &= tcg_ctx->guest_mo;
     type &= ~TCG_TARGET_DEFAULT_MO;
     if (type) {
         tcg_gen_mb(type | TCG_BAR_SC);