From: "Jan Beulich" Subject: Re: [PATCH] xen: do not unmask disabled IRQ on eoi. Date: Mon, 18 Oct 2010 09:09:53 +0100 Message-ID: <4CBC1CF1020000780001DA3F@vpn.id2.novell.com> References: <1287139966-19391-2-git-send-email-ian.campbell@citrix.com> <1287160335.2003.7973.camel@zakaz.uk.xensource.com> <1287160787.2003.7979.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Campbell , Stefano Stabellini Cc: "jeremy@goop.org" , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org >>> On 15.10.10 at 19:03, Stefano Stabellini wrote: > @@ -1074,9 +1081,6 @@ static void __xen_evtchn_do_upcall(struct = pt_regs=20 > *regs) > int irq =3D evtchn_to_irq[port]; > struct irq_desc *desc; > =20 > - mask_evtchn(port); > - clear_evtchn(port); > - > if (irq !=3D -1) { > desc =3D irq_to_desc(irq); > if (desc) > @@ -1202,7 +1206,7 @@ static void ack_dynirq(unsigned int irq) > move_masked_irq(irq); > =20 > if (VALID_EVTCHN(evtchn)) > - unmask_evtchn(evtchn); > + clear_evtchn(evtchn); > } > =20 > static int retrigger_irq(unsigned int irq) These two hunks together don't look right, for two reasons: First, ack_dynirq() is used as both .eoi and .ack, but those certainly have different requirements (and this might have been a problem already before, though I didn't spend much thought on what may go wrong). Second, clearing the event channel in the .eoi handler after it wasn't masked while being handled has the potential of losing an event (if it got raised between the IRQ handler checking relevant state and the execution of clear_evtchn()). Jan