summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/xen/setup.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index a1a77eabe858..ead0d363bfba 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -789,11 +789,12 @@ char * __init xen_memory_setup(void)
&xen_e820_map_entries);
max_pages = xen_get_max_pages();
- if (max_pages > max_pfn)
- extra_pages += max_pages - max_pfn;
/* How many extra pages do we need due to remapping? */
- extra_pages += xen_count_remap_pages(max_pfn);
+ max_pages += xen_count_remap_pages(max_pfn);
+
+ if (max_pages > max_pfn)
+ extra_pages += max_pages - max_pfn;
/*
* Clamp the amount of extra memory to a EXTRA_MEM_RATIO