From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH 2/6] xen/arm: implement get_maximum_gpfn hypercall Date: Fri, 11 Apr 2014 14:15:21 +0100 Message-ID: <5347EAE9.2010808@linaro.org> References: <1397148539-19084-1-git-send-email-w1.huang@samsung.com> <1397148539-19084-3-git-send-email-w1.huang@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1397148539-19084-3-git-send-email-w1.huang@samsung.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: Wei Huang Cc: stefano.stabellini@eu.citrix.com, yjhyun.yoo@samsung.com, ian.campbell@citrix.com, jaeyong.yoo@samsung.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Hello Wei, On 04/10/2014 05:48 PM, Wei Huang wrote: > From: Jaeyong Yoo > > This patchi implements get_maximum_gpfn by using the memory map > info in arch_domain (from set_memory_map hypercall). > > Signed-off-by: Evgeny Fedotov > --- > xen/arch/arm/mm.c | 19 ++++++++++++++++++- > xen/include/asm-arm/mm.h | 2 ++ > 2 files changed, 20 insertions(+), 1 deletion(-) > > diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c > index 362bc8d..14b4686 100644 > --- a/xen/arch/arm/mm.c > +++ b/xen/arch/arm/mm.c > @@ -947,7 +947,11 @@ int page_is_ram_type(unsigned long mfn, unsigned long mem_type) > > unsigned long domain_get_maximum_gpfn(struct domain *d) > { > - return -ENOSYS; > + paddr_t end; > + > + get_gma_start_end(d, NULL, &end); > + > + return (unsigned long) (end >> PAGE_SHIFT); > } > void share_xen_page_with_guest(struct page_info *page, > @@ -1235,6 +1239,19 @@ int is_iomem_page(unsigned long mfn) > return 1; > return 0; > } > + > +/* > + * Return start and end addresses of guest > + */ > +void get_gma_start_end(struct domain *d, paddr_t *start, paddr_t *end) > +{ > + if ( start ) > + *start = GUEST_RAM_BASE; > + > + if ( end ) > + *end = GUEST_RAM_BASE + ((paddr_t) d->max_pages << PAGE_SHIFT); > +} > + Ian plans to add multiple banks support for the guest very soon. This solution will stop to work. Late december, we've introduce max_mapped_pfn for ARM which give the maximum pfn mapped in the guest. Would it suit for your purpose? FYI x86 uses a similar solution. Regards, -- Julien Grall