From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 03/12] Remove KVM_REQ_PENDING_TIMER. Date: Wed, 02 Dec 2009 16:22:23 +0200 Message-ID: <4B16781F.5080508@redhat.com> References: <1259678201-11203-1-git-send-email-clalance@redhat.com> <1259678201-11203-4-git-send-email-clalance@redhat.com> <4B1568AF.6010100@siemens.com> <4B1664BD.7040201@redhat.com> <4B1676D5.8070209@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: Jan Kiszka , kvm@vger.kernel.org To: Chris Lalancette Return-path: Received: from mx1.redhat.com ([209.132.183.28]:60538 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753135AbZLBOWT (ORCPT ); Wed, 2 Dec 2009 09:22:19 -0500 In-Reply-To: <4B1676D5.8070209@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 12/02/2009 04:16 PM, Avi Kivity wrote: > >> 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. > > We shouldn't have that bit at all. > > An alternative is to make the pic/ioapic work in irq context > (spin_lock_irq() and friends) and queue the interrupt directly from > the hrtimer instead of the vcpu. My worry is that we have quite a bit > of work to do in irq context if the interrupt is broadcast and if we > have many vcpus; maybe we can use a work_struct in that case. > er, you do that later on. In this case nothing blocks the removal of the bit - if the timer causes an interrupt to be injected, then the lapic/irq code will send an IPI to the vcpu to cause it to resample. See __apic_accept_irq() in lapic.c calling kvm_vcpu_kick(), for example. The only issue is the ordering of the patches, you can only remove KVM_REQ_PENDING_TIMER after rearranging interrupt injection to happen inline. -- error compiling committee.c: too many arguments to function