[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] xen/x86_64: correctly handle mem= reducing memory amount



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1259676172 0
# Node ID ff5ea1801bd3f5857c095c760f04dfab787f8c1d
# Parent  7ee9b1483445b05a2bab9466d1632f00f868f3c3
xen/x86_64: correctly handle mem= reducing memory amount

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@xxxxxxxxxx>
---
 arch/x86_64/kernel/e820-xen.c |    2 ++
 include/asm-x86_64/proto.h    |    4 ++++
 2 files changed, 6 insertions(+)

diff -r 7ee9b1483445 -r ff5ea1801bd3 arch/x86_64/kernel/e820-xen.c
--- a/arch/x86_64/kernel/e820-xen.c     Mon Nov 30 10:37:45 2009 +0000
+++ b/arch/x86_64/kernel/e820-xen.c     Tue Dec 01 14:02:52 2009 +0000
@@ -31,12 +31,14 @@ unsigned long end_pfn;
 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.
diff -r 7ee9b1483445 -r ff5ea1801bd3 include/asm-x86_64/proto.h
--- a/include/asm-x86_64/proto.h        Mon Nov 30 10:37:45 2009 +0000
+++ b/include/asm-x86_64/proto.h        Tue Dec 01 14:02:52 2009 +0000
@@ -72,7 +72,11 @@ extern void stop_timer_interrupt(void);
 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);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.