From: Ian Campbell Subject: Re: [PATCH 1/4] move XENMEM_add_to_physmap handling framework to common code Date: Fri, 20 Dec 2013 09:55:50 +0000 Message-ID: <1387533350.17289.23.camel@kazak.uk.xensource.com> References: <52B1BF76020000780010EC02@nat28.tlf.novell.com> <52B1C08C020000780010EC1F@nat28.tlf.novell.com> <1387389158.28680.99.camel@kazak.uk.xensource.com> <52B4047A020000780010F5BA@nat28.tlf.novell.com> <1387529937.1025.54.camel@dagon.hellion.org.uk> <52B4180C020000780010F683@nat28.tlf.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 1VtwoG-0003LG-27 for xen-devel@lists.xenproject.org; Fri, 20 Dec 2013 09:55:56 +0000 In-Reply-To: <52B4180C020000780010F683@nat28.tlf.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: xen-devel , Tim Deegan , Keir Fraser , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Fri, 2013-12-20 at 09:12 +0000, Jan Beulich wrote: > >>> On 20.12.13 at 09:58, Ian Campbell wrote: > > On Fri, 2013-12-20 at 07:48 +0000, Jan Beulich wrote: > >> >>> On 18.12.13 at 18:52, Ian Campbell wrote: > >> > On Wed, 2013-12-18 at 14:34 +0000, Jan Beulich wrote: > >> >> There's really nothing really architecture specific here; the > >> >> architecture specific handling is limited to > >> >> xenmem_add_to_physmap_one(). > >> >> > >> >> Note that ARM's restriction of XENMAPSPACE_gmfn_foreign only being > >> >> supported through XENMEM_add_to_physmap_range is being dropped as being > >> >> pointless. > >> > > >> > It's not pointless, dropping this restriction turns a comprehensible > >> > EINVAL result into an incorrect ESRCH result. Which is incorrect because > >> > no domain was specified so how can it not exist. > >> > >> How can there have been no domain specified for a > >> XENMAPSPACE_gmfn_foreign? > > > > The arguments to XENMEM_add_to_physmap have no field which specifies a > > foreign domain. (this is one of the reasons we added the _range version > > with the field in the first place). > > > > The domid parameter to add_to_physmap one is why hardcoded to > > DOMID_INVALID in all the add_to_physmap (!range) cases. > > > >> If the field was left uninitialized, > >> -ESRCH would be as valid as -EINVAL, and I don't think we > >> specify for any hypercall that between multiple applicable > >> error code a specific one would be preferred over others. > > > > I think given the above -ESRCH is invalid, since there is no field to > > have been left uninitialised. > > Oh, I finally understand. The thing that mainly confused me here > is the wording of the original comment: "Foreign mapping is only > supported by add_to_physmap_range". Whereas it should have > said "Foreign mapping is only possible through > add_to_physmap_range". I'll re-add that with the adjusted > comment. Yes, thanks. > Will that make the patch acceptable to you? I believe so, yes, I'll look at v3 ASAP. Ian.