From: Ian Campbell Subject: Re: [RFC PATCH v2 2/3] arch, arm: add the XEN_DOMCTL_memory_mapping hypercall Date: Thu, 13 Mar 2014 15:57:18 +0000 Message-ID: <1394726238.25873.126.camel@kazak.uk.xensource.com> References: <1394439953-5723-1-git-send-email-avanzini.arianna@gmail.com> <1394439953-5723-3-git-send-email-avanzini.arianna@gmail.com> <1394724552.25873.106.camel@kazak.uk.xensource.com> <5321DE870200007800123CE6@nat28.tlf.novell.com> <1394725906.4159.28.camel@Solace> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1394725906.4159.28.camel@Solace> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli Cc: paolo.valente@unimore.it, Keir Fraser , stefano.stabellini@eu.citrix.com, Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org, julien.grall@citrix.com, etrudeau@broadcom.com, Jan Beulich , Arianna Avanzini , viktor.kleinik@globallogic.com List-Id: xen-devel@lists.xenproject.org On Thu, 2014-03-13 at 16:51 +0100, Dario Faggioli wrote: > On gio, 2014-03-13 at 15:36 +0000, Jan Beulich wrote: > > >>> On 13.03.14 at 16:29, Ian Campbell wrote: > > > > "foo + foo_mfns" appears quite a lot here. I think you could calculate > > > those once into foo_start and foo_end and use throughout which would > > > make the remainder much easier to follow. > > > > > > Oh, I see this came from the x86 function of which this is an almost > > > complete copy -- can it not be made common? > > > > > > The difference seems to be map_mmio_regions vs. a loop over > > > set_mmio_p2m_entry which seems easy enough to abstract out. > > > > Indeed. > > > But, if I can ask, from where does this difference come from? If Arianna > is to make this common code, should she retain such difference or kill > it? I mean, do we want to keep having x86 mapping in loop and ARM > mapping all at once, or can we just merge that part two? If the former, > why? If it were me I'd make an x86 equivalent to arms map_mmio_regions which did the loop of set_mmio_p2m_entry. Ian.