From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: [PATCH 4/5] xen: events, exposes evtchn_alloc_unbound_domain Date: Thu, 9 Aug 2012 11:35:57 +0100 Message-ID: <20120809103557.GA17503@ocelot.phlegethon.org> References: <1344023454-31425-1-git-send-email-jean.guyader@citrix.com> <1344023454-31425-5-git-send-email-jean.guyader@citrix.com> <20120809100605.GC16986@ocelot.phlegethon.org> <1344507826.32142.116.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1344507826.32142.116.camel@zakaz.uk.xensource.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: Ian Campbell Cc: "Jean Guyader (3P)" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org At 11:23 +0100 on 09 Aug (1344511426), Ian Campbell wrote: > On Thu, 2012-08-09 at 11:06 +0100, Tim Deegan wrote: > > At 20:50 +0100 on 03 Aug (1344027053), Jean Guyader wrote: > > > > > > Exposes evtchn_alloc_unbound_domain to the rest of > > > Xen so we can create allocated unbound evtchn within Xen. > > > > > > Signed-off-by: Jean Guyader > > > > > @@ -161,18 +163,18 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc) > > > { > > > struct evtchn *chn; > > > struct domain *d; > > > - int port; > > > + evtchn_port_t port; > > > domid_t dom = alloc->dom; > > > - long rc; > > > + int rc; > > > > The function returns long; if you're tidying this up to be an int, might > > as well change the return type too. > > I'm not sure if this is relevant but Jan just sent a patch to "make all > (native) hypercalls consistently have "long" return type". I > think/suspect this rc here turns into the result of the hypercall? > > Jan's patch was motivated by something to do with sign extension when a > hypercall's int return is written to the long in the multicall arg > struct which causes strangeness. Perhaps not totally relevant to > evtchn_alloc which is unlikely to be in a MC. Yes, this eventually ends up in a hypercall handler, but s/long/int/ here doesn't cause problems because - rc is only ever set to an 'int' value here so we can't lose data from the type being too narrow; and - Those int values get cast up to long (either in here or in the caller) directly, which will sign-extend the. It really doesn't matter whether this function returns an int or a long, but it's a bit untidy to change it half-way. Tim.