Commit ba7d3d18 authored by Alex Bennée's avatar Alex Bennée
Browse files

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: default avatarAlex Bennée <alex.bennee@linaro.org>
Reviewed-by: default avatarEduardo Habkost <ehabkost@redhat.com>
parent 1f5c00cf
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -270,6 +270,7 @@ static void cpu_common_reset(CPUState *cpu)
    cpu->exception_index = -1;
    cpu->crash_occurred = false;

    if (tcg_enabled()) {
        for (i = 0; i < TB_JMP_CACHE_SIZE; ++i) {
            atomic_set(&cpu->tb_jmp_cache[i], NULL);
        }
@@ -278,6 +279,7 @@ static void cpu_common_reset(CPUState *cpu)
        tlb_flush(cpu, 0);
#endif
    }
}

static bool cpu_common_has_work(CPUState *cs)
{