WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] linux/x86_64: correctly handle mem= reducing memory

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux/x86_64: correctly handle mem= reducing memory amount
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Tue, 01 Dec 2009 10:57:34 +0000
Delivery-date: Tue, 01 Dec 2009 02:58:33 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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.

Written and tested on 2.6.16.60 and made apply to the 2.6.18 tree
without further testing.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- sle10sp3-2009-11-27.orig/arch/x86_64/kernel/e820-xen.c      2009-10-01 
14:16:23.000000000 +0200
+++ sle10sp3-2009-11-27/arch/x86_64/kernel/e820-xen.c   2009-12-01 
11:31:11.000000000 +0100
@@ -30,12 +30,14 @@
 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.
--- sle10sp3-2009-11-27.orig/include/asm-x86_64/proto.h 2009-08-10 
10:13:16.000000000 +0200
+++ sle10sp3-2009-11-27/include/asm-x86_64/proto.h      2009-12-01 
11:30:58.000000000 +0100
@@ -75,7 +75,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);



Attachment: xenlinux-x86_64-mem-reduction.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux/x86_64: correctly handle mem= reducing memory amount, Jan Beulich <=