All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, wrampazz@redhat.com, pavel.dovgalyuk@ispras.ru,
	ehabkost@redhat.com, alex.bennee@linaro.org, mtosatti@redhat.com,
	armbru@redhat.com, mreitz@redhat.com, stefanha@redhat.com,
	crosa@redhat.com, pbonzini@redhat.com, philmd@redhat.com,
	zhiwei_liu@c-sky.com, rth@twiddle.net
Subject: [PATCH v5 01/15] replay: don't record interrupt poll
Date: Tue, 22 Sep 2020 15:15:43 +0300	[thread overview]
Message-ID: <160077694335.10249.16333420401245362506.stgit@pasha-ThinkPad-X280> (raw)
In-Reply-To: <160077693745.10249.9707329107813662236.stgit@pasha-ThinkPad-X280>

Interrupt poll is not a real interrupt event. It is needed only for
thread safety. This interrupt is used for i386 and converted
to hardware interrupt by cpu_handle_interrupt function.
Therefore it is not needed to be recorded, because hardware
interrupt will be recorded after converting.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

--

v4 changes:
 - Condition check refactoring (suggested by Alex Bennée)
---
 accel/tcg/cpu-exec.c |   21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 66d38f9d85..c065b4cc77 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -429,8 +429,7 @@ static inline bool cpu_handle_halt(CPUState *cpu)
 {
     if (cpu->halted) {
 #if defined(TARGET_I386) && !defined(CONFIG_USER_ONLY)
-        if ((cpu->interrupt_request & CPU_INTERRUPT_POLL)
-            && replay_interrupt()) {
+        if (cpu->interrupt_request & CPU_INTERRUPT_POLL) {
             X86CPU *x86_cpu = X86_CPU(cpu);
             qemu_mutex_lock_iothread();
             apic_poll_irq(x86_cpu->apic_state);
@@ -526,6 +525,20 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret)
     return false;
 }
 
+/*
+ * CPU_INTERRUPT_POLL is a virtual event which gets converted into a
+ * "real" interrupt event later. It does not need to be recorded for
+ * replay purposes.
+ */
+static inline bool need_replay_interrupt(int interrupt_request)
+{
+#if defined(TARGET_I386)
+    return !(interrupt_request & CPU_INTERRUPT_POLL);
+#else
+    return true;
+#endif
+}
+
 static inline bool cpu_handle_interrupt(CPUState *cpu,
                                         TranslationBlock **last_tb)
 {
@@ -587,7 +600,9 @@ static inline bool cpu_handle_interrupt(CPUState *cpu,
            and via longjmp via cpu_loop_exit.  */
         else {
             if (cc->cpu_exec_interrupt(cpu, interrupt_request)) {
-                replay_interrupt();
+                if (need_replay_interrupt(interrupt_request)) {
+                    replay_interrupt();
+                }
                 /*
                  * After processing the interrupt, ensure an EXCP_DEBUG is
                  * raised when single-stepping so that GDB doesn't miss the



  reply	other threads:[~2020-09-22 12:17 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22 12:15 [PATCH v5 00/15] Reverse debugging Pavel Dovgalyuk
2020-09-22 12:15 ` Pavel Dovgalyuk [this message]
2020-09-22 12:57   ` [PATCH v5 01/15] replay: don't record interrupt poll Philippe Mathieu-Daudé
2020-09-22 12:15 ` [PATCH v5 02/15] replay: provide an accessor for rr filename Pavel Dovgalyuk
2020-09-22 12:58   ` Philippe Mathieu-Daudé
2020-09-22 12:15 ` [PATCH v5 03/15] qcow2: introduce icount field for snapshots Pavel Dovgalyuk
2020-09-22 12:16 ` [PATCH v5 04/15] migration: " Pavel Dovgalyuk
2020-09-22 12:16 ` [PATCH v5 05/15] qapi: introduce replay.json for record/replay-related stuff Pavel Dovgalyuk
2020-09-22 12:16 ` [PATCH v5 06/15] replay: introduce info hmp/qmp command Pavel Dovgalyuk
2020-09-22 12:16 ` [PATCH v5 07/15] replay: introduce breakpoint at the specified step Pavel Dovgalyuk
2020-09-22 12:16 ` [PATCH v5 08/15] replay: implement replay-seek command Pavel Dovgalyuk
2020-09-22 12:16 ` [PATCH v5 09/15] replay: flush rr queue before loading the vmstate Pavel Dovgalyuk
2020-09-22 12:16 ` [PATCH v5 10/15] gdbstub: add reverse step support in replay mode Pavel Dovgalyuk
2020-09-22 12:16 ` [PATCH v5 11/15] gdbstub: add reverse continue " Pavel Dovgalyuk
2020-09-22 12:16 ` [PATCH v5 12/15] replay: describe reverse debugging in docs/replay.txt Pavel Dovgalyuk
2020-09-22 12:16 ` [PATCH v5 13/15] docs: convert replay.txt to rst Pavel Dovgalyuk
2020-09-22 13:13   ` Paolo Bonzini
2020-09-23  6:22     ` Pavel Dovgalyuk
2020-09-22 12:16 ` [PATCH v5 14/15] replay: create temporary snapshot at debugger connection Pavel Dovgalyuk
2020-09-22 12:55   ` Philippe Mathieu-Daudé
2020-09-22 13:15     ` Philippe Mathieu-Daudé
2020-09-22 12:17 ` [PATCH v5 15/15] tests/acceptance: add reverse debugging test Pavel Dovgalyuk
2020-09-22 12:52   ` Philippe Mathieu-Daudé
2020-09-22 18:48 ` [PATCH v5 00/15] Reverse debugging no-reply
2020-09-22 18:53 ` no-reply

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=160077694335.10249.16333420401245362506.stgit@pasha-ThinkPad-X280 \
    --to=pavel.dovgalyuk@ispras.ru \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanha@redhat.com \
    --cc=wrampazz@redhat.com \
    --cc=zhiwei_liu@c-sky.com \
    /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.