Received: from eggs.gnu.org ([2001:4830:134:3::10]:48577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUDnU-0006yC-Nx for qemu-devel@nongnu.org; Mon, 01 Aug 2016 10:02:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUDnO-0006y8-Pt for qemu-devel@nongnu.org; Mon, 01 Aug 2016 10:02:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37138) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUDnO-0006xx-Jj for qemu-devel@nongnu.org; Mon, 01 Aug 2016 10:02:18 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 08B5985A07 for ; Mon, 1 Aug 2016 14:02:18 +0000 (UTC) Date: Mon, 1 Aug 2016 22:02:14 +0800 From: Peter Xu Message-ID: <20160801140214.GE6207@pxdev.xzpeter.org> References: <1469974685-4144-1-git-send-email-peterx@redhat.com> <4b4dd69d-81fa-d74c-86a9-1723bbd23c95@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4b4dd69d-81fa-d74c-86a9-1723bbd23c95@redhat.com> Subject: Re: [Qemu-devel] [PATCH for 2.8?] x86: ioapic: ignore level irq during processing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, mst@redhat.com On Mon, Aug 01, 2016 at 12:58:42PM +0200, Paolo Bonzini wrote: > > > On 31/07/2016 16:18, Peter Xu wrote: > > For level triggered interrupts, we will get Remote IRR bit cleared after > > guest kernel finished processing specific request. Before that, we > > should ignore the same interrupt from triggering again. > > > > Signed-off-by: Peter Xu > > --- > > > > I discovered this during debugging some IR issues. Only did very > > minimum test with e1000, but IIUC this should be the correct behavior > > for level triggered interrupts, and before that we might be sending > > some extra interrupts to guest (while we should not). > > > > hw/intc/ioapic.c | 10 ++++++++-- > > 1 file changed, 8 insertions(+), 2 deletions(-) > > > > diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c > > index 2d3282a..350f761 100644 > > --- a/hw/intc/ioapic.c > > +++ b/hw/intc/ioapic.c > > @@ -129,9 +129,15 @@ static void ioapic_service(IOAPICCommonState *s) > > } > > continue; > > } > > -#else > > - (void)coalesce; > > #endif > > + > > + if (coalesce) { > > + /* We are level triggered interrupts, and the > > + * guest should be still working on previous one, > > + * so skip it. */ > > + continue; > > + } > > + > > /* No matter whether IR is enabled, we translate > > * the IOAPIC message into a MSI one, and its > > * address space will decide whether we need a > > > > The patch is okay for 2.7, as it matches what is done in the KVM > split-irqchip case. Cool. It'll be nice to have it in 2.7 as well. Thanks, -- peterx