@@ -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;
+
+ domain_get_gpfn_range(d, NULL, &end);
+
+ return (unsigned long)end;
}
void share_xen_page_with_guest(struct page_info *page,
@@ -1235,6 +1239,21 @@ int is_iomem_page(unsigned long mfn)
return 1;
return 0;
}
+
+/*
+ * Return start and end addresses of guest VM
+ */
+void domain_get_gpfn_range(struct domain *d, paddr_t *start, paddr_t *end)
+{
+ struct p2m_domain *p2m = &d->arch.p2m;
+
+ if ( start )
+ *start = GUEST_RAM_BASE;
+
+ if ( end )
+ *end = GUEST_RAM_BASE + ((paddr_t) p2m->max_mapped_gfn);
+}
+
/*
* Local variables:
* mode: C
@@ -319,6 +319,7 @@ int donate_page(
#define domain_set_alloc_bitsize(d) ((void)0)
#define domain_clamp_alloc_bitsize(d, b) (b)
+void domain_get_gpfn_range(struct domain *d, paddr_t *start, paddr_t *end);
unsigned long domain_get_maximum_gpfn(struct domain *d);
extern struct domain *dom_xen, *dom_io, *dom_cow;