From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v6 06/11] xen, x86: factor out map and unmap from the memory_mapping DOMCTL Date: Mon, 21 Apr 2014 17:14:21 +0100 Message-ID: <535543DD.8030901@citrix.com> References: <1398087904-16594-1-git-send-email-avanzini.arianna@gmail.com> <1398087904-16594-7-git-send-email-avanzini.arianna@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1398087904-16594-7-git-send-email-avanzini.arianna@gmail.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: Arianna Avanzini , xen-devel@lists.xen.org Cc: julien.grall@citrix.com, paolo.valente@unimore.it, keir@xen.org, stefano.stabellini@eu.citrix.com, tim@xen.org, dario.faggioli@citrix.com, Ian.Jackson@eu.citrix.com, Ian.Campbell@eu.citrix.com, etrudeau@broadcom.com, JBeulich@suse.com, viktor.kleinik@globallogic.com List-Id: xen-devel@lists.xenproject.org On 21/04/2014 14:44, Arianna Avanzini wrote: > > #if P2M_AUDIT > diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h > index 4a1c129..1098600 100644 > --- a/xen/include/asm-x86/p2m.h > +++ b/xen/include/asm-x86/p2m.h > @@ -32,6 +32,18 @@ > #include > #include /* for pagetable_t */ > > +/* Map MMIO regions in the p2m: start_gfn and end_gfn is the range, inclusive > + * of the end_gfn frame number, in the guest physical address space to map, > + * starting from the machine frame number mfn. */ > +int map_mmio_regions(struct domain *d, > + unsigned long start_gfn, > + unsigned long end_gfn, > + unsigned long mfn); > +int unmap_mmio_regions(struct domain *d, > + unsigned long start_gfn, > + unsigned long end_gfn, > + unsigned long mfn); > + > extern bool_t opt_hap_1gb, opt_hap_2mb; > > /* Given that you are changing all of this, please please take the time to change these functions (and others in the series, where appropriate) to take parameters more like (struct domain *d, unsigned long gfn, unsigned long mfn, unsigned long count) With a count parameter as opposed to a start/end pair, there can be no confusion regarding inclusive/exclusive ranges, or at which point to subtract 1. It will also resemble the information in the hypercall, and avoids needing to recalculate nr_mfns everywhere. ~Andrew