tcg: Split out tcg/oversized-guest.h
authorRichard Henderson <richard.henderson@linaro.org>
Tue, 28 Mar 2023 01:32:36 +0000 (18:32 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 5 Jun 2023 19:04:28 +0000 (12:04 -0700)
Move a use of TARGET_LONG_BITS out of tcg/tcg.h.
Include the new file only where required.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
accel/tcg/cputlb.c
accel/tcg/tcg-all.c
include/exec/cpu_ldst.h
include/tcg/oversized-guest.h [new file with mode: 0644]
include/tcg/tcg.h
target/arm/ptw.c
target/riscv/cpu_helper.c

index 6beaeb0a81520883352c2d82d8dbdcd67f12ba38..32a4817139db304561e19e470eeb79b848271b0f 100644 (file)
@@ -40,6 +40,7 @@
 #include "qemu/plugin-memory.h"
 #endif
 #include "tcg/tcg-ldst.h"
+#include "tcg/oversized-guest.h"
 #include "exec/helper-proto.h"
 
 /* DEBUG defines, enable DEBUG_TLB_LOG to log to the CPU_LOG_MMU target */
index a831f8d7c372d75ef8c55f9a4afb4ee7f6bef3b8..02af6a2891adcd63cc5990b148801c384a85034d 100644 (file)
@@ -28,6 +28,7 @@
 #include "exec/replay-core.h"
 #include "sysemu/cpu-timers.h"
 #include "tcg/tcg.h"
+#include "tcg/oversized-guest.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/accel.h"
index a43b34e46b743fa40087445a4de29fe722272335..896f305ff3e104a288ded0616f02ae16045044cc 100644 (file)
@@ -326,8 +326,7 @@ static inline void clear_helper_retaddr(void)
 
 #else
 
-/* Needed for TCG_OVERSIZED_GUEST */
-#include "tcg/tcg.h"
+#include "tcg/oversized-guest.h"
 
 static inline target_ulong tlb_read_idx(const CPUTLBEntry *entry,
                                         MMUAccessType access_type)
diff --git a/include/tcg/oversized-guest.h b/include/tcg/oversized-guest.h
new file mode 100644 (file)
index 0000000..641b974
--- /dev/null
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Define TCG_OVERSIZED_GUEST
+ * Copyright (c) 2008 Fabrice Bellard
+ */
+
+#ifndef EXEC_TCG_OVERSIZED_GUEST_H
+#define EXEC_TCG_OVERSIZED_GUEST_H
+
+#include "tcg-target-reg-bits.h"
+#include "cpu-param.h"
+
+/*
+ * Oversized TCG guests make things like MTTCG hard
+ * as we can't use atomics for cputlb updates.
+ */
+#if TARGET_LONG_BITS > TCG_TARGET_REG_BITS
+#define TCG_OVERSIZED_GUEST 1
+#else
+#define TCG_OVERSIZED_GUEST 0
+#endif
+
+#endif
index 5fe90cbb4260fd5a20af2180c1a534c40269f430..021fc903ada8225af2e433e6e23b380e10e27d83 100644 (file)
@@ -59,15 +59,6 @@ typedef uint64_t tcg_target_ulong;
 #error unsupported
 #endif
 
-/* Oversized TCG guests make things like MTTCG hard
- * as we can't use atomics for cputlb updates.
- */
-#if TARGET_LONG_BITS > TCG_TARGET_REG_BITS
-#define TCG_OVERSIZED_GUEST 1
-#else
-#define TCG_OVERSIZED_GUEST 0
-#endif
-
 #if TCG_TARGET_NB_REGS <= 32
 typedef uint32_t TCGRegSet;
 #elif TCG_TARGET_NB_REGS <= 64
index b0d2a054039ce888539ae534a7ffea309316ce1b..b2dc223525daa4f3d60c6d4d0a9ec2336516cebe 100644 (file)
@@ -14,6 +14,7 @@
 #include "cpu.h"
 #include "internals.h"
 #include "idau.h"
+#include "tcg/oversized-guest.h"
 
 
 typedef struct S1Translate {
index 57d04385f113ed0e6f370c082bb4ed2ddcd4a563..56381aaf269ded13d8f0f2ff021cf1e0fbca4b98 100644 (file)
@@ -31,6 +31,7 @@
 #include "sysemu/cpu-timers.h"
 #include "cpu_bits.h"
 #include "debug.h"
+#include "tcg/oversized-guest.h"
 
 int riscv_cpu_mmu_index(CPURISCVState *env, bool ifetch)
 {