accel/tcg: Remove reset_icount argument from cpu_restore_state_from_tb

The value passed is always true.

Reviewed-by: Claudio Fontana <cfontana@suse.de>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2022-10-24 23:12:56 +10:00
parent 3d419a4dd2
commit cfa29dd506
3 changed files with 10 additions and 11 deletions

View File

@ -107,7 +107,7 @@ TranslationBlock *tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc,
tb_page_addr_t phys_page2); tb_page_addr_t phys_page2);
bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc); bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc);
void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb, void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb,
uintptr_t host_pc, bool reset_icount); uintptr_t host_pc);
/* Return the current PC from CPU, which may be cached in TB. */ /* Return the current PC from CPU, which may be cached in TB. */
static inline target_ulong log_pc(CPUState *cpu, const TranslationBlock *tb) static inline target_ulong log_pc(CPUState *cpu, const TranslationBlock *tb)

View File

@ -536,7 +536,7 @@ tb_invalidate_phys_page_range__locked(struct page_collection *pages,
* restore the CPU state. * restore the CPU state.
*/ */
current_tb_modified = true; current_tb_modified = true;
cpu_restore_state_from_tb(cpu, current_tb, retaddr, true); cpu_restore_state_from_tb(cpu, current_tb, retaddr);
} }
#endif /* TARGET_HAS_PRECISE_SMC */ #endif /* TARGET_HAS_PRECISE_SMC */
tb_phys_invalidate__locked(tb); tb_phys_invalidate__locked(tb);
@ -685,7 +685,7 @@ bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc)
* function to partially restore the CPU state. * function to partially restore the CPU state.
*/ */
current_tb_modified = true; current_tb_modified = true;
cpu_restore_state_from_tb(cpu, current_tb, pc, true); cpu_restore_state_from_tb(cpu, current_tb, pc);
} }
#endif /* TARGET_HAS_PRECISE_SMC */ #endif /* TARGET_HAS_PRECISE_SMC */
tb_phys_invalidate(tb, addr); tb_phys_invalidate(tb, addr);

View File

@ -282,12 +282,11 @@ static int cpu_unwind_data_from_tb(TranslationBlock *tb, uintptr_t host_pc,
} }
/* /*
* The cpu state corresponding to 'host_pc' is restored. * The cpu state corresponding to 'host_pc' is restored in
* When reset_icount is true, current TB will be interrupted and * preparation for exiting the TB.
* icount should be recalculated.
*/ */
void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb, void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb,
uintptr_t host_pc, bool reset_icount) uintptr_t host_pc)
{ {
uint64_t data[TARGET_INSN_START_WORDS]; uint64_t data[TARGET_INSN_START_WORDS];
#ifdef CONFIG_PROFILER #ifdef CONFIG_PROFILER
@ -300,7 +299,7 @@ void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb,
return; return;
} }
if (reset_icount && (tb_cflags(tb) & CF_USE_ICOUNT)) { if (tb_cflags(tb) & CF_USE_ICOUNT) {
assert(icount_enabled()); assert(icount_enabled());
/* /*
* Reset the cycle counter to the start of the block and * Reset the cycle counter to the start of the block and
@ -333,7 +332,7 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc)
if (in_code_gen_buffer((const void *)(host_pc - tcg_splitwx_diff))) { if (in_code_gen_buffer((const void *)(host_pc - tcg_splitwx_diff))) {
TranslationBlock *tb = tcg_tb_lookup(host_pc); TranslationBlock *tb = tcg_tb_lookup(host_pc);
if (tb) { if (tb) {
cpu_restore_state_from_tb(cpu, tb, host_pc, true); cpu_restore_state_from_tb(cpu, tb, host_pc);
return true; return true;
} }
} }
@ -1032,7 +1031,7 @@ void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr)
tb = tcg_tb_lookup(retaddr); tb = tcg_tb_lookup(retaddr);
if (tb) { if (tb) {
/* We can use retranslation to find the PC. */ /* We can use retranslation to find the PC. */
cpu_restore_state_from_tb(cpu, tb, retaddr, true); cpu_restore_state_from_tb(cpu, tb, retaddr);
tb_phys_invalidate(tb, -1); tb_phys_invalidate(tb, -1);
} else { } else {
/* The exception probably happened in a helper. The CPU state should /* The exception probably happened in a helper. The CPU state should
@ -1068,7 +1067,7 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
cpu_abort(cpu, "cpu_io_recompile: could not find TB for pc=%p", cpu_abort(cpu, "cpu_io_recompile: could not find TB for pc=%p",
(void *)retaddr); (void *)retaddr);
} }
cpu_restore_state_from_tb(cpu, tb, retaddr, true); cpu_restore_state_from_tb(cpu, tb, retaddr);
/* /*
* Some guests must re-execute the branch when re-executing a delay * Some guests must re-execute the branch when re-executing a delay