aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2010-09-02 11:16:00 -0400
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-10-22 16:19:19 -0400
commit9e9a5fcb04e3af077d1be32710298b852210d93f (patch)
tree8738bdf5a6390c3f7986551bfc566a01727c57a4 /arch
parent375b2a9ada6d105483aab22f1af1d727bc3c418d (diff)
xen: use host E820 map for dom0
When running as initial domain, get the real physical memory map from xen using the XENMEM_machine_memory_map hypercall and use it to setup the e820 regions. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/xen/setup.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 7a4ab05cff8a..0ce9d58cb29d 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -149,6 +149,7 @@ char * __init xen_memory_setup(void)
149 unsigned long extra_pages = 0; 149 unsigned long extra_pages = 0;
150 unsigned long extra_limit; 150 unsigned long extra_limit;
151 int i; 151 int i;
152 int op;
152 153
153 max_pfn = min(MAX_DOMAIN_PAGES, max_pfn); 154 max_pfn = min(MAX_DOMAIN_PAGES, max_pfn);
154 mem_end = PFN_PHYS(max_pfn); 155 mem_end = PFN_PHYS(max_pfn);
@@ -156,7 +157,10 @@ char * __init xen_memory_setup(void)
156 memmap.nr_entries = E820MAX; 157 memmap.nr_entries = E820MAX;
157 set_xen_guest_handle(memmap.buffer, map); 158 set_xen_guest_handle(memmap.buffer, map);
158 159
159 rc = HYPERVISOR_memory_op(XENMEM_memory_map, &memmap); 160 op = xen_initial_domain() ?
161 XENMEM_machine_memory_map :
162 XENMEM_memory_map;
163 rc = HYPERVISOR_memory_op(op, &memmap);
160 if (rc == -ENOSYS) { 164 if (rc == -ENOSYS) {
161 memmap.nr_entries = 1; 165 memmap.nr_entries = 1;
162 map[0].addr = 0ULL; 166 map[0].addr = 0ULL;
@@ -235,7 +239,8 @@ char * __init xen_memory_setup(void)
235 else 239 else
236 extra_pages = 0; 240 extra_pages = 0;
237 241
238 xen_add_extra_mem(extra_pages); 242 if (!xen_initial_domain())
243 xen_add_extra_mem(extra_pages);
239 244
240 return "Xen"; 245 return "Xen";
241} 246}