From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arianna Avanzini Subject: Re: [RFC PATCH 2/3] arch, arm32: add the XEN_DOMCTL_memory_mapping hypercall Date: Fri, 07 Mar 2014 20:49:35 +0100 Message-ID: <531A22CF.9050901@gmail.com> References: <1393721365-22458-1-git-send-email-avanzini.arianna@gmail.com> <1393721365-22458-3-git-send-email-avanzini.arianna@gmail.com> <531543BE.4080301@linaro.org> <53191948.4090100@gmail.com> <53193FFE.9080605@linaro.org> Reply-To: Arianna Avanzini Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53193FFE.9080605@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall , Eric Trudeau , "xen-devel@lists.xen.org" Cc: "julien.grall@citrix.com" , "dario.faggioli@citrix.com" , "paolo.valente@unimore.it" , "viktor.kleinik@globallogic.com" , "stefano.stabellini@eu.citrix.com" List-Id: xen-devel@lists.xenproject.org On 03/07/2014 04:41 AM, Julien Grall wrote: > > Hello Arianna, > > On 07/03/14 08:56, Arianna Avanzini wrote: >>>> Beware: I found that map_mmio_regions was off by one page unless I changed >>>> "gfn + nr_mfns - 1" to "gfn + nr_mfns". >>>> This may have been fixed in more recent upstream code. >>> >>> That makes me think, map_mmio_regions is buggy if the range is not correctly >>> aligned. For instance: >>> >>> start_gaddr = 0x1001 and end_gaddr = 0x2001, we only map 0x1000-0x2000 to the >>> domain. >>> >>> The problem is the same with p2m_populate_ram (even if I doubt that RAM range is >>> not page-aligned). >>> >>> I see 2 solutions to fix it: >>> - Change map_mmio_regions prototype to use frame is instead address. >>> - Aligned the input addresses. >>> >>> IHMO, the former seems to be better, at least it avoid developer to discover >>> that some bits was mapped under his feet. >>> >> >> Sorry if I intrude here, thank you for pointing that out. As of now I have tried >> to simply pass aligned addresses to map_mmio_regions() when it is invoked by the >> memory_mapping hypercall. > > FYI, the end address should be PAGE-aligned minus 1. Otherwise you will map a > spurious page to the guest. > Thank you for pointing that out. >> Sorry for the additional question, do you think that it would be appropriate to >> add to the series a patch implementing one of the above-described solutions (the >> one believed to be better)? > > I'd like to have some input from Ian before. I think for now it's fine to stay > with the current implementation. > OK. Thank you for making this clear. > Regards, > -- /* * Arianna Avanzini * avanzini.arianna@gmail.com * 73628@studenti.unimore.it */