Skip to contentSkip to conversation

kvm: qemu: ppc: Fix for lost

PATCH New Hollis Blanchard 1 participant 1 message Apr 30, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm: qemu: ppc: Fix for lost

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.

qemu/qemu-kvm-powerpc.c +7 -4
@@ -168,11 +168,11 @@ int kvm_arch_try_push_interrupts(void *o
     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 *o
                 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-ppc-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel