diff mbox

[RFC,v5,22/31] timer: introduce new QEMU_CLOCK_VIRTUAL_RT clock

Message ID 5477570C.70607@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini Nov. 27, 2014, 4:53 p.m. UTC
On 27/11/2014 10:11, Pavel Dovgaluk wrote:
> When POLL interrupt request is processed by x86_cpu_exec_interrupt function, as it were before,
> everything is ok, because I ensure that these calls occur at the same moments in record/replay.

Does this partial revert work?

Paolo

Comments

Pavel Dovgalyuk Nov. 28, 2014, 7:52 a.m. UTC | #1
> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> On 27/11/2014 10:11, Pavel Dovgaluk wrote:
> > When POLL interrupt request is processed by x86_cpu_exec_interrupt function, as it were
> before,
> > everything is ok, because I ensure that these calls occur at the same moments in
> record/replay.
> 
> Does this partial revert work?

This one is better because I can place synchronization point for replay here.

Pavel Dovgalyuk

> 
> Paolo
> 
> diff --git a/cpu-exec.c b/cpu-exec.c
> index 3913de0..c976095 100644
> --- a/cpu-exec.c
> +++ b/cpu-exec.c
> @@ -331,6 +331,12 @@ int cpu_exec(CPUArchState *env)
>      volatile bool have_tb_lock = false;
> 
>      if (cpu->halted) {
> +#ifdef TARGET_I386
> +        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 e9df33e..3f13dfe 100644
> --- a/target-i386/cpu.c
> +++ b/target-i386/cpu.c
> @@ -2912,14 +2912,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 |
diff mbox

Patch

diff --git a/cpu-exec.c b/cpu-exec.c
index 3913de0..c976095 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -331,6 +331,12 @@  int cpu_exec(CPUArchState *env)
     volatile bool have_tb_lock = false;
 
     if (cpu->halted) {
+#ifdef TARGET_I386
+        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 e9df33e..3f13dfe 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -2912,14 +2912,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 |