[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/15] target-i386: Move TCG initialization check to
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PULL 08/15] target-i386: Move TCG initialization check to tcg_x86_init() |
Date: |
Mon, 23 May 2016 16:24:20 -0300 |
Instead of requiring cpu.c to check if TCG was already initialized,
simply let the function be called multiple times.
Suggested-by: Igor Mammedov <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
target-i386/cpu.c | 4 +---
target-i386/translate.c | 6 ++++++
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index e615486..2dc3d3c 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -3088,7 +3088,6 @@ static void x86_cpu_initfn(Object *obj)
X86CPUClass *xcc = X86_CPU_GET_CLASS(obj);
CPUX86State *env = &cpu->env;
FeatureWord w;
- static int inited;
cs->env_ptr = env;
cpu_exec_init(cs, &error_abort);
@@ -3139,8 +3138,7 @@ static void x86_cpu_initfn(Object *obj)
x86_cpu_load_def(cpu, xcc->cpu_def, &error_abort);
/* init various static tables used in TCG mode */
- if (tcg_enabled() && !inited) {
- inited = 1;
+ if (tcg_enabled()) {
tcg_x86_init();
}
}
diff --git a/target-i386/translate.c b/target-i386/translate.c
index 731b10d..bf33e6b 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -8144,6 +8144,12 @@ void tcg_x86_init(void)
"bnd0_ub", "bnd1_ub", "bnd2_ub", "bnd3_ub"
};
int i;
+ static bool initialized;
+
+ if (initialized) {
+ return;
+ }
+ initialized = true;
cpu_env = tcg_global_reg_new_ptr(TCG_AREG0, "env");
cpu_cc_op = tcg_global_mem_new_i32(cpu_env,
--
2.5.5
- [Qemu-devel] [PULL 01/15] target-i386: Define structs for layout of xsave area, (continued)
- [Qemu-devel] [PULL 01/15] target-i386: Define structs for layout of xsave area, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 02/15] target-i386: Use xsave structs for ext_save_area, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 05/15] pc: Set CPU model-id on compat_props for pc <= 2.4, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 03/15] target-i386: kvm: Use X86XSaveArea struct for xsave save/load, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 10/15] target-i386: Call cpu_exec_init() on realize, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 11/15] target-i386: kvm: Allocate kvm_msrs struct once per VCPU, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 06/15] target-i386: Set constant model_id for qemu63/qemu32/athlon, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 07/15] cpu: Eliminate cpudef_init(), cpudef_setup(), Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 08/15] target-i386: Move TCG initialization check to tcg_x86_init(),
Eduardo Habkost <=
- [Qemu-devel] [PULL 12/15] target-i386: kvm: Increase MSR_BUF_SIZE, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 09/15] target-i386: Move TCG initialization to realize time, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 14/15] target-i386: kvm: Simplify MSR setting functions, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 13/15] target-i386: kvm: Simplify MSR array construction, Eduardo Habkost, 2016/05/23
- [Qemu-devel] [PULL 15/15] target-i386: kvm: Eliminate kvm_msr_entry_set(), Eduardo Habkost, 2016/05/23
- Re: [Qemu-devel] [PULL 00/15] X86 queue, 2016-05-23, Eduardo Habkost, 2016/05/23