[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 15/39] tcg: Remove TCGContext.tlb_fast_offset
From: |
Richard Henderson |
Subject: |
[PATCH v3 15/39] tcg: Remove TCGContext.tlb_fast_offset |
Date: |
Sat, 16 Sep 2023 14:40:59 -0700 |
Now that there is no padding between CPUNegativeOffsetState
and CPUArchState, this value is constant across all targets.
Reviewed-by: Anton Johansson <anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/tcg/tcg.h | 1 -
accel/tcg/translate-all.c | 2 --
tcg/tcg.c | 15 +++++++++------
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index 3cdbeaf460..7743868dc9 100644
--- a/include/tcg/tcg.h
+++ b/include/tcg/tcg.h
@@ -489,7 +489,6 @@ struct TCGContext {
TCGType addr_type; /* TCG_TYPE_I32 or TCG_TYPE_I64 */
#ifdef CONFIG_SOFTMMU
- int tlb_fast_offset;
int page_mask;
uint8_t page_bits;
uint8_t tlb_dyn_max_bits;
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 6fac5b7e29..83e07b830f 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -344,8 +344,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
tcg_ctx->page_bits = TARGET_PAGE_BITS;
tcg_ctx->page_mask = TARGET_PAGE_MASK;
tcg_ctx->tlb_dyn_max_bits = CPU_TLB_DYN_MAX_BITS;
- tcg_ctx->tlb_fast_offset = (int)offsetof(ArchCPU, parent_obj.neg.tlb.f)
- - (int)offsetof(ArchCPU, env);
#endif
tcg_ctx->insn_start_words = TARGET_INSN_START_WORDS;
#ifdef TCG_GUEST_DEFAULT_MO
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 72b113ad53..c72790cdf1 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -406,7 +406,8 @@ static uintptr_t G_GNUC_UNUSED
get_jmp_target_addr(TCGContext *s, int which)
#if defined(CONFIG_SOFTMMU) && !defined(CONFIG_TCG_INTERPRETER)
static int tlb_mask_table_ofs(TCGContext *s, int which)
{
- return s->tlb_fast_offset + which * sizeof(CPUTLBDescFast);
+ return (offsetof(CPUNegativeOffsetState, tlb.f[which]) -
+ sizeof(CPUNegativeOffsetState));
}
#endif
@@ -734,6 +735,13 @@ static const TCGTargetOpDef constraint_sets[] = {
#include "tcg-target.c.inc"
+#ifndef CONFIG_TCG_INTERPRETER
+/* Validate CPUTLBDescFast placement. */
+QEMU_BUILD_BUG_ON((int)(offsetof(CPUNegativeOffsetState, tlb.f[0]) -
+ sizeof(CPUNegativeOffsetState))
+ < MIN_TLB_MASK_TABLE_OFS);
+#endif
+
static void alloc_tcg_plugin_context(TCGContext *s)
{
#ifdef CONFIG_PLUGIN
@@ -1497,11 +1505,6 @@ void tcg_func_start(TCGContext *s)
tcg_debug_assert(s->addr_type == TCG_TYPE_I32 ||
s->addr_type == TCG_TYPE_I64);
-#if defined(CONFIG_SOFTMMU) && !defined(CONFIG_TCG_INTERPRETER)
- tcg_debug_assert(s->tlb_fast_offset < 0);
- tcg_debug_assert(s->tlb_fast_offset >= MIN_TLB_MASK_TABLE_OFS);
-#endif
-
tcg_debug_assert(s->insn_start_words > 0);
}
--
2.34.1
- [PATCH v3 08/39] accel/tcg: Remove CPUState.icount_decr_ptr, (continued)
- [PATCH v3 08/39] accel/tcg: Remove CPUState.icount_decr_ptr, Richard Henderson, 2023/09/16
- [PATCH v3 07/39] accel/tcg: Move CPUNegativeOffsetState into CPUState, Richard Henderson, 2023/09/16
- [PATCH v3 09/39] accel/tcg: Move can_do_io to CPUNegativeOffsetState, Richard Henderson, 2023/09/16
- [PATCH v3 05/39] target/*: Add instance_align to all cpu base classes, Richard Henderson, 2023/09/16
- [PATCH v3 04/39] target/arm: Remove size and alignment for cpu subclasses, Richard Henderson, 2023/09/16
- [PATCH v3 02/39] accel/tcg: Move CPUTLB definitions from cpu-defs.h, Richard Henderson, 2023/09/16
- [PATCH v3 06/39] accel/tcg: Validate placement of CPUNegativeOffsetState, Richard Henderson, 2023/09/16
- [PATCH v3 10/39] accel/tcg: Remove cpu_neg(), Richard Henderson, 2023/09/16
- [PATCH v3 14/39] accel/tcg: Remove env_neg(), Richard Henderson, 2023/09/16
- [PATCH v3 15/39] tcg: Remove TCGContext.tlb_fast_offset,
Richard Henderson <=
- [PATCH v3 17/39] accel/tcg: Modify probe_access_internal() to use CPUState, Richard Henderson, 2023/09/16
- [PATCH v3 16/39] accel/tcg: Modify tlb_*() to use CPUState, Richard Henderson, 2023/09/16
- [PATCH v3 11/39] tcg: Rename cpu_env to tcg_env, Richard Henderson, 2023/09/16
- [PATCH v3 12/39] accel/tcg: Replace CPUState.env_ptr with cpu_env(), Richard Henderson, 2023/09/16
- [PATCH v3 13/39] accel/tcg: Remove cpu_set_cpustate_pointers, Richard Henderson, 2023/09/16
- [PATCH v3 21/39] accel/tcg: Remove env_tlb(), Richard Henderson, 2023/09/16
- [PATCH v3 18/39] accel/tcg: Modify memory access functions to use CPUState, Richard Henderson, 2023/09/16
- [PATCH v3 28/39] accel: Rename accel-common.c -> accel-target.c, Richard Henderson, 2023/09/16