From: Hollis Blanchard <[EMAIL PROTECTED]>

In addition to env->interrupt_request, PowerPC qemu tracks device interrupts in
env->irq_input_state. As long as irq_input_state is set, interrupt_request will
not be updated. Since we clear CPU_INTERRUPT_HARD, and it's never re-enabled,
we end up delivering only one interrupt.

Signed-off-by: Hollis Blanchard <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>

diff --git a/qemu/qemu-kvm-powerpc.c b/qemu/qemu-kvm-powerpc.c
index fdb72f3..ec50e4c 100644
--- a/qemu/qemu-kvm-powerpc.c
+++ b/qemu/qemu-kvm-powerpc.c
@@ -168,11 +168,11 @@ int kvm_arch_try_push_interrupts(void *opaque)
     int r;
     unsigned irq;
 
+    /* PowerPC Qemu tracks the various core input pins (interrupt, critical
+     * interrupt, reset, etc) in PPC-specific env->irq_input_state. */
     if (env->ready_for_interrupt_injection &&
-        (env->interrupt_request & CPU_INTERRUPT_HARD))
+        (env->irq_input_state & (1<<PPC40x_INPUT_INT)))
        {
-            env->interrupt_request &= ~CPU_INTERRUPT_HARD;
-
             /* For now KVM disregards the 'irq' argument. However, in the
              * future KVM could cache it in-kernel to avoid a heavyweight exit
              * when reading the UIC.
@@ -184,7 +184,10 @@ int kvm_arch_try_push_interrupts(void *opaque)
                 printf("cpu %d fail inject %x\n", env->cpu_index, irq);
     }
 
-    return (env->interrupt_request & CPU_INTERRUPT_HARD) != 0;
+    /* We don't know if there are more interrupts pending after this. However,
+     * the guest will return to userspace in the course of handling this one
+     * anyways, so we will get a chance to deliver the rest. */
+    return 0;
 }
 
 void kvm_arch_update_regs_for_sipi(CPUState *env)

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
kvm-commits mailing list
kvm-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-commits

Reply via email to