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

Anton Johansson via posted 34 patches 10 months, 1 week ago
[RFC PATCH 20/34] accel/tcg: [CPUTLB] Use TCGContext.guest_mo for memory ordering
Posted by Anton Johansson via 10 months, 1 week ago
Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 accel/tcg/internal-target.h | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

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:
-- 
2.43.0
Re: [RFC PATCH 20/34] accel/tcg: [CPUTLB] Use TCGContext.guest_mo for memory ordering
Posted by Richard Henderson 10 months, 1 week ago
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~