@@ -55,6 +55,7 @@ void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb,
bool tcg_exec_realizefn(CPUState *cpu, Error **errp);
void tcg_exec_unrealizefn(CPUState *cpu);
+void tcg_exec_reset(CPUState *cpu);
/* current cflags for hashing/comparison */
uint32_t curr_cflags(CPUState *cpu);
@@ -21,6 +21,7 @@
#include "system/cpus.h"
#include "system/tcg.h"
#include "qemu/plugin.h"
+#include "exec/tb-flush.h"
#include "internal-common.h"
bool tcg_allowed;
@@ -56,3 +57,8 @@ void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc)
cpu->exception_index = EXCP_ATOMIC;
cpu_loop_exit_restore(cpu, pc);
}
+
+void tcg_exec_reset(CPUState *cpu)
+{
+ tcg_flush_jmp_cache(cpu);
+}
@@ -34,7 +34,6 @@
#include "qemu/timer.h"
#include "exec/exec-all.h"
#include "exec/hwaddr.h"
-#include "exec/tb-flush.h"
#include "exec/translation-block.h"
#include "gdbstub/enums.h"
@@ -44,6 +43,7 @@
#include "tcg-accel-ops-mttcg.h"
#include "tcg-accel-ops-rr.h"
#include "tcg-accel-ops-icount.h"
+#include "internal-common.h"
/* common functionality among all TCG variants */
@@ -83,7 +83,7 @@ int tcg_cpu_exec(CPUState *cpu)
static void tcg_cpu_reset_hold(CPUState *cpu)
{
- tcg_flush_jmp_cache(cpu);
+ tcg_exec_reset(cpu);
tlb_flush(cpu);
}
Since tcg_cpu_reset_hold() is a system emulation specific helper, factor tcg_exec_reset() out so we can use it from user emulation, similarly to the [un]realize() handlers. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- accel/tcg/internal-common.h | 1 + accel/tcg/cpu-exec-common.c | 6 ++++++ accel/tcg/tcg-accel-ops.c | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-)