]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
target: Define TCG_GUEST_DEFAULT_MO in 'cpu-param.h'
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 5 Dec 2023 13:31:59 +0000 (14:31 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 26 Apr 2024 13:31:37 +0000 (15:31 +0200)
accel/tcg/ files requires the following definitions:

  - TARGET_LONG_BITS
  - TARGET_PAGE_BITS
  - TARGET_PHYS_ADDR_SPACE_BITS
  - TCG_GUEST_DEFAULT_MO

The first 3 are defined in "cpu-param.h". The last one
in "cpu.h", with a bunch of definitions irrelevant for
TCG. By moving the TCG_GUEST_DEFAULT_MO definition to
"cpu-param.h", we can simplify various accel/tcg includes.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Nicholas Piggin <npiggin@gmail.com>
Message-Id: <20231211212003.21686-4-philmd@linaro.org>

28 files changed:
target/alpha/cpu-param.h
target/alpha/cpu.h
target/arm/cpu-param.h
target/arm/cpu.h
target/avr/cpu-param.h
target/avr/cpu.h
target/hppa/cpu-param.h
target/hppa/cpu.h
target/i386/cpu-param.h
target/i386/cpu.h
target/loongarch/cpu-param.h
target/loongarch/cpu.h
target/microblaze/cpu-param.h
target/microblaze/cpu.h
target/mips/cpu-param.h
target/mips/cpu.h
target/openrisc/cpu-param.h
target/openrisc/cpu.h
target/ppc/cpu-param.h
target/ppc/cpu.h
target/riscv/cpu-param.h
target/riscv/cpu.h
target/s390x/cpu-param.h
target/s390x/cpu.h
target/sparc/cpu-param.h
target/sparc/cpu.h
target/xtensa/cpu-param.h
target/xtensa/cpu.h

index c969cb016bfd8612249a957a38589180ced8f4e6..5ce213a9a11a925713e23de5204ed3bbd700ffc1 100644 (file)
@@ -27,4 +27,7 @@
 # define TARGET_VIRT_ADDR_SPACE_BITS  (30 + TARGET_PAGE_BITS)
 #endif
 
+/* Alpha processors have a weak memory model */
+#define TCG_GUEST_DEFAULT_MO      (0)
+
 #endif
index 7188a409a04bb2b17098b64e0dfa72f7b86fcff8..f9e2ecb90ab2f3d0a44367b05997fc75f8371f3e 100644 (file)
@@ -24,9 +24,6 @@
 #include "exec/cpu-defs.h"
 #include "qemu/cpu-float.h"
 
-/* Alpha processors have a weak memory model */
-#define TCG_GUEST_DEFAULT_MO      (0)
-
 #define ICACHE_LINE_SIZE 32
 #define DCACHE_LINE_SIZE 32
 
index da3243ab2178dd2edf34ea77aadd4d02c943f621..2d5f3aa312cbfae5fb1aace8b7e8846d269b7865 100644 (file)
 # else
 #  define TARGET_PAGE_BITS 12
 # endif
-#else
+#else /* !CONFIG_USER_ONLY */
 /*
  * ARMv7 and later CPUs have 4K pages minimum, but ARMv5 and v6
  * have to support 1K tiny pages.
  */
 # define TARGET_PAGE_BITS_VARY
 # define TARGET_PAGE_BITS_MIN  10
+#endif /* !CONFIG_USER_ONLY */
 
-#endif
+/* ARM processors have a weak memory model */
+#define TCG_GUEST_DEFAULT_MO      (0)
 
 #endif
index 97997dbd08777454e976b588b84f103b0342482f..17efc5d565af1f2f16826730bcea32781f104d88 100644 (file)
@@ -30,9 +30,6 @@
 #include "target/arm/multiprocessing.h"
 #include "target/arm/gtimer.h"
 
-/* ARM processors have a weak memory model */
-#define TCG_GUEST_DEFAULT_MO      (0)
-
 #ifdef TARGET_AARCH64
 #define KVM_HAVE_MCE_INJECTION 1
 #endif
index 9a92bc74fc9356e1b62482af5b032e58903eda66..93c2f470d07ed8b8fbd3f8984c7d0e5624230fb3 100644 (file)
@@ -32,4 +32,6 @@
 #define TARGET_PHYS_ADDR_SPACE_BITS 24
 #define TARGET_VIRT_ADDR_SPACE_BITS 24
 
+#define TCG_GUEST_DEFAULT_MO 0
+
 #endif
index d185d20dcb7d028f6a1ec24ed70e490ffa4185c5..47255351021ab14f6af34d40b022d9edb32ed5a0 100644 (file)
@@ -30,8 +30,6 @@
 
 #define CPU_RESOLVING_TYPE TYPE_AVR_CPU
 
-#define TCG_GUEST_DEFAULT_MO 0
-
 /*
  * AVR has two memory spaces, data & code.
  * e.g. both have 0 address
index bb3d7ef6f7684b2fb2187058a53b14618bcdfe8f..473d489f01d6c7f27110530dcaac0fb4f9cf0367 100644 (file)
 
 #define TARGET_PAGE_BITS 12
 
+/* PA-RISC 1.x processors have a strong memory model.  */
+/*
+ * ??? While we do not yet implement PA-RISC 2.0, those processors have
+ * a weak memory model, but with TLB bits that force ordering on a per-page
+ * basis.  It's probably easier to fall back to a strong memory model.
+ */
+#define TCG_GUEST_DEFAULT_MO        TCG_MO_ALL
+
 #endif
index a072d0bb6365fe37bc9f6e41ee1ed4a735b681bb..fb2e4c4a98c02712065e3492c211fbc6f4888609 100644 (file)
 #include "qemu/cpu-float.h"
 #include "qemu/interval-tree.h"
 
-/* PA-RISC 1.x processors have a strong memory model.  */
-/* ??? While we do not yet implement PA-RISC 2.0, those processors have
-   a weak memory model, but with TLB bits that force ordering on a per-page
-   basis.  It's probably easier to fall back to a strong memory model.  */
-#define TCG_GUEST_DEFAULT_MO        TCG_MO_ALL
-
 #define MMU_ABS_W_IDX     6
 #define MMU_ABS_IDX       7
 #define MMU_KERNEL_IDX    8
index 911b4cd51b22c27c1e228c09c7511726ea31b835..5e153352030a714ef2c8e67c2325e7796c230826 100644 (file)
@@ -24,4 +24,7 @@
 #endif
 #define TARGET_PAGE_BITS 12
 
+/* The x86 has a strong memory model with some store-after-load re-ordering */
+#define TCG_GUEST_DEFAULT_MO      (TCG_MO_ALL & ~TCG_MO_ST_LD)
+
 #endif
index 6112e27bfd5c078650c104bc0cf1396976b44943..565c7a98c37c9e5ff27b43307221b57b9cca8af0 100644 (file)
@@ -30,9 +30,6 @@
 
 #define XEN_NR_VIRQS 24
 
-/* The x86 has a strong memory model with some store-after-load re-ordering */
-#define TCG_GUEST_DEFAULT_MO      (TCG_MO_ALL & ~TCG_MO_ST_LD)
-
 #define KVM_HAVE_MCE_INJECTION 1
 
 /* support for self modifying code even if the modified instruction is
index cfe195db4e4f60566ed4b45edf2ad7114b360a45..db5ad1c69fafaf368ad7f0c960afecb5a96ddcf2 100644 (file)
@@ -14,4 +14,6 @@
 
 #define TARGET_PAGE_BITS 12
 
+#define TCG_GUEST_DEFAULT_MO (0)
+
 #endif
index ec37579fd6c689027d11daafb47405d69e0a4832..abb01b2cc7361a9ad6477f1f8cf2535ec9584eee 100644 (file)
@@ -39,8 +39,6 @@
 
 #define IOCSR_MEM_SIZE          0x428
 
-#define TCG_GUEST_DEFAULT_MO (0)
-
 #define FCSR0_M1    0x1f         /* FCSR1 mask, Enables */
 #define FCSR0_M2    0x1f1f0000   /* FCSR2 mask, Cause and Flags */
 #define FCSR0_M3    0x300        /* FCSR3 mask, Round Mode */
index 9770b0eb52597d2545d16648569481685afa5d1f..e530fead1c01f6bd16e9997c23ed16b3cbfd85a9 100644 (file)
@@ -29,4 +29,7 @@
 /* FIXME: MB uses variable pages down to 1K but linux only uses 4k.  */
 #define TARGET_PAGE_BITS 12
 
+/* MicroBlaze is always in-order. */
+#define TCG_GUEST_DEFAULT_MO  TCG_MO_ALL
+
 #endif
index c0c7574dbd5923a55f7c925513768d460464d1ef..3e5a3e5c6055e99c6137d4215f12c0116a428ff7 100644 (file)
@@ -24,9 +24,6 @@
 #include "exec/cpu-defs.h"
 #include "qemu/cpu-float.h"
 
-/* MicroBlaze is always in-order. */
-#define TCG_GUEST_DEFAULT_MO  TCG_MO_ALL
-
 typedef struct CPUArchState CPUMBState;
 #if !defined(CONFIG_USER_ONLY)
 #include "mmu.h"
index 594c91a1562e0e20ef6fd451222f60a78d1be3ee..6f6ac1688f8eb418dc24eec3a407f71c4b431921 100644 (file)
@@ -30,4 +30,6 @@
 #define TARGET_PAGE_BITS_MIN 12
 #endif
 
+#define TCG_GUEST_DEFAULT_MO (0)
+
 #endif
index 7329226d390dafe04fdc26d0270231e9f0de51fe..3e906a175a3a597f74776da4eb3e2c64dd6d8822 100644 (file)
@@ -10,8 +10,6 @@
 #include "hw/clock.h"
 #include "mips-defs.h"
 
-#define TCG_GUEST_DEFAULT_MO (0)
-
 typedef struct CPUMIPSTLBContext CPUMIPSTLBContext;
 
 /* MSA Context */
index 3f082074855be4320c3b20dbf39527368280e6d8..fbfc0f568b1cab5961fb1089d003cc158216d21e 100644 (file)
@@ -13,4 +13,6 @@
 #define TARGET_PHYS_ADDR_SPACE_BITS 32
 #define TARGET_VIRT_ADDR_SPACE_BITS 32
 
+#define TCG_GUEST_DEFAULT_MO (0)
+
 #endif
index b1b7db5cbd90e880697bf3ddb9dc7eabce43b266..c9fe9ae12da608ba55a218c7f1b3ce78e5ddc8ea 100644 (file)
@@ -24,8 +24,6 @@
 #include "exec/cpu-defs.h"
 #include "fpu/softfloat-types.h"
 
-#define TCG_GUEST_DEFAULT_MO (0)
-
 /**
  * OpenRISCCPUClass:
  * @parent_realize: The parent class' realize handler.
index b7ad52de039b5bbf9d22bd24d11ceb84bc7717a5..77c5ed9a6787cacea9230b8669f9d8148b924b21 100644 (file)
@@ -40,4 +40,6 @@
 # define TARGET_PAGE_BITS 12
 #endif
 
+#define TCG_GUEST_DEFAULT_MO 0
+
 #endif
index 67e6b2effd6f67806757193f73cf57c3f2182122..0ac55d6b25c131c7a35605afec33a047dc32bb25 100644 (file)
@@ -29,8 +29,6 @@
 
 #define CPU_RESOLVING_TYPE TYPE_POWERPC_CPU
 
-#define TCG_GUEST_DEFAULT_MO 0
-
 #define TARGET_PAGE_BITS_64K 16
 #define TARGET_PAGE_BITS_16M 24
 
index b2a9396dec9344807b65e873c36bf8addf4ec46f..1fbd64939dca2bc281d26c7507109c5ff39302f8 100644 (file)
@@ -28,4 +28,6 @@
  *  - M mode HLV/HLVX/HSV 0b111
  */
 
+#define TCG_GUEST_DEFAULT_MO 0
+
 #endif
index 3b1a02b9449aa46a4ab65803e4bc458f4126ab8e..2d0c02c35be011ac35095400818aaa7aa9aa9a18 100644 (file)
@@ -43,8 +43,6 @@ typedef struct CPUArchState CPURISCVState;
 # define TYPE_RISCV_CPU_BASE            TYPE_RISCV_CPU_BASE64
 #endif
 
-#define TCG_GUEST_DEFAULT_MO 0
-
 /*
  * RISC-V-specific extra insn start words:
  * 1: Original instruction opcode
index 84ca08626bbd9a7b0f8db6c8f23be398b1b31e14..11d23b600d25539c724439d5526c93a073a37831 100644 (file)
 #define TARGET_PHYS_ADDR_SPACE_BITS 64
 #define TARGET_VIRT_ADDR_SPACE_BITS 64
 
+/*
+ * The z/Architecture has a strong memory model with some
+ * store-after-load re-ordering.
+ */
+#define TCG_GUEST_DEFAULT_MO      (TCG_MO_ALL & ~TCG_MO_ST_LD)
+
 #endif
index 43a46a5a068c5b0702d19e9174af804a39c8bdc3..414680eed1c7780b76594ab8d6917df50064dff6 100644 (file)
@@ -33,9 +33,6 @@
 
 #define ELF_MACHINE_UNAME "S390X"
 
-/* The z/Architecture has a strong memory model with some store-after-load re-ordering */
-#define TCG_GUEST_DEFAULT_MO      (TCG_MO_ALL & ~TCG_MO_ST_LD)
-
 #define TARGET_HAS_PRECISE_SMC
 
 #define TARGET_INSN_START_EXTRA_WORDS 2
index cb11980404a35caab7728f7c1f088646c19565f3..82293fb8449cb55f5f416d7fa34439f50ead2f9a 100644 (file)
 # define TARGET_VIRT_ADDR_SPACE_BITS 32
 #endif
 
+/*
+ * From Oracle SPARC Architecture 2015:
+ *
+ *   Compatibility notes: The PSO memory model described in SPARC V8 and
+ *   SPARC V9 compatibility architecture specifications was never implemented
+ *   in a SPARC V9 implementation and is not included in the Oracle SPARC
+ *   Architecture specification.
+ *
+ *   The RMO memory model described in the SPARC V9 specification was
+ *   implemented in some non-Sun SPARC V9 implementations, but is not
+ *   directly supported in Oracle SPARC Architecture 2015 implementations.
+ *
+ * Therefore always use TSO in QEMU.
+ *
+ * D.5 Specification of Partial Store Order (PSO)
+ *   ... [loads] are followed by an implied MEMBAR #LoadLoad | #LoadStore.
+ *
+ * D.6 Specification of Total Store Order (TSO)
+ *   ... PSO with the additional requirement that all [stores] are followed
+ *   by an implied MEMBAR #StoreStore.
+ */
+#define TCG_GUEST_DEFAULT_MO  (TCG_MO_LD_LD | TCG_MO_LD_ST | TCG_MO_ST_ST)
+
 #endif
index f3cdd17c629b54196d5da9f70226ef9e46689f90..dfd9512a216567984a7473be8e4e0b44ea4d3d83 100644 (file)
@@ -6,29 +6,6 @@
 #include "exec/cpu-defs.h"
 #include "qemu/cpu-float.h"
 
-/*
- * From Oracle SPARC Architecture 2015:
- *
- *   Compatibility notes: The PSO memory model described in SPARC V8 and
- *   SPARC V9 compatibility architecture specifications was never implemented
- *   in a SPARC V9 implementation and is not included in the Oracle SPARC
- *   Architecture specification.
- *
- *   The RMO memory model described in the SPARC V9 specification was
- *   implemented in some non-Sun SPARC V9 implementations, but is not
- *   directly supported in Oracle SPARC Architecture 2015 implementations.
- *
- * Therefore always use TSO in QEMU.
- *
- * D.5 Specification of Partial Store Order (PSO)
- *   ... [loads] are followed by an implied MEMBAR #LoadLoad | #LoadStore.
- *
- * D.6 Specification of Total Store Order (TSO)
- *   ... PSO with the additional requirement that all [stores] are followed
- *   by an implied MEMBAR #StoreStore.
- */
-#define TCG_GUEST_DEFAULT_MO  (TCG_MO_LD_LD | TCG_MO_LD_ST | TCG_MO_ST_ST)
-
 #if !defined(TARGET_SPARC64)
 #define TARGET_DPREGS 16
 #define TARGET_FCCREGS 1
index b1da0555deb7683538d9c4584788c3cbf028fa04..0000725f2f9009e4aff7eef111455bf832c3a891 100644 (file)
@@ -17,4 +17,7 @@
 #define TARGET_VIRT_ADDR_SPACE_BITS 32
 #endif
 
+/* Xtensa processors have a weak memory model */
+#define TCG_GUEST_DEFAULT_MO      (0)
+
 #endif
index 6b8d0636d2761e1854bcc29c0176a05e505f0ccb..9f2341d8563cf5d86f7b35e93c0ed6a8edbd7424 100644 (file)
@@ -34,9 +34,6 @@
 #include "hw/clock.h"
 #include "xtensa-isa.h"
 
-/* Xtensa processors have a weak memory model */
-#define TCG_GUEST_DEFAULT_MO      (0)
-
 enum {
     /* Additional instructions */
     XTENSA_OPTION_CODE_DENSITY,