From: Stefano Stabellini Subject: Re: [PATCH RFC v2 4/9] xen/arm: Implement get_maximum_gpfn hypercall for arm Date: Wed, 3 Jul 2013 12:29:41 +0100 Message-ID: References: <1372842943-27482-1-git-send-email-jaeyong.yoo@samsung.com> <1372842943-27482-5-git-send-email-jaeyong.yoo@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1372842943-27482-5-git-send-email-jaeyong.yoo@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: Jaeyong Yoo Cc: Alexey Sokolov , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 3 Jul 2013, Jaeyong Yoo wrote: > From: Alexey Sokolov > > Since we do not know the maximum gpfn size for guest domain, > we walk the page table of guest in order to see the maximum size > of gpfn. > > Singed-off-by: Alexey Sokolov > --- > xen/arch/arm/mm.c | 3 +- > xen/arch/arm/p2m.c | 69 +++++++++++++++++++++++++++++++++++++++++++ > xen/include/asm-arm/p2m.h | 3 ++ > xen/include/public/arch-arm.h | 6 ++++ > 4 files changed, 80 insertions(+), 1 deletion(-) > > diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c > index d1290cd..650b1fc 100644 > --- a/xen/arch/arm/mm.c > +++ b/xen/arch/arm/mm.c > @@ -762,7 +762,8 @@ int page_is_ram_type(unsigned long mfn, unsigned long mem_type) > > unsigned long domain_get_maximum_gpfn(struct domain *d) > { > - return -ENOSYS; > + xen_pfn_t result = p2m_get_next_non_used_gpfn(d, GUEST_RAM_BASE >> PAGE_SHIFT); > + return result; > } Rather than implementing p2m_get_next_non_used_gpfn, I think we should keep track of the maximum gpfn, like we do on x86, see: xen/arch/x86/mm.c:domain_get_maximum_gpfn