qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Subject: [Qemu-devel] [PULL 48/52] i386: partial revert of interrupt poll fix
Date: Fri, 25 Sep 2015 18:51:36 +0200	[thread overview]
Message-ID: <1443199900-5003-3-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1443199900-5003-1-git-send-email-pbonzini@redhat.com>

From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>

Processing CPU_INTERRUPT_POLL requests in cpu_has_work functions
break the determinism of cpu_exec. This patch is required to make
interrupts processing deterministic.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Message-Id: <20150917162331.8676.15286.stgit@PASHA-ISP.def.inno>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 cpu-exec.c        |  9 +++++++++
 target-i386/cpu.c | 10 ++--------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/cpu-exec.c b/cpu-exec.c
index 947e646..8fd56a6 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -27,6 +27,9 @@
 #include "exec/address-spaces.h"
 #include "qemu/rcu.h"
 #include "exec/tb-hash.h"
+#if defined(TARGET_I386) && !defined(CONFIG_USER_ONLY)
+#include "hw/i386/apic.h"
+#endif
 
 /* -icount align implementation. */
 
@@ -343,6 +346,12 @@ int cpu_exec(CPUState *cpu)
     SyncClocks sc;
 
     if (cpu->halted) {
+#if defined(TARGET_I386) && !defined(CONFIG_USER_ONLY)
+        if (cpu->interrupt_request & CPU_INTERRUPT_POLL) {
+            apic_poll_irq(x86_cpu->apic_state);
+            cpu_reset_interrupt(cpu, CPU_INTERRUPT_POLL);
+        }
+#endif
         if (!cpu_has_work(cpu)) {
             return EXCP_HALTED;
         }
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index d2b6bc5..bd411b9 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -3098,14 +3098,8 @@ static bool x86_cpu_has_work(CPUState *cs)
     X86CPU *cpu = X86_CPU(cs);
     CPUX86State *env = &cpu->env;
 
-#if !defined(CONFIG_USER_ONLY)
-    if (cs->interrupt_request & CPU_INTERRUPT_POLL) {
-        apic_poll_irq(cpu->apic_state);
-        cpu_reset_interrupt(cs, CPU_INTERRUPT_POLL);
-    }
-#endif
-
-    return ((cs->interrupt_request & CPU_INTERRUPT_HARD) &&
+    return ((cs->interrupt_request & (CPU_INTERRUPT_HARD |
+                                      CPU_INTERRUPT_POLL)) &&
             (env->eflags & IF_MASK)) ||
            (cs->interrupt_request & (CPU_INTERRUPT_NMI |
                                      CPU_INTERRUPT_INIT |
-- 
2.5.0

  parent reply	other threads:[~2015-09-25 16:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25 16:51 [Qemu-devel] [PULL v2 00/52] Misc changes for 2015-09-25 Paolo Bonzini
2015-09-25 16:51 ` [Qemu-devel] [PULL 25/52] hmp: added io apic dump state Paolo Bonzini
2015-09-25 16:51 ` Paolo Bonzini [this message]
2015-09-25 16:51 ` [Qemu-devel] [PULL 49/52] i386: interrupt poll processing Paolo Bonzini
2015-09-25 16:51 ` [Qemu-devel] [PULL 50/52] typedef: add typedef for QemuOpts Paolo Bonzini
2015-09-28  6:23   ` Pavel Dovgaluk
2015-09-25 16:51 ` [Qemu-devel] [PULL 51/52] docs: describe the QEMU build system structure / design Paolo Bonzini
2015-09-25 16:51 ` [Qemu-devel] [PULL 52/52] doc: Refresh URLs in the qemu-tech documentation Paolo Bonzini
2015-09-25 22:11 ` [Qemu-devel] [PULL v2 00/52] Misc changes for 2015-09-25 Peter Maydell

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=1443199900-5003-3-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=pavel.dovgaluk@ispras.ru \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).