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

RE: [Xen-devel] [PATCH] Increasing E820MAX

To: "Ian Pratt" <m+Ian.Pratt@xxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH] Increasing E820MAX
From: "Nakajima, Jun" <jun.nakajima@xxxxxxxxx>
Date: Wed, 17 Aug 2005 14:16:46 -0700
Delivery-date: Wed, 17 Aug 2005 21:15:09 +0000
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/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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcWjUAqwGOyUU2P7QwSYVF5NzvJefgADyCogAAQ+3HA=
Thread-topic: [Xen-devel] [PATCH] Increasing E820MAX
Ian Pratt wrote:
> This breaks x86_64 boot! It crashes in the Xen ACPI code.
> 
> Ian
I don't see the problem on machine that I typically use, but I found and
fixed the problem on a big machine. It was causing a stack overflow. If
you look at the current code, it's a bit dangerous, see => part. This
patch fixes it.

+static struct e820entry e820_raw[E820MAX];
+
 void __init __start_xen(multiboot_info_t *mbi)
 {
     char *cmdline;
@@ -253,7 +255,6 @@
     unsigned long _initrd_start = 0, _initrd_len = 0;
     unsigned int initrdidx = 1;
     physaddr_t s, e;
-    struct e820entry e820_raw[E820MAX];
     int i, e820_raw_nr = 0, bytes = 0;
     struct ns16550_defaults ns16550 = {
         .data_bits = 8,


----
    if ( mbi->flags & MBI_MEMMAP )
    {
        while ( bytes < mbi->mmap_length )
        {
            memory_map_t *map = __va(mbi->mmap_addr + bytes);
        =>    e820_raw[e820_raw_nr].addr = 
                ((u64)map->base_addr_high << 32) |
(u64)map->base_addr_low;
        =>    e820_raw[e820_raw_nr].size = 
                ((u64)map->length_high << 32) | (u64)map->length_low;
        =>    e820_raw[e820_raw_nr].type = 
                (map->type > E820_SHARED_PAGE) ? E820_RESERVED :
map->type;
        =>    e820_raw_nr++;
            bytes += map->size + 4;
        }
    }


> 
>> We found machines with >32 E820 memory map entries, where Xen
>> fails to boot (but Linux does boot fine). The native Linux
>> (both x86 and x86_86) already has:
>> 
>> #define E820MAX      128             /* number of entries in
>> E820MAP */
>> 
>> Signed-off-by: Jun Nakajima <jun.nakajima@xxxxxxxxx>
>> 
>> Jun
>> ---
>> Intel Open Source Technology Center
>> 
>> --
>> diff -r 3bb1857981e6 -r 51e9c0c806b2 xen/include/asm-x86/e820.h
>> --- a/xen/include/asm-x86/e820.h     Tue Aug 16 19:38:22 2005
>> +++ b/xen/include/asm-x86/e820.h     Wed Aug 17 17:00:29 2005 @@ -3,7
>> +3,7 @@ 
>> 
>>  #include <asm/page.h>
>> 
>> -#define E820MAX     32
>> +#define E820MAX     128
>> 
>>  #define E820_RAM          1
>>  #define E820_RESERVED     2



Jun
---
Intel Open Source Technology Center

Attachment: e820_stack.patch
Description: e820_stack.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>