]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
xen/x86_64: correctly handle mem= reducing memory amount
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 1 Dec 2009 14:02:52 +0000 (14:02 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 1 Dec 2009 14:02:52 +0000 (14:02 +0000)
When mem= is being used to specify a value below the amount a domain
got passed from Xen, init_memory_mapping() got called with the higher
original value (end_pfn_map), triggering the BUG()s in maddr.h
checking PFNs against end_pfn.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
arch/x86_64/kernel/e820-xen.c
include/asm-x86_64/proto.h

index 413d6b15773d652afb860f894116415ef828b3a5..57111a2a572f0e2b51db2e2d95931bb47253d131 100644 (file)
 unsigned long end_pfn; 
 EXPORT_SYMBOL(end_pfn);
 
+#ifndef CONFIG_XEN
 /* 
  * end_pfn only includes RAM, while end_pfn_map includes all e820 entries.
  * The direct mapping extends to end_pfn_map, so that we can directly access
  * apertures, ACPI and other tables without having to play with fixmaps.
  */ 
 unsigned long end_pfn_map; 
+#endif
 
 /* 
  * Last pfn which the user wants to use.
index 038fe1f47e6fcb5804a5878270614289f545d9d4..3f30d902863192f4b551f26b6e0c997e6713b2f6 100644 (file)
@@ -72,7 +72,11 @@ extern void load_gs_index(unsigned gs);
 extern void stop_timer_interrupt(void);
 extern void main_timer_handler(struct pt_regs *regs);
 
+#ifndef CONFIG_XEN
 extern unsigned long end_pfn_map; 
+#else
+#define end_pfn_map end_pfn
+#endif
 
 extern void show_trace(struct task_struct *, struct pt_regs *, unsigned long * rsp);
 extern void show_registers(struct pt_regs *regs);