diff mbox series

[RFC,20/34] accel/tcg: [CPUTLB] Use TCGContext.guest_mo for memory ordering

Message ID 20240119144024.14289-21-anjo@rev.ng (mailing list archive)
State New, archived
Headers show
Series Compile accel/tcg once (partially) | expand

Commit Message

Anton Johansson Jan. 19, 2024, 2:40 p.m. UTC
Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 accel/tcg/internal-target.h | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

Comments

Richard Henderson Jan. 24, 2024, 1:21 a.m. UTC | #1
On 1/20/24 00:40, Anton Johansson wrote:
> +#define tcg_req_mo(type) \
> +    ((type) & tcg_ctx->guest_mo & ~TCG_TARGET_DEFAULT_MO)

Again, no, value is out of scope.


r~
diff mbox series

Patch

diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h
index 4e36cf858e..3bcd1bbc84 100644
--- a/accel/tcg/internal-target.h
+++ b/accel/tcg/internal-target.h
@@ -9,8 +9,9 @@ 
 #ifndef ACCEL_TCG_INTERNAL_TARGET_H
 #define ACCEL_TCG_INTERNAL_TARGET_H
 
-#include "exec/exec-all.h"
+#include "exec/exec-common.h"
 #include "exec/translate-all.h"
+#include "tcg/tcg.h"
 
 /*
  * Access to the various translations structures need to be serialised
@@ -108,12 +109,8 @@  extern bool one_insn_per_tb;
  *
  * This is a macro so that it's constant even without optimization.
  */
-#ifdef TCG_GUEST_DEFAULT_MO
-# define tcg_req_mo(type) \
-    ((type) & TCG_GUEST_DEFAULT_MO & ~TCG_TARGET_DEFAULT_MO)
-#else
-# define tcg_req_mo(type) ((type) & ~TCG_TARGET_DEFAULT_MO)
-#endif
+#define tcg_req_mo(type) \
+    ((type) & tcg_ctx->guest_mo & ~TCG_TARGET_DEFAULT_MO)
 
 /**
  * cpu_req_mo: