>>>+static void do_interrupt_requests(struct kvm_vcpu *vcpu,
>>>+                              struct kvm_run *kvm_run)
>>>+{
>>>+    int pending = __kvm_vcpu_irq_all_pending(vcpu);
>>>+
>>>+    clear_pending_controls(vcpu);
>>>+
>>>+    while (pending) {
>>>+            kvm_irqpin_t pin = __fls(pending);
>>>+
>>>+            switch (pin) {
>>>+            case kvm_irqpin_localint:
>>>+            case kvm_irqpin_extint:
>>>+            case kvm_irqpin_nmi:
>>>+                    do_intr_requests(vcpu, kvm_run, pin);
>>>+                    break;
>>>+            case kvm_irqpin_smi:
>>>+                    /* ignored (for now) */
>>>+                    printk(KERN_WARNING "KVM: dropping unhandled
>> SMI\n");
>>>+                    __clear_bit(pin, &vcpu- >irq.pending);
>>>+                    break;
>>>+            case kvm_irqpin_invalid:
>>>+                    /* drop */
>>>+                    break;
>>>+            default:
>>>+                    panic("KVM: unknown interrupt pin raised: %d\n",
>> pin);
>>>+                    break;
>>>+            }
>>>+
>>>+            __clear_bit(pin, &pending);
>>>+    }
>>> }
>>
>>
>> Seems like you can inject several irq at once using the above while
>> loop, but you only do one push in case external interrupt got in the
way
>> and prevented the injection.
>
>I didn't quite understand what you were getting at with the comments
about
>the external interrupts getting in the way, but I think the gist of
your
>comment is "is this broken to push more than one interrupt?"
>
>If so, the answer is that we only ever push one interrupt at a time,
but we
>run through each pending pin to give each handler (do_intr_requests,
and
>later, do_nmi_requests/do_smi_requests) an opportunity to update the
>PENDING/WINDOW type flags.
>
>For instance (this is based on the entire patch series, which includes
the
>NMI work) if both an NMI and localint are pending, the NMI will get
>injected, and the localint will set the IRQ_WINDOW_EXITING feature.
>
>That is the intention, anyway.  I understand VMX much better than SVN,
so
>theres a good chance I flubbed this up.  ;)  Let me know if you see
>anything that differs from what i described.


Ahh, I got it now, I missed that the next irq source won't be injected.
Thanks for clearing this out for me.
I wonder if VMX or SVM have an option of injecting several virq at once.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to