Skip to content

Commit

Permalink
accel/tcg: Remove restore_state_to_opc function
Browse files Browse the repository at this point in the history
All targets have been updated.  Use the tcg_ops target hook
exclusively, which allows the compat code to be removed.

Reviewed-by: Claudio Fontana <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
  • Loading branch information
rth7680 committed Oct 26, 2022
1 parent 044dcfc commit 04f1057
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
16 changes: 2 additions & 14 deletions accel/tcg/translate-all.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ static int encode_search(TranslationBlock *tb, uint8_t *block)
int cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb,
uintptr_t searched_pc, bool reset_icount)
{
target_ulong data[TARGET_INSN_START_WORDS];
uint64_t data[TARGET_INSN_START_WORDS];
uintptr_t host_pc = (uintptr_t)tb->tc.ptr;
const uint8_t *p = tb->tc.ptr + tb->tc.size;
int i, j, num_insns = tb->icount;
Expand Down Expand Up @@ -295,19 +295,7 @@ int cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb,
cpu_neg(cpu)->icount_decr.u16.low += num_insns - i;
}

{
const struct TCGCPUOps *ops = cpu->cc->tcg_ops;
__typeof(ops->restore_state_to_opc) restore = ops->restore_state_to_opc;
if (restore) {
uint64_t d64[TARGET_INSN_START_WORDS];
for (i = 0; i < TARGET_INSN_START_WORDS; ++i) {
d64[i] = data[i];
}
restore(cpu, tb, d64);
} else {
restore_state_to_opc(cpu->env_ptr, tb, data);
}
}
cpu->cc->tcg_ops->restore_state_to_opc(cpu, tb, data);

#ifdef CONFIG_PROFILER
qatomic_set(&prof->restore_time,
Expand Down
3 changes: 0 additions & 3 deletions include/exec/exec-all.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ typedef ram_addr_t tb_page_addr_t;
#define TB_PAGE_ADDR_FMT RAM_ADDR_FMT
#endif

void restore_state_to_opc(CPUArchState *env, TranslationBlock *tb,
target_ulong *data) __attribute__((weak));

/**
* cpu_restore_state:
* @cpu: the vCPU state is to be restore to
Expand Down

0 comments on commit 04f1057

Please sign in to comment.