Skip to content

Commit ba7d3d1

Browse files
committed
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>
1 parent 1f5c00c commit ba7d3d1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

qom/cpu.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,15 @@ static void cpu_common_reset(CPUState *cpu)
270270
cpu->exception_index = -1;
271271
cpu->crash_occurred = false;
272272

273-
for (i = 0; i < TB_JMP_CACHE_SIZE; ++i) {
274-
atomic_set(&cpu->tb_jmp_cache[i], NULL);
275-
}
273+
if (tcg_enabled()) {
274+
for (i = 0; i < TB_JMP_CACHE_SIZE; ++i) {
275+
atomic_set(&cpu->tb_jmp_cache[i], NULL);
276+
}
276277

277278
#ifdef CONFIG_SOFTMMU
278-
tlb_flush(cpu, 0);
279+
tlb_flush(cpu, 0);
279280
#endif
281+
}
280282
}
281283

282284
static bool cpu_common_has_work(CPUState *cs)

0 commit comments

Comments
 (0)