From 3501c34344d4deef114b06c6f8c8be3ddf9fcaaa Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite Date: Mon, 12 Feb 2018 21:13:51 -0500 Subject: [PATCH] tcg: Delete unused cpu_pc_from_tb() No code uses the cpu_pc_from_tb() function. Delete from tricore and arm which each provide an unused implementation. Update the comment in tcg.h to reflect that this is obsoleted by synchronize_from_tb. Backports commit fee068e4f190a36ef3bda9aa7c802f90434ef8e5 from qemu --- qemu/target-arm/cpu.h | 9 --------- qemu/tcg/tcg.h | 6 ++++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/qemu/target-arm/cpu.h b/qemu/target-arm/cpu.h index 1d2f4261..7c107903 100644 --- a/qemu/target-arm/cpu.h +++ b/qemu/target-arm/cpu.h @@ -1926,15 +1926,6 @@ static inline uint64_t *aa64_vfp_qreg(CPUARMState *env, unsigned regno) #include "exec/exec-all.h" -static inline void cpu_pc_from_tb(CPUARMState *env, TranslationBlock *tb) -{ - if (ARM_TBFLAG_AARCH64_STATE(tb->flags)) { - env->pc = tb->pc; - } else { - env->regs[15] = tb->pc; - } -} - enum { QEMU_PSCI_CONDUIT_DISABLED = 0, QEMU_PSCI_CONDUIT_SMC = 1, diff --git a/qemu/tcg/tcg.h b/qemu/tcg/tcg.h index d8fe43d5..3e9a4bae 100644 --- a/qemu/tcg/tcg.h +++ b/qemu/tcg/tcg.h @@ -1049,8 +1049,10 @@ static inline unsigned get_mmuidx(TCGMemOpIdx oi) * state is correctly synchronised and ready for execution of the next * TB (and in particular the guest PC is the address to execute next). * Otherwise, we gave up on execution of this TB before it started, and - * the caller must fix up the CPU state by calling cpu_pc_from_tb() - * with the next-TB pointer we return. + * the caller must fix up the CPU state by calling the CPU's + * synchronize_from_tb() method with the next-TB pointer we return (falling + * back to calling the CPU's set_pc method with tb->pb if no + * synchronize_from_tb() method exists). * * Note that TCG targets may use a different definition of tcg_qemu_tb_exec * to this default (which just calls the prologue.code emitted by