From: Konrad Rzeszutek Wilk Subject: Re: [PATCH] dpci: Put the dpci back on the list if scheduled from another CPU. Date: Wed, 18 Mar 2015 12:14:58 -0400 Message-ID: <20150318161458.GB15158@x230.dumpdata.com> References: <1426606715-18018-1-git-send-email-konrad.wilk@oracle.com> <55085F06020000780006B053@mail.emea.novell.com> <20150317171537.GA4101@l.oracle.com> <55093974020000780006B1CF@mail.emea.novell.com> <20150318135856.GC13965@x230.dumpdata.com> <5509B09D020000780006B47F@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YYGcc-0005xO-VL for xen-devel@lists.xenproject.org; Wed, 18 Mar 2015 16:15:07 +0000 Content-Disposition: inline In-Reply-To: <5509B09D020000780006B47F@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Wed, Mar 18, 2015 at 04:06:37PM +0000, Jan Beulich wrote: > >>> On 18.03.15 at 14:58, wrote: > > On Wed, Mar 18, 2015 at 07:38:12AM +0000, Jan Beulich wrote: > >> >>> On 17.03.15 at 18:15, wrote: > >> > The latest one (please see attached) would cause an dead-lock iff > >> > on the CPU we are running the softirq and an do_IRQ comes for the > >> > exact dpci we are in process of executing. > >> > >> I'm afraid I'm not seeing it - please explain. > > > > Lets assume that the device is an PCIe with MSI. We have only one > > VCPU in the guest. > > > > We receive the first interrupt, end up going: > > vmx_vmexit_handler > > - case EXIT_REASON_EXTERNAL_INTERRUPT > > \- vmx_do_extint > > \- do_IRQ > > \- __do_IRQ_guest > > \- hvm_do_IRQ_dpci > > \- raise_softirq_for > > [DPCI_SOFTIRQ bit set] > > vmx_process_softirq > > sti > > do_softirq > > -\ __do_sofitq_ > > \- dpci_softirq > > -\ hvm_dirq_assist > > [state is 'running'] > > > > [Same vector comes in] > > Is that indeed possible? Afaict nothing in the code sequence above > ack-ed the interrupt, and hence another one can't come in. The do_IRQ acks it: 854 spin_lock(&desc->lock); 855 desc->handler->ack(desc); which is: 424 static void ack_maskable_msi_irq(struct irq_desc *desc) 425 { 426 ack_nonmaskable_msi_irq(desc); 427 ack_APIC_irq(); /* ACKTYPE_NONE */ 428 } .. snip.. 857 if ( likely(desc->status & IRQ_GUEST) ) .. 886 __do_IRQ_guest(irq); > > Jan >