Re: [PATCH 03/12] Remove KVM_REQ_PENDING_TIMER.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/01/2009 08:04 PM, Jan Kiszka wrote:
> Chris Lalancette wrote:
>> KVM_REQ_PENDING_TIMER is set and cleared in a couple of places,
>> but it never seems to be actually checked.  Remove it.
>>
> 
> I would suggest to study the introducing commit
> 06e05645661211b9eaadaf6344c335d2e80f0ba2. My strong feeling is that this
> removal is wrong.

Ah, thanks.  Now I see what you mean.  In newer KVM, if you are in
__vcpu_run() and are in the while (r > 0) loop, after you've
done kvm_inject_pending_timer_irqs(), but before you do the next
__vcpu_run() (and hence disabled local IRQs), you could receive an
hrtimer callback.  In that case I guess you would hit the 
if (vcpu->requests || need_resched() || signal_pending()) test, don't
inject the interrupt, and possibly spend a long time in the guest
before an unrelated event causes the exit and hence causes the timer
injection.

Well, that certainly is a bit subtle :).  I think I might submit a
patch to at least put a comment in vcpu_enter_guest() about this.

Unfortunately, this does sort of put a damper on what's going on later
in the series.  If the i8254 doesn't belong to the BSP (which it really
shouldn't), then I don't know which vcpu to raise the bit on.  Maybe I
can do it in the kvm_irq_delivery_to_apic() function, or
kvm_apic_set_irq().  I'll take a look at that.

Thanks again for the review,
-- 
Chris Lalancette
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux