aboutsummaryrefslogtreecommitdiff
path: root/qom/cpu.c
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2017-01-12 15:02:50 +0000
committerAlex Bennée <alex.bennee@linaro.org>2017-01-13 14:24:36 +0000
commitba7d3d1858c257e39b47f7f12fa2016ffd960b11 (patch)
tree69a55a615f2958f75d8bfd99352ed2c91fbf9379 /qom/cpu.c
parent1f5c00cfdb8114c1e3a13426588ceb64f82c9ddb (diff)
cpu_common_reset: wrap TCG specific code in tcg_enabled()
Both the cpu->tb_jmp_cache and SoftMMU TLB structures are only used when running TCG code so we might as well skip them for anything else. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'qom/cpu.c')
-rw-r--r--qom/cpu.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/qom/cpu.c b/qom/cpu.c
index cc51de2a8c..61ee0cb88c 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -270,13 +270,15 @@ static void cpu_common_reset(CPUState *cpu)
cpu->exception_index = -1;
cpu->crash_occurred = false;
- for (i = 0; i < TB_JMP_CACHE_SIZE; ++i) {
- atomic_set(&cpu->tb_jmp_cache[i], NULL);
- }
+ if (tcg_enabled()) {
+ for (i = 0; i < TB_JMP_CACHE_SIZE; ++i) {
+ atomic_set(&cpu->tb_jmp_cache[i], NULL);
+ }
#ifdef CONFIG_SOFTMMU
- tlb_flush(cpu, 0);
+ tlb_flush(cpu, 0);
#endif
+ }
}
static bool cpu_common_has_work(CPUState *cs)