All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com,
	igor.rubinov@gmail.com, alex.bennee@linaro.org,
	mark.burton@greensocs.com, real@ispras.ru, batuzovk@ispras.ru,
	maria.klimushenkova@ispras.ru, pavel.dovgaluk@ispras.ru,
	pbonzini@redhat.com, hines@cert.org, fred.konrad@greensocs.com
Subject: [Qemu-devel] [PATCH v15 03/21] sysemu: system functions for replay
Date: Wed, 01 Jul 2015 14:51:53 +0300	[thread overview]
Message-ID: <20150701115153.9832.96470.stgit@PASHA-ISP> (raw)
In-Reply-To: <20150701115132.9832.12257.stgit@PASHA-ISP>

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 <pbonzini@redhat.com>

Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
---
 cpus.c                  |    2 +-
 include/exec/exec-all.h |    1 +
 include/qom/cpu.h       |   10 ++++++++++
 include/sysemu/cpus.h   |    1 +
 translate-all.c         |    8 ++++++++
 5 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/cpus.c b/cpus.c
index 4f0e54d..5ded62c 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 2573e8c..1edb785 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -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)
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index dfb460d..d52a87e 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -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.
  *
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 b6b0e1c..c4a1a51 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -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)

  parent reply	other threads:[~2015-07-01 11:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01 11:51 [Qemu-devel] [PATCH v15 00/21] Deterministic replay core Pavel Dovgalyuk
2015-07-01 11:51 ` [Qemu-devel] [PATCH v15 01/21] i386: partial revert of interrupt poll fix Pavel Dovgalyuk
2015-07-01 11:51 ` [Qemu-devel] [PATCH v15 02/21] replay: global variables and function stubs Pavel Dovgalyuk
2015-07-01 11:51 ` Pavel Dovgalyuk [this message]
2015-07-01 11:51 ` [Qemu-devel] [PATCH v15 04/21] replay: internal functions for replay log Pavel Dovgalyuk
2015-07-01 11:52 ` [Qemu-devel] [PATCH v15 05/21] replay: introduce mutex to protect the " Pavel Dovgalyuk
2015-07-01 11:52 ` [Qemu-devel] [PATCH v15 06/21] replay: introduce icount event Pavel Dovgalyuk
2015-07-01 11:52 ` [Qemu-devel] [PATCH v15 07/21] cpu-exec: allow temporary disabling icount Pavel Dovgalyuk
2015-07-01 11:52 ` [Qemu-devel] [PATCH v15 08/21] cpu: replay instructions sequence Pavel Dovgalyuk
2015-07-01 11:52 ` [Qemu-devel] [PATCH v15 09/21] i386: interrupt poll processing Pavel Dovgalyuk
2015-07-01 11:52 ` [Qemu-devel] [PATCH v15 10/21] replay: interrupts and exceptions Pavel Dovgalyuk
2015-07-01 11:52 ` [Qemu-devel] [PATCH v15 11/21] replay: asynchronous events infrastructure Pavel Dovgalyuk
2015-07-01 11:52 ` [Qemu-devel] [PATCH v15 12/21] replay: recording and replaying clock ticks Pavel Dovgalyuk
2015-07-01 11:52 ` [Qemu-devel] [PATCH v15 13/21] replay: shutdown event Pavel Dovgalyuk
2015-07-01 11:52 ` [Qemu-devel] [PATCH v15 14/21] replay: checkpoints Pavel Dovgalyuk
2015-07-01 11:53 ` [Qemu-devel] [PATCH v15 15/21] bottom halves: introduce bh call function Pavel Dovgalyuk
2015-07-01 11:53 ` [Qemu-devel] [PATCH v15 16/21] replay: ptimer Pavel Dovgalyuk
2015-07-01 11:53 ` [Qemu-devel] [PATCH v15 17/21] typedef: add typedef for QemuOpts Pavel Dovgalyuk
2015-07-01 11:53 ` [Qemu-devel] [PATCH v15 18/21] replay: initialization and deinitialization Pavel Dovgalyuk
2015-07-01 11:53 ` [Qemu-devel] [PATCH v15 19/21] replay: replay blockers for devices Pavel Dovgalyuk
2015-07-01 11:53 ` [Qemu-devel] [PATCH v15 20/21] replay: command line options Pavel Dovgalyuk
2015-07-01 11:53 ` [Qemu-devel] [PATCH v15 21/21] replay: recording of the user input Pavel Dovgalyuk
2015-07-06 11:54 ` [Qemu-devel] [PATCH v15 00/21] Deterministic replay core Pavel Dovgaluk
2015-07-06 11:55   ` Paolo Bonzini
2015-07-06 11:59     ` Pavel Dovgaluk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150701115153.9832.96470.stgit@PASHA-ISP \
    --to=pavel.dovgaluk@ispras.ru \
    --cc=alex.bennee@linaro.org \
    --cc=batuzovk@ispras.ru \
    --cc=fred.konrad@greensocs.com \
    --cc=hines@cert.org \
    --cc=igor.rubinov@gmail.com \
    --cc=maria.klimushenkova@ispras.ru \
    --cc=mark.burton@greensocs.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=real@ispras.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.