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] [RFC PATCH 17/33] Support loading an initrd when running on

To: linux-kernel@xxxxxxxxxxxxxxx
Subject: [Xen-devel] [RFC PATCH 17/33] Support loading an initrd when running on Xen
From: Chris Wright <chrisw@xxxxxxxxxxxx>
Date: Tue, 18 Jul 2006 00:00:17 -0700
Cc: Andrew Morton <akpm@xxxxxxxx>, Zachary Amsden <zach@xxxxxxxxxx>, Jeremy Fitzhardinge <jeremy@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Ian Pratt <ian.pratt@xxxxxxxxxxxxx>, Rusty Russell <rusty@xxxxxxxxxxxxxxx>, Andi Kleen <ak@xxxxxxx>, virtualization@xxxxxxxxxxxxxx, Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>
Delivery-date: Tue, 18 Jul 2006 02:39:02 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20060718091807.467468000@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: quilt/0.45-1
Due to the initial physical memory layout when booting on Xen, the initrd
image ends up below min_low_pfn (as registered with the bootstrap memory
allocator).  Add Xen subarch support to enable initrd_below_start_ok flag,
and disable initrd_reserve_bootmem.

Signed-off-by: Ian Pratt <ian.pratt@xxxxxxxxxxxxx>
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>
Signed-off-by: Chris Wright <chrisw@xxxxxxxxxxxx>
---
 arch/i386/kernel/setup.c                    |    4 +++-
 include/asm-i386/mach-xen/setup_arch_post.h |    6 ++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff -r f4c730a90338 arch/i386/kernel/setup.c
--- a/arch/i386/kernel/setup.c  Tue Jun 13 23:54:44 2006 -0700
+++ b/arch/i386/kernel/setup.c  Wed Jun 14 00:02:16 2006 -0700
@@ -1205,6 +1205,7 @@ extern unsigned long __init setup_memory
 extern unsigned long __init setup_memory(void);
 extern void zone_sizes_init(void);
 #endif /* !CONFIG_NEED_MULTIPLE_NODES */
+int initrd_reserve_bootmem = 1;
 
 void __init setup_bootmem_allocator(void)
 {
@@ -1265,7 +1266,8 @@ void __init setup_bootmem_allocator(void
 #ifdef CONFIG_BLK_DEV_INITRD
        if (LOADER_TYPE && INITRD_START) {
                if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) {
-                       reserve_bootmem(INITRD_START, INITRD_SIZE);
+                       if (initrd_reserve_bootmem)
+                               reserve_bootmem(INITRD_START, INITRD_SIZE);
                        initrd_start =
                                INITRD_START ? INITRD_START + PAGE_OFFSET : 0;
                        initrd_end = initrd_start+INITRD_SIZE;
diff -r f4c730a90338 arch/i386/mach-xen/setup-xen.c
--- a/arch/i386/mach-xen/setup-xen.c    Tue Jun 13 23:54:44 2006 -0700
+++ b/arch/i386/mach-xen/setup-xen.c    Wed Jun 14 00:02:16 2006 -0700
@@ -5,6 +5,8 @@
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/mm.h>
+#include <linux/bootmem.h>
+#include <linux/initrd.h>
 
 #include <asm/e820.h>
 #include <asm/setup.h>
@@ -68,4 +70,10 @@ void __init machine_specific_arch_setup(
        memcpy(saved_command_line, xen_start_info->cmd_line,
               MAX_GUEST_CMDLINE > COMMAND_LINE_SIZE ?
               COMMAND_LINE_SIZE : MAX_GUEST_CMDLINE);
+
+       if (INITRD_START &&
+           INITRD_START + PAGE_OFFSET < min_low_pfn << PAGE_SHIFT) {
+               initrd_reserve_bootmem = 0;
+               initrd_below_start_ok = 1;
+       }
 }
diff -r f4c730a90338 include/asm-i386/setup.h
--- a/include/asm-i386/setup.h  Tue Jun 13 23:54:44 2006 -0700
+++ b/include/asm-i386/setup.h  Wed Jun 14 00:02:16 2006 -0700
@@ -66,6 +66,7 @@ extern unsigned char boot_params[PARAM_S
 #define LOWMEMSIZE()   (0x9f000)
 
 extern unsigned long init_pg_tables_end;
+extern int initrd_reserve_bootmem;
 
 struct e820entry;
 

--

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

<Prev in Thread] Current Thread [Next in Thread>