From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH] evtchn: simplify sending of notifications Date: Mon, 12 Jan 2015 11:42:56 +0000 Message-ID: <54B3C1500200007800053B09@mail.emea.novell.com> References: <54B39A7C020000780005382E@mail.emea.novell.com> <54B3B0FB.7050209@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YAdOe-0001BF-QW for xen-devel@lists.xenproject.org; Mon, 12 Jan 2015 11:43:00 +0000 In-Reply-To: <54B3B0FB.7050209@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Ian Campbell , xen-devel , Keir Fraser , IanJackson , Tim Deegan List-Id: xen-devel@lists.xenproject.org >>> 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. > 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(). Jan