[EMAIL PROTECTED] wrote:
> Incorporates v8 plus the following changes:
> 
> 1) Fix for hang on AMD
> 2) Fixes issue where irq-windows are inaccurately reported to
> userspace 3) Fixed issue where irq-window-exiting requests can be
> ignored in some cases
> 
> Note that we no longer need the backlog.patch to handle a
> corner cases now.
> 
> As before, this has been tested on 32 bit XP w/ACPI and 64 bit
> windows.  It offers a 17% performance improvement over git HEAD in my
> testing.  Note that I
> am not able to fully verify that this works on AMD, as even
> git-head does not
> work on my system.  I am able to verify that it no longer
> hangs the kernel
> hard.  The guest hangs, but it hangs without my patches as
> well.  Perhaps
> someone with a known good environment on AMD can verify for me?
> 
> I am being pulled off of my KVM work for a little while, so I
> will not be able
> to contribute again until further notice. If there are any
> remaining issues
> that need to be addressed and someone wants to carry the
> torch, feel free to
> do so.  Otherwise, I will pick up the effort to get this
> merged in when I am
> able to return to KVM.
> 
> Thanks all for the feedback/comments/suggestions through all
> of this.  It has
> been very fun and quite a learning experience.
> 
Greg:
        Here are some detail comments towarding the LAPIC device model.
        1: irqabstraction layer
        vcpu->irq.pending holds the abstract processor interrupt request
(called localint, extint, nmi etc in V09).  But API kvm_vcpu_intr only
set the interrupt request, no clear.  So far I only noticed when an
interrupt request is pop or injected,  vcpu->irq.pending bit may be
cleared. But there is case when guest raise TPR bar, an localint could
be cleared. Same for extint when PIC IMR is masked. 
        In Xen, since there is no notion of abstract processor interrupt
request, VMM check interrupt directly from PIC and APIC, so Xen doesn't
have problem. I guess Windows will fail here.

        2: APIC timer
        a: V09 uses hrtimer for LAPIC timer, apic->timer.last_update is
updated every time when __apic_timer_fn is invoked at time of the APIC
timer fired. This impose an accumulated difference since the fire time
is already some ns later after expected time.
        Xen solve this issue by increase apic->timer.last_update with
the PERIOD, i.e. APIC_BUS_CYCLE_NS * apic->timer.divide_count *
APIC_TMICT.
        b: Seems current approach starts hrtimer whenever APIC_TMICT is
updated. Should we check APIC_LVT to see if it is masked here? (instead
of doing in its callback function:__apic_timer_fn). Also why APIC_TMCCT
is updated here? I think TMCCT is reloaded only when it reaches 0 and
LVTT works in periodic mode.
        c: I didn't see LVTT mask status refelect the hrtimer
cancel/start, do I miss something?

        3:  Assume a senario there is an valid IDT_VECTORING_INFO_FIELD,
following code(after patch) in handle_exception push back the failed
interrupt vector, i.e. vcpu->irq.deferred.

........
        if (is_external_interrupt(vect_info)) {
                /*
                 * An exception was taken while we were trying to inject
an
                 * IRQ.  We must defer the injection of the vector until
                 * the next window.
                 */
                int irq = vect_info & VECTORING_INFO_VECTOR_MASK;
                kvm_vcpu_irq_push(vcpu, irq);
        }


        a:  Now, the abstracted processor interrupt, i.e.
vcpu->irq.pending, could be 0, __kvm_vcpu_irq_pending invoked at
beginning of do_interrupt_requests will set kvm_irqpin_localint in the
abstracted processor interrupt (vcpu->irq.pending). But if at same time,
we get an external IRQ, i.e. vcpu->irq.pending is set with both localint
& extint.
        From following code , kvm_irqpin_extint has higher priority than
kvm_irqpin_localint.

        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;
                ..............

        Now in do_intr_requests, we get an extirq vector instead of
vcpu->irq.deferred from following code since pin=kvm_irqpin_extint. That
means we inject an new irq instead of original failed irq in
IDT_VECTORING_INFO_FIELD.

                ........
                switch (pin) {
                case kvm_irqpin_localint:
                        r = kvm_vcpu_irq_pop(vcpu, &ack);
                        break;
                case kvm_irqpin_extint:
                        r = kvm_irqdevice_ack(&vcpu->kvm->isa_irq, 0,
&ack);
                        if (!(ack.flags &
KVM_IRQACKDATA_VECTOR_PENDING))
                                __clear_bit(pin, &vcpu->irq.pending);
                        break;
                case kvm_irqpin_nmi:


        Anyway due to SMP & in-kernel APIC, I'd like to suggest we move
IDT_VECTORING_INFO_FIELD to do_interrupt_requests like vmx_intr_assist
in Xen where physical IRQ is disabled.



thx, eddie

-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to