]> git.ipfire.org Git - people/ummeegge/ipfire-2.x.git/blobdiff - src/patches/suse-2.6.27.39/patches.xen/xen-x86-bigmem
Imported linux-2.6.27.39 suse/xen patches.
[people/ummeegge/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.xen / xen-x86-bigmem
similarity index 70%
rename from src/patches/suse-2.6.27.31/patches.xen/xen-x86-bigmem
rename to src/patches/suse-2.6.27.39/patches.xen/xen-x86-bigmem
index d7fb80544a523d862aad99fd6a06a52516ae35d7..bf29862741e58b685cdc7677db22368ec90a3ba4 100644 (file)
@@ -1,13 +1,11 @@
 From: jbeulich@novell.com
 Subject: fix issues with the assignment of huge amounts of memory
 Patch-mainline: obsolete
+References: bnc#482614, bnc#537435
 
-At the same time remove the non-applicable and broken support for the
-memmap= command line option.
-
---- sle11-2009-07-31.orig/arch/x86/kernel/e820-xen.c   2009-02-17 14:01:20.000000000 +0100
-+++ sle11-2009-07-31/arch/x86/kernel/e820-xen.c        2009-03-13 16:14:19.000000000 +0100
-@@ -1308,6 +1308,26 @@ static int __init parse_memopt(char *p)
+--- sle11-2009-09-18.orig/arch/x86/kernel/e820-xen.c   2009-02-17 14:01:20.000000000 +0100
++++ sle11-2009-09-18/arch/x86/kernel/e820-xen.c        2009-09-18 10:08:03.000000000 +0200
+@@ -1317,6 +1317,26 @@ static int __init parse_memopt(char *p)
  
        i = e820.nr_map - 1;
        current_end = e820.map[i].addr + e820.map[i].size;
@@ -34,23 +32,7 @@ memmap= command line option.
        if (current_end < mem_size) {
                /*
                 * The e820 map ends before our requested size so
-@@ -1367,6 +1387,7 @@ static int __init parse_memmap_opt(char 
-       return *p == '\0' ? 0 : -EINVAL;
- }
- early_param("memmap", parse_memmap_opt);
-+#endif
- void __init finish_e820_parsing(void)
- {
-@@ -1381,7 +1402,6 @@ void __init finish_e820_parsing(void)
-               e820_print_map("user");
-       }
- }
--#endif
- static inline const char *e820_type_to_string(int e820_type)
- {
-@@ -1407,7 +1427,7 @@ void __init e820_reserve_resources(void)
+@@ -1416,7 +1436,7 @@ void __init e820_reserve_resources(void)
        struct resource *res;
        u64 end;
  
@@ -59,8 +41,39 @@ memmap= command line option.
        for (i = 0; i < e820.nr_map; i++) {
                end = e820.map[i].addr + e820.map[i].size - 1;
  #ifndef CONFIG_RESOURCES_64BIT
---- sle11-2009-07-31.orig/arch/x86/kernel/setup-xen.c  2009-07-31 15:14:20.000000000 +0200
-+++ sle11-2009-07-31/arch/x86/kernel/setup-xen.c       2009-07-31 15:14:31.000000000 +0200
+@@ -1498,6 +1518,7 @@ char *__init __attribute__((weak)) machi
+ char * __init memory_setup(void)
+ {
+       int rc, nr_map;
++      unsigned long long maxmem;
+       struct xen_memory_map memmap;
+       /*
+        * This is rather large for a stack variable but this early in
+@@ -1527,6 +1548,22 @@ char * __init memory_setup(void)
+               BUG();
+ #ifdef CONFIG_XEN
++      /* See the comment in parse_memopt(). */
++      for (maxmem = rc = 0; rc < e820.nr_map; ++rc)
++              if (e820.map[rc].type == E820_RAM)
++                      maxmem += e820.map[rc].size;
++      if ((maxmem >> (PAGE_SHIFT + 5)) > xen_start_info->nr_pages) {
++              unsigned long long size = (u64)xen_start_info->nr_pages << 5;
++
++              printk(KERN_WARNING "maxmem of %LuM is invalid for an initial"
++                                  " allocation of %luM, using %LuM\n",
++                     maxmem >> 20,
++                     xen_start_info->nr_pages >> (20 - PAGE_SHIFT),
++                     size >> (20 - PAGE_SHIFT));
++              size <<= PAGE_SHIFT;
++              e820_remove_range(size, ULLONG_MAX - size, E820_RAM, 1);
++      }
++
+       if (is_initial_xendomain()) {
+               memmap.nr_entries = E820MAX;
+               set_xen_guest_handle(memmap.buffer, machine_e820.map);
+--- sle11-2009-09-18.orig/arch/x86/kernel/setup-xen.c  2009-07-31 15:14:20.000000000 +0200
++++ sle11-2009-09-18/arch/x86/kernel/setup-xen.c       2009-07-31 15:14:31.000000000 +0200
 @@ -128,12 +128,7 @@ static struct notifier_block xen_panic_b
  unsigned long *phys_to_machine_mapping;
  EXPORT_SYMBOL(phys_to_machine_mapping);
@@ -126,9 +139,9 @@ memmap= command line option.
                                pfn_to_mfn_frame_list[k] =
                                        alloc_bootmem_pages(PAGE_SIZE);
                                pfn_to_mfn_frame_list_list[k] =
---- sle11-2009-07-31.orig/arch/x86/kernel/setup_percpu-xen.c   2009-06-04 10:21:39.000000000 +0200
-+++ sle11-2009-07-31/arch/x86/kernel/setup_percpu-xen.c        2009-03-13 16:14:41.000000000 +0100
-@@ -211,7 +211,7 @@ static void __init setup_node_to_cpumask
+--- sle11-2009-09-18.orig/arch/x86/kernel/setup_percpu-xen.c   2009-08-26 12:17:43.000000000 +0200
++++ sle11-2009-09-18/arch/x86/kernel/setup_percpu-xen.c        2009-08-26 12:19:19.000000000 +0200
+@@ -206,7 +206,7 @@ static void __init setup_node_to_cpumask
        }
  
        /* allocate the map */
@@ -137,8 +150,8 @@ memmap= command line option.
  
        pr_debug(KERN_DEBUG "Node to cpumask map at %p for %d nodes\n",
                 map, nr_node_ids);
---- sle11-2009-07-31.orig/drivers/xen/core/machine_kexec.c     2009-06-04 10:21:39.000000000 +0200
-+++ sle11-2009-07-31/drivers/xen/core/machine_kexec.c  2009-03-13 16:13:15.000000000 +0100
+--- sle11-2009-09-18.orig/drivers/xen/core/machine_kexec.c     2009-06-04 10:21:39.000000000 +0200
++++ sle11-2009-09-18/drivers/xen/core/machine_kexec.c  2009-03-13 16:13:15.000000000 +0100
 @@ -57,7 +57,7 @@ void __init xen_machine_kexec_setup_reso
  
        /* allocate xen_phys_cpus */
@@ -148,8 +161,8 @@ memmap= command line option.
        BUG_ON(xen_phys_cpus == NULL);
  
        /* fill in xen_phys_cpus with per-cpu crash note information */
---- sle11-2009-07-31.orig/drivers/xen/core/machine_reboot.c    2009-02-17 12:23:48.000000000 +0100
-+++ sle11-2009-07-31/drivers/xen/core/machine_reboot.c 2009-02-17 12:25:29.000000000 +0100
+--- sle11-2009-09-18.orig/drivers/xen/core/machine_reboot.c    2009-02-17 12:23:48.000000000 +0100
++++ sle11-2009-09-18/drivers/xen/core/machine_reboot.c 2009-02-17 12:25:29.000000000 +0100
 @@ -76,7 +76,7 @@ static void post_suspend(int suspend_can
        unsigned long shinfo_mfn;
        extern unsigned long max_pfn;