[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 42/84] tcg: Split out tcg/oversized-guest.h
|
From: |
Richard Henderson |
|
Subject: |
[PATCH 42/84] tcg: Split out tcg/oversized-guest.h |
|
Date: |
Wed, 3 May 2023 08:22:49 +0100 |
Move a use of TARGET_LONG_BITS out of tcg/tcg.h.
Include the new file only where required.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/exec/cpu_ldst.h | 3 +--
include/tcg/oversized-guest.h | 23 +++++++++++++++++++++++
include/tcg/tcg.h | 9 ---------
accel/tcg/cputlb.c | 1 +
accel/tcg/tcg-all.c | 1 +
target/arm/ptw.c | 1 +
target/riscv/cpu_helper.c | 1 +
7 files changed, 28 insertions(+), 11 deletions(-)
create mode 100644 include/tcg/oversized-guest.h
diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h
index f916a96a31..59abab7421 100644
--- a/include/exec/cpu_ldst.h
+++ b/include/exec/cpu_ldst.h
@@ -357,8 +357,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
index 0000000000..641b9749ff
--- /dev/null
+++ b/include/tcg/oversized-guest.h
@@ -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
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index 0999847b84..b3e8d78907 100644
--- a/include/tcg/tcg.h
+++ b/include/tcg/tcg.h
@@ -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
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index 83297f9bff..7d3cd877ff 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -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 */
diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c
index a831f8d7c3..02af6a2891 100644
--- a/accel/tcg/tcg-all.c
+++ b/accel/tcg/tcg-all.c
@@ -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"
diff --git a/target/arm/ptw.c b/target/arm/ptw.c
index 7b7ce65c7a..0926ae4c4a 100644
--- a/target/arm/ptw.c
+++ b/target/arm/ptw.c
@@ -14,6 +14,7 @@
#include "cpu.h"
#include "internals.h"
#include "idau.h"
+#include "tcg/oversized-guest.h"
typedef struct S1Translate {
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index f88c503cf4..7b9744be1e 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -30,6 +30,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)
{
--
2.34.1
- [PATCH 39/84] *: Add missing includes of tcg/tcg.h, (continued)
- [PATCH 39/84] *: Add missing includes of tcg/tcg.h, Richard Henderson, 2023/05/03
- [PATCH 33/84] tcg: Widen CPUTLBEntry comparators to 64-bits, Richard Henderson, 2023/05/03
- [PATCH 11/84] tcg: Add addr_type to TCGContext, Richard Henderson, 2023/05/03
- [PATCH 31/84] tcg: Add page_bits and page_mask to TCGContext, Richard Henderson, 2023/05/03
- [PATCH 37/84] *: Add missing includes of qemu/error-report.h, Richard Henderson, 2023/05/03
- [PATCH 34/84] tcg: Add tlb_fast_offset to TCGContext, Richard Henderson, 2023/05/03
- [PATCH 40/84] tcg: Split out tcg-target-reg-bits.h, Richard Henderson, 2023/05/03
- [PATCH 41/84] target/arm: Fix test of TCG_OVERSIZED_GUEST, Richard Henderson, 2023/05/03
- [PATCH 42/84] tcg: Split out tcg/oversized-guest.h,
Richard Henderson <=
- [PATCH 43/84] tcg: Move TCGv, dup_const_tl definitions to tcg-op.h, Richard Henderson, 2023/05/03
- [PATCH 45/84] target/arm: Include helper-gen.h in translator.h, Richard Henderson, 2023/05/03
- [PATCH 47/84] tcg: Remove outdated comments in helper-head.h, Richard Henderson, 2023/05/03
- [PATCH 44/84] tcg: Split tcg/tcg-op-common.h from tcg/tcg-op.h, Richard Henderson, 2023/05/03
- [PATCH 46/84] target/hexagon: Include helper-gen.h where needed, Richard Henderson, 2023/05/03
- [PATCH 51/84] tcg: Split tcg_gen_callN, Richard Henderson, 2023/05/03
- [PATCH 54/84] tcg: Add insn_start_words to TCGContext, Richard Henderson, 2023/05/03
- [PATCH 53/84] tcg: Split helper-proto.h, Richard Henderson, 2023/05/03
- [PATCH 50/84] tcg: Move temp_idx and tcgv_i32_temp debug out of line, Richard Henderson, 2023/05/03
- [PATCH 48/84] tcg: Move TCGHelperInfo and dependencies to tcg/helper-info.h, Richard Henderson, 2023/05/03