[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/6] xen/arm: implement get_maximum_gpfn hypercall



Hello Wei,

On 04/10/2014 05:48 PM, Wei Huang wrote:
> From: Jaeyong Yoo <jaeyong.yoo@xxxxxxxxxxx>
> 
> 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 <e.fedotov@xxxxxxxxxxx>
> ---
>  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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.