[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v16 03/21] sysemu: system functions for replay
From: |
Pavel Dovgalyuk |
Subject: |
[Qemu-devel] [PATCH v16 03/21] sysemu: system functions for replay |
Date: |
Tue, 04 Aug 2015 11:44:06 +0300 |
User-agent: |
StGit/0.16 |
This patch removes "static" specifier from several qemu function to make
them visible to the replay module. It also invents several system functions
that will be used by replay.
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Pavel Dovgalyuk <address@hidden>
---
cpus.c | 2 +-
include/exec/exec-all.h | 3 ++-
include/qom/cpu.h | 10 ++++++++++
include/sysemu/cpus.h | 1 +
translate-all.c | 8 ++++++++
5 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/cpus.c b/cpus.c
index a822ce3..96b40b2 100644
--- a/cpus.c
+++ b/cpus.c
@@ -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;
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index c6248a8..8080bb4 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -197,7 +197,8 @@ struct TBContext {
};
void tb_free(TranslationBlock *tb);
-void tb_flush(CPUState *cpu);
+void tb_flush(CPUState *env);
+void tb_flush_all(void);
void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr);
#if defined(USE_DIRECT_JUMP)
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index ed000ca..8c4ea00 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -501,6 +501,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.
*
diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h
index 3f162a9..86ae556 100644
--- a/include/sysemu/cpus.h
+++ b/include/sysemu/cpus.h
@@ -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);
diff --git a/translate-all.c b/translate-all.c
index 60a3d8b..a45cd44 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -800,6 +800,14 @@ void tb_flush(CPUState *cpu)
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);
+ }
+}
+
#ifdef DEBUG_TB_CHECK
static void tb_invalidate_check(target_ulong address)
- [Qemu-devel] [PATCH v16 00/21] Deterministic replay core, Pavel Dovgalyuk, 2015/08/04
- [Qemu-devel] [PATCH v16 01/21] i386: partial revert of interrupt poll fix, Pavel Dovgalyuk, 2015/08/04
- [Qemu-devel] [PATCH v16 02/21] replay: global variables and function stubs, Pavel Dovgalyuk, 2015/08/04
- [Qemu-devel] [PATCH v16 03/21] sysemu: system functions for replay,
Pavel Dovgalyuk <=
- [Qemu-devel] [PATCH v16 04/21] replay: internal functions for replay log, Pavel Dovgalyuk, 2015/08/04
- [Qemu-devel] [PATCH v16 05/21] replay: introduce mutex to protect the replay log, Pavel Dovgalyuk, 2015/08/04
- [Qemu-devel] [PATCH v16 06/21] replay: introduce icount event, Pavel Dovgalyuk, 2015/08/04
- [Qemu-devel] [PATCH v16 07/21] cpu-exec: allow temporary disabling icount, Pavel Dovgalyuk, 2015/08/04
- [Qemu-devel] [PATCH v16 08/21] cpu: replay instructions sequence, Pavel Dovgalyuk, 2015/08/04
- [Qemu-devel] [PATCH v16 09/21] i386: interrupt poll processing, Pavel Dovgalyuk, 2015/08/04
- [Qemu-devel] [PATCH v16 10/21] replay: interrupts and exceptions, Pavel Dovgalyuk, 2015/08/04
- [Qemu-devel] [PATCH v16 11/21] replay: asynchronous events infrastructure, Pavel Dovgalyuk, 2015/08/04
- [Qemu-devel] [PATCH v16 12/21] replay: recording and replaying clock ticks, Pavel Dovgalyuk, 2015/08/04
- [Qemu-devel] [PATCH v16 18/21] replay: initialization and deinitialization, Pavel Dovgalyuk, 2015/08/04