[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v17 01/21] i386: partial revert of interrupt poll fi
From: |
Pavel Dovgalyuk |
Subject: |
[Qemu-devel] [PATCH v17 01/21] i386: partial revert of interrupt poll fix |
Date: |
Mon, 07 Sep 2015 11:40:14 +0300 |
User-agent: |
StGit/0.16 |
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 <address@hidden>
Signed-off-by: Pavel Dovgalyuk <address@hidden>
---
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 6b6942d..1f8046f 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -28,6 +28,9 @@
#include "exec/memory-internal.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. */
@@ -369,6 +372,12 @@ int cpu_exec(CPUState *cpu)
volatile bool have_tb_lock = false;
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 cfb8aa7..3d2e2f0 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 |
- [Qemu-devel] [PATCH v17 00/21] Deterministic replay core, Pavel Dovgalyuk, 2015/09/07
- [Qemu-devel] [PATCH v17 01/21] i386: partial revert of interrupt poll fix,
Pavel Dovgalyuk <=
- [Qemu-devel] [PATCH v17 02/21] replay: global variables and function stubs, Pavel Dovgalyuk, 2015/09/07
- [Qemu-devel] [PATCH v17 03/21] replay: internal functions for replay log, Pavel Dovgalyuk, 2015/09/07
- [Qemu-devel] [PATCH v17 04/21] replay: introduce mutex to protect the replay log, Pavel Dovgalyuk, 2015/09/07
- [Qemu-devel] [PATCH v17 05/21] replay: introduce icount event, Pavel Dovgalyuk, 2015/09/07
- [Qemu-devel] [PATCH v17 06/21] cpu-exec: allow temporary disabling icount, Pavel Dovgalyuk, 2015/09/07
- [Qemu-devel] [PATCH v17 07/21] cpu: replay instructions sequence, Pavel Dovgalyuk, 2015/09/07
- [Qemu-devel] [PATCH v17 08/21] i386: interrupt poll processing, Pavel Dovgalyuk, 2015/09/07
- [Qemu-devel] [PATCH v17 09/21] replay: interrupts and exceptions, Pavel Dovgalyuk, 2015/09/07
- [Qemu-devel] [PATCH v17 10/21] replay: asynchronous events infrastructure, Pavel Dovgalyuk, 2015/09/07
- [Qemu-devel] [PATCH v17 11/21] replay: recording and replaying clock ticks, Pavel Dovgalyuk, 2015/09/07