From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] evtchn: simplify sending of notifications Date: Mon, 12 Jan 2015 16:01:34 +0000 Message-ID: <54B3EFDE.40408@citrix.com> References: <54B39A7C020000780005382E@mail.emea.novell.com> <54B3B0FB.7050209@citrix.com> <54B3C1500200007800053B09@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 1YAhR2-00048y-Ol for xen-devel@lists.xenproject.org; Mon, 12 Jan 2015 16:01:44 +0000 In-Reply-To: <54B3C1500200007800053B09@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: Ian Campbell , xen-devel , Keir Fraser , IanJackson , Tim Deegan List-Id: xen-devel@lists.xenproject.org On 12/01/15 11:42, Jan Beulich wrote: >>>> On 12.01.15 at 12:33, wrote: >> On 12/01/15 08:57, Jan Beulich wrote: >>> --- a/xen/include/xen/event.h >>> +++ b/xen/include/xen/event.h >>> @@ -152,10 +152,11 @@ static inline void evtchn_port_init(stru >>> d->evtchn_port_ops->init(d, evtchn); >>> } >>> >>> -static inline void evtchn_port_set_pending(struct vcpu *v, >>> +static inline void evtchn_port_set_pending(struct domain *d, >>> + unsigned int vcpu_id, >>> struct evtchn *evtchn) >> I would rename this to the, now vacant, evtchn_set_pending(). It takes >> an evtchn* not a port. (Its sole caller was evtchn_set_pending(), so >> the patch won't grow) > No (and I had actually considered it) - that would get its name out of > sync with all its sibling wrappers. Ah yes - consistency is more important than correctness here. > >> Furthermore, all callers except send_guest_vcpu_virq() currently use >> evtchn->notify_vcpu_id to get a struct vcpu* to pass. I think you can >> drop the vcpu_id parameter and use evtchn->notify_vcpu_id directly, >> which reduces the likelyhood of a bug where the evtchn is bound to one >> vcpu but a caller gets the wrong id and raises the event channel on the >> wrong vcpu. > Generally a nice idea, but it doesn't immediately/obviously fit with > the use in send_guest_vcpu_virq(). It is awkward that some of the virqs will get delivered on an arbitrary vcpu, especially as the virq API requires the binding domain to choose a destination vcpu. Either way, this is not something to be addressed in a cleanup patch. Therefore the original patch is Reviewed-by: Andrew Cooper ~Andrew