From: Tim Deegan Subject: Re: [PATCH v8 10/14] xen/common: move the memory_mapping DOMCTL hypercall to common code Date: Thu, 5 Jun 2014 16:33:53 +0200 Message-ID: <20140605143353.GB8661@deinos.phlegethon.org> References: <1401015115-7610-1-git-send-email-avanzini.arianna@gmail.com> <1401015115-7610-11-git-send-email-avanzini.arianna@gmail.com> <53821D7F.4040701@linaro.org> <53832E940200007800015AED@mail.emea.novell.com> <53831F8A.8060604@linaro.org> <1401978088.15729.110.camel@hastur.hellion.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1401978088.15729.110.camel@hastur.hellion.org.uk> 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: julien.grall@citrix.com, paolo.valente@unimore.it, keir@xen.org, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, dario.faggioli@citrix.com, Julien Grall , Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org, Ian.Campbell@eu.citrix.com, etrudeau@broadcom.com, Jan Beulich , Arianna Avanzini , viktor.kleinik@globallogic.com List-Id: xen-devel@lists.xenproject.org At 15:21 +0100 on 05 Jun (1401978088), Ian Campbell wrote: > On Mon, 2014-05-26 at 12:03 +0100, Julien Grall wrote: > > In any case, I don't think we should expose mfn_t and _mfn to ARM. All > > the P2M interface used in common code, take an unsigned long in parameter. > > I don't object in principal to the idea that common code should be > moving towards more semantic types (i.e. mfn_t rather than unsigned > long) in general. Or even to going as far as x86 has done in the common > code and having mfn_t be more than a typedef (it's a wrapping struct for > type safety), which results in the _mfn() and mfn_x() conversion things. > > But I don't think we should be making that transition as part of this > series. > > I think the right answer here and now is for map_mmio_regions to take > the mfn as an unsigned long and for the wrapping into a mfn_t to happen > in the x86-specific implementation of map_mmio_regions etc. +1. > That would also get rid of this sort of thing from the previous patch: > _mfn(mfn_x(mfn) + i)) > > If someone wants to come along later and "type-safe-up" the common code > too, well, lets think about that then... Sure. I think it would be a good idea in general to extend those type-safe conventions, but no hurry to do it here. Incidentally, I'd be _delighted_ if anyone can suggest a way of making mfn_t and gfn_t distinct types (i.e. that the compiler won't silently cast to/from other types) without requiring the _mfn/mfn_x ugliness. Tim.