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-changelog

[Xen-changelog] [xen-unstable] [IA64] Fix start_kernel() to call init_xe

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64] Fix start_kernel() to call init_xenheap_pages() with correct range.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 23 Jan 2008 01:11:20 -0800
Delivery-date: Wed, 23 Jan 2008 01:15:57 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1200596744 25200
# Node ID 8977f087351a11be55eab7671d53d69f04b3c9ff
# Parent  4fbde3a39909aae668a6a785ae6a0bafeb26786b
[IA64] Fix start_kernel() to call init_xenheap_pages() with correct range.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 xen/arch/ia64/xen/xensetup.c |   61 +++++++++++++++++++++++++++++++++----------
 1 files changed, 47 insertions(+), 14 deletions(-)

diff -r 4fbde3a39909 -r 8977f087351a xen/arch/ia64/xen/xensetup.c
--- a/xen/arch/ia64/xen/xensetup.c      Thu Jan 17 12:05:43 2008 -0700
+++ b/xen/arch/ia64/xen/xensetup.c      Thu Jan 17 12:05:44 2008 -0700
@@ -255,7 +255,7 @@ md_overlap_with_boot_param(const efi_mem
 }
 
 #define MD_SIZE(md) (md->num_pages << EFI_PAGE_SHIFT)
-#define MD_END(md) ((md)->phys_addr + ((md)->num_pages << EFI_PAGE_SHIFT))
+#define MD_END(md) ((md)->phys_addr + MD_SIZE(md))
 
 extern char __init_begin[], __init_end[];
 static void noinline init_done(void)
@@ -267,6 +267,41 @@ static void noinline init_done(void)
            (long)(__init_end-__init_begin)>>10);
     
     startup_cpu_idle_loop();
+}
+
+struct xen_heap_desc {
+    void*               xen_heap_start;
+    unsigned long       xenheap_phys_end;
+    efi_memory_desc_t*  kern_md;
+};
+
+static int __init
+init_xenheap_mds(unsigned long start, unsigned long end, void *arg)
+{
+    struct xen_heap_desc *desc = (struct xen_heap_desc*)arg;
+    unsigned long md_end = __pa(desc->xen_heap_start);
+    efi_memory_desc_t* md;
+
+    start = __pa(start);
+    end = __pa(end);
+    
+    for (md = efi_get_md(md_end);
+         md != NULL && md->phys_addr < desc->xenheap_phys_end;
+         md = efi_get_md(md_end)) {
+        md_end = MD_END(md);
+
+        if (md == desc->kern_md ||
+            (md->type == EFI_LOADER_DATA && !md_overlap_with_boot_param(md)) ||
+            ((md->attribute & EFI_MEMORY_WB) &&
+             is_xenheap_usable_memory(md))) {
+            unsigned long s = max(start, max(__pa(desc->xen_heap_start),
+                                             md->phys_addr));
+            unsigned long e = min(end, min(md_end, desc->xenheap_phys_end));
+            init_xenheap_pages(s, e);
+        }
+    }
+
+    return 0;
 }
 
 int running_on_sim;
@@ -305,6 +340,7 @@ void __init start_kernel(void)
     struct vcpu *dom0_vcpu0;
     efi_memory_desc_t *kern_md, *last_md, *md;
     void *xen_heap_start;
+    struct xen_heap_desc heap_desc;
 #ifdef CONFIG_SMP
     int i;
 #endif
@@ -384,8 +420,12 @@ void __init start_kernel(void)
         if (relo_start < md->phys_addr)
             relo_start = md->phys_addr;
         
-        if (!is_xenheap_usable_memory(md))
+        if (!is_xenheap_usable_memory(md)) {
+            /* Skip this area */
+            if (md_end > relo_start)
+                relo_start = md_end;
             continue;
+        }
 
         /*
          * The dom0 kernel or initrd could overlap, reserve space
@@ -488,18 +528,11 @@ skip_move:
     if (vmx_enabled)
         xen_heap_start = vmx_init_env(xen_heap_start, xenheap_phys_end);
 
-    md_end = __pa(xen_heap_start);
-    for (md = efi_get_md(md_end);
-         md != NULL && md->phys_addr < xenheap_phys_end;
-         md = efi_get_md(md_end)) {
-        md_end = MD_END(md);
-
-        if (md == kern_md ||
-            (md->type == EFI_LOADER_DATA && !md_overlap_with_boot_param(md)) ||
-            (md->attribute & EFI_MEMORY_WB))
-            init_xenheap_pages(max(__pa(xen_heap_start), md->phys_addr),
-                               min(md_end, xenheap_phys_end));
-    }
+    heap_desc.xen_heap_start   = xen_heap_start;
+    heap_desc.xenheap_phys_end = xenheap_phys_end;
+    heap_desc.kern_md          = kern_md;
+    efi_memmap_walk(&init_xenheap_mds, &heap_desc);
+
     printk("Xen heap: %luMB (%lukB)\n",
            (xenheap_phys_end-__pa(xen_heap_start)) >> 20,
            (xenheap_phys_end-__pa(xen_heap_start)) >> 10);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [IA64] Fix start_kernel() to call init_xenheap_pages() with correct range., Xen patchbot-unstable <=