From: "Jan Beulich" Subject: Re: [PATCH] xen: do not unmask disabled IRQ on eoi. Date: Mon, 18 Oct 2010 16:16:22 +0100 Message-ID: <4CBC80E6020000780001DC78@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> <4CBC1CF1020000780001DA3F@vpn.id2.novell.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: Stefano Stabellini Cc: Ian Campbell , "jeremy@goop.org" , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org >>> On 18.10.10 at 16:58, Stefano Stabellini wrote: > On Mon, 18 Oct 2010, Jan Beulich wrote: >> 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()). >=20 > This is only true for virqs because xen knows how to handle the case > when a pirq is already inflight. I don't think Xen knowing how to deal with that matters here. It won't send you a new notification if you would have got one before clearing the previous instance (and you didn't get another just because it was already/still pending). Or else I must be missing something. > Considering that this is the way the fasteoi handler is supposed to work > (no ack at the beginning, only at the end) I would keep fasteoi as pirq > handler and switch virqs to edge. > If you look at handle_edge_irq, the ack is always done at the beginning, > no eoi at the end but we don't need it for virqs. Mask and unmask are > done by the handler depending upon IRQ_INPROGRESS and IRQ_DISABLED. > It seems exactly the kind of thing we need as virq handler: we clear the > evtchn in ack and we mask and unmask the evtchn in mask and unmask. > The mapping of xen operations on the irq chip functions is very simple > and natural this way. While that all makes sense, one of the reasons to switch to fasteoi is because they get along with just a single indirect call. Edge one, the way you coded it, require three (which can be reduced to two when using the .mask_ack vector). Jan