Skip to content

Commit

Permalink
cpu_common_reset: wrap TCG specific code in tcg_enabled()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Eduardo Habkost <[email protected]>
  • Loading branch information
stsquad committed Jan 13, 2017
1 parent 1f5c00c commit ba7d3d1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions qom/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ba7d3d1

Please sign in to comment.