xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 2/6] xen/arm: Implement get_maximum_gpfn hypercall for arm
@ 2013-11-06  3:45 Jaeyong Yoo
  0 siblings, 0 replies; only message in thread
From: Jaeyong Yoo @ 2013-11-06  3:45 UTC (permalink / raw)
  To: xen-devel; +Cc: 'Eugene Fedotov'


[-- Attachment #1.1: Type: text/plain, Size: 1940 bytes --]

By using the memory map info in arch_domain (from set_memory_map hypercall)

implement get_maximum_gpfn hypercall.

 

Changes from v4: Use GUEST_RAM_BASE as the start physical address of guest

RAM. And, purge set-memory-map patch

 

Singed-off-by: Evgeny Fedotov <e.fedotov@samsung.com>

---

xen/arch/arm/mm.c        | 22 +++++++++++++++++++++-

xen/include/asm-arm/mm.h |  2 ++

2 files changed, 23 insertions(+), 1 deletion(-)

 

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c

index 123280e..3801f07 100644

--- a/xen/arch/arm/mm.c

+++ b/xen/arch/arm/mm.c

@@ -927,7 +927,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,

@@ -1308,6 +1312,22 @@ int is_iomem_page(unsigned long mfn)

         return 1;

     return 0;

}

+

+/* Guest RAM base */

+#define GUEST_RAM_BASE 0x80000000

+/*

+ *  XXX: Use correct definition for RAM base when the following patch

+ *  xen: arm: 64-bit guest support and domU FDT autogeneration

+ *  will be upstreamed.

+ */

+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 ce66099..c5cb3af 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:

--

1.8.1.2


[-- Attachment #1.2: Type: text/html, Size: 7853 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-06  3:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-06  3:45 [PATCH v5 2/6] xen/arm: Implement get_maximum_gpfn hypercall for arm Jaeyong Yoo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).