[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 11/29] tcg: Create tcg_init
From: |
Richard Henderson |
Subject: |
[PATCH v2 11/29] tcg: Create tcg_init |
Date: |
Sun, 14 Mar 2021 15:27:06 -0600 |
Perform both tcg_context_init and tcg_region_init.
Do not leave this split to the caller.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/tcg/tcg.h | 3 +--
tcg/internal.h | 1 +
accel/tcg/translate-all.c | 3 +--
tcg/tcg.c | 9 ++++++++-
4 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index 7a435bf807..3ad77ec34d 100644
--- a/include/tcg/tcg.h
+++ b/include/tcg/tcg.h
@@ -874,7 +874,6 @@ void *tcg_malloc_internal(TCGContext *s, int size);
void tcg_pool_reset(TCGContext *s);
TranslationBlock *tcg_tb_alloc(TCGContext *s);
-void tcg_region_init(size_t tb_size, int splitwx);
void tb_destroy(TranslationBlock *tb);
void tcg_region_reset_all(void);
@@ -907,7 +906,7 @@ static inline void *tcg_malloc(int size)
}
}
-void tcg_context_init(TCGContext *s);
+void tcg_init(size_t tb_size, int splitwx);
void tcg_register_thread(void);
void tcg_prologue_init(TCGContext *s);
void tcg_func_start(TCGContext *s);
diff --git a/tcg/internal.h b/tcg/internal.h
index b1dda343c2..f13c564d9b 100644
--- a/tcg/internal.h
+++ b/tcg/internal.h
@@ -30,6 +30,7 @@
extern TCGContext **tcg_ctxs;
extern unsigned int n_tcg_ctxs;
+void tcg_region_init(size_t tb_size, int splitwx);
bool tcg_region_alloc(TCGContext *s);
void tcg_region_initial_alloc(TCGContext *s);
void tcg_region_prologue_set(TCGContext *s);
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 4071edda16..050b4bff46 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -920,10 +920,9 @@ static void tb_htable_init(void)
void tcg_exec_init(unsigned long tb_size, int splitwx)
{
tcg_allowed = true;
- tcg_context_init(&tcg_init_ctx);
page_init();
tb_htable_init();
- tcg_region_init(tb_size, splitwx);
+ tcg_init(tb_size, splitwx);
#if defined(CONFIG_SOFTMMU)
/* There's no guest base to take into account, so go ahead and
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 10a571d41c..65a63bda8a 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -576,8 +576,9 @@ static void process_op_defs(TCGContext *s);
static TCGTemp *tcg_global_reg_new_internal(TCGContext *s, TCGType type,
TCGReg reg, const char *name);
-void tcg_context_init(TCGContext *s)
+static void tcg_context_init(void)
{
+ TCGContext *s = &tcg_init_ctx;
int op, total_args, n, i;
TCGOpDef *def;
TCGArgConstraint *args_ct;
@@ -654,6 +655,12 @@ void tcg_context_init(TCGContext *s)
cpu_env = temp_tcgv_ptr(ts);
}
+void tcg_init(size_t tb_size, int splitwx)
+{
+ tcg_context_init();
+ tcg_region_init(tb_size, splitwx);
+}
+
/*
* Allocate TBs right before their corresponding translated code, making
* sure that TBs and code are on different cache lines.
--
2.25.1
- [PATCH v2 00/29] tcg: Workaround macOS 11.2 mprotect bug, Richard Henderson, 2021/03/14
- [PATCH v2 01/29] meson: Split out tcg/meson.build, Richard Henderson, 2021/03/14
- [PATCH v2 03/29] tcg: Re-order tcg_region_init vs tcg_prologue_init, Richard Henderson, 2021/03/14
- [PATCH v2 02/29] meson: Split out fpu/meson.build, Richard Henderson, 2021/03/14
- [PATCH v2 04/29] tcg: Remove error return from tcg_region_initial_alloc__locked, Richard Henderson, 2021/03/14
- [PATCH v2 05/29] tcg: Split out tcg_region_initial_alloc, Richard Henderson, 2021/03/14
- [PATCH v2 06/29] tcg: Split out tcg_region_prologue_set, Richard Henderson, 2021/03/14
- [PATCH v2 08/29] accel/tcg: Inline cpu_gen_init, Richard Henderson, 2021/03/14
- [PATCH v2 07/29] tcg: Split out region.c, Richard Henderson, 2021/03/14
- [PATCH v2 09/29] accel/tcg: Move alloc_code_gen_buffer to tcg/region.c, Richard Henderson, 2021/03/14
- [PATCH v2 11/29] tcg: Create tcg_init,
Richard Henderson <=
- [PATCH v2 12/29] accel/tcg: Merge tcg_exec_init into tcg_init_machine, Richard Henderson, 2021/03/14
- [PATCH v2 10/29] accel/tcg: Rename tcg_init to tcg_init_machine, Richard Henderson, 2021/03/14
- [PATCH v2 13/29] accel/tcg: Pass down max_cpus to tcg_init, Richard Henderson, 2021/03/14
- [PATCH v2 14/29] tcg: Introduce tcg_max_ctxs, Richard Henderson, 2021/03/14
- [PATCH v2 15/29] tcg: Move MAX_CODE_GEN_BUFFER_SIZE to tcg-target.h, Richard Henderson, 2021/03/14
- [PATCH v2 16/29] tcg: Replace region.end with region.total_size, Richard Henderson, 2021/03/14
- [PATCH v2 20/29] tcg: Move in_code_gen_buffer and tests to region.c, Richard Henderson, 2021/03/14
- [PATCH v2 17/29] tcg: Rename region.start to region.after_prologue, Richard Henderson, 2021/03/14
- [PATCH v2 19/29] tcg: Tidy split_cross_256mb, Richard Henderson, 2021/03/14
- [PATCH v2 18/29] tcg: Tidy tcg_n_regions, Richard Henderson, 2021/03/14