From: Tim Deegan Subject: Re: [PATCH 04 of 18] x86/mm: Update mem sharing interface to (re)allow sharing of grants Date: Thu, 8 Dec 2011 22:20:24 +0000 Message-ID: <20111208222024.GF87836@ocelot.phlegethon.org> References: <2e8d5702f4c17d0af9f3.1323330439@xdev.gridcentric.ca> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <2e8d5702f4c17d0af9f3.1323330439@xdev.gridcentric.ca> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Andres Lagar-Cavilla Cc: xen-devel@lists.xensource.com, ian.campbell@citrix.com, andres@gridcentric.ca, keir.xen@gmail.com, JBeulich@suse.com, ian.jackson@citrix.com, adin@gridcentric.ca List-Id: xen-devel@lists.xenproject.org Hi, At 02:47 -0500 on 08 Dec (1323312439), Andres Lagar-Cavilla wrote: > + if ( XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF(mec->u.share.client_gfn) ) > + { > + grant_ref_t gref = (grant_ref_t) > + (XEN_DOMCTL_MEM_SHARING_FIELD_GET_GREF( > + mec->u.share.client_gfn)); > + if ( (!source_is_gref) || > + (mem_sharing_gref_to_gfn(cd, gref, &cgfn) < 0) ) > + { > + put_domain(cd); > + return -EINVAL; > + } > + } else { > + if ( source_is_gref ) > + { > + put_domain(cd); > + return -EINVAL; > + } Why can't one input be a grant and the other not? If there's a problem with that it should probably be documented in the hypercall interface. Cheers, Tim.