@@ -89,7 +89,7 @@ static bool cpu_thread_is_idle(CPUState *cpu)
return true;
}
-static bool all_cpu_threads_idle(void)
+bool all_cpu_threads_idle(void)
{
CPUState *cpu;
@@ -217,6 +217,7 @@ static inline unsigned int tb_phys_hash_func(tb_page_addr_t pc)
void tb_free(TranslationBlock *tb);
void tb_flush(CPUArchState *env);
+void tb_flush_all(void);
void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr);
#if defined(USE_DIRECT_JUMP)
@@ -495,6 +495,16 @@ static inline bool cpu_has_work(CPUState *cpu)
bool qemu_cpu_is_self(CPUState *cpu);
/**
+ * qemu_in_vcpu_thread:
+ *
+ * Checks whether the caller is executing on the vCPU thread
+ * of the current vCPU.
+ *
+ * Returns: %true if called from vCPU's thread, %false otherwise.
+ */
+bool qemu_in_vcpu_thread(void);
+
+/**
* qemu_cpu_kick:
* @cpu: The vCPU to kick.
*
@@ -6,6 +6,7 @@ void qemu_init_cpu_loop(void);
void resume_all_vcpus(void);
void pause_all_vcpus(void);
void cpu_stop_current(void);
+bool all_cpu_threads_idle(void);
void cpu_synchronize_all_states(void);
void cpu_synchronize_all_post_reset(void);
@@ -799,6 +799,14 @@ void tb_flush(CPUArchState *env1)
tcg_ctx.tb_ctx.tb_flush_count++;
}
+void tb_flush_all(void)
+{
+ CPUState *cpu;
+ for (cpu = first_cpu ; cpu != NULL ; cpu = CPU_NEXT(cpu)) {
+ tb_flush(cpu->env_ptr);
+ }
+}
+
#ifdef DEBUG_TB_CHECK
static void tb_invalidate_check(target_ulong address)