[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
On 04/10/2014 12:28 PM, Andrew Cooper wrote: On 10/04/14 17:48, 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>Common implementation and a specific arch_get_maximum_gpfn() ? ~Andrew Yes, will do. --- 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); +} + /* * Local variables: * mode: C diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h index b8d4e7d..341493a 100644 --- a/xen/include/asm-arm/mm.h +++ b/xen/include/asm-arm/mm.h @@ -341,6 +341,8 @@ static inline void put_page_and_type(struct page_info *page) put_page(page); } +void get_gma_start_end(struct domain *d, paddr_t *start, paddr_t *end); + #endif /* __ARCH_ARM_MM__ */ /* * Local variables: _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |