]> Pileus Git - ~andy/linux/commitdiff
Merge branch 'linus' into x86/mm
authorThomas Gleixner <tglx@linutronix.de>
Wed, 17 Feb 2010 17:27:37 +0000 (18:27 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 17 Feb 2010 17:28:05 +0000 (18:28 +0100)
x86/mm is on 32-rc4 and missing the spinlock namespace changes which
are needed for further commits into this topic.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/mips/mm/init.c
arch/score/mm/init.c
arch/x86/include/asm/page_types.h
arch/x86/kernel/e820.c
arch/x86/kernel/setup.c
arch/x86/mm/ioremap.c
include/linux/mm.h
kernel/resource.c

index 1651942f7febe79eeea81927f34264e01c7c4217..dee564aad23a8ae49a380f383ff92d8ee5cadaaf 100644 (file)
@@ -298,7 +298,7 @@ void __init fixrange_init(unsigned long start, unsigned long end,
 }
 
 #ifndef CONFIG_NEED_MULTIPLE_NODES
-static int __init page_is_ram(unsigned long pagenr)
+int page_is_ram(unsigned long pagenr)
 {
        int i;
 
index dfaf458d6702459ba9b5f85d7be5e30b1528a2ba..7f001bbedb00a463d0746c2690421eec1df5bf3a 100644 (file)
@@ -59,7 +59,7 @@ static unsigned long setup_zero_page(void)
 }
 
 #ifndef CONFIG_NEED_MULTIPLE_NODES
-static int __init page_is_ram(unsigned long pagenr)
+int page_is_ram(unsigned long pagenr)
 {
        if (pagenr >= min_low_pfn && pagenr < max_low_pfn)
                return 1;
index 642fe34b36a2014806f282b42cd7fd50d33374d9..a667f24c72549e6c8171892fc6fbf63ac54006d0 100644 (file)
@@ -40,7 +40,6 @@
 
 #ifndef __ASSEMBLY__
 
-extern int page_is_ram(unsigned long pagenr);
 extern int devmem_is_allowed(unsigned long pagenr);
 
 extern unsigned long max_low_pfn_mapped;
index a1a7876cadcbfa2b0fdbfa9d9416ee62c14cd85c..a966b753e4961446863f9e4c114f8315cedff274 100644 (file)
@@ -517,11 +517,19 @@ u64 __init e820_remove_range(u64 start, u64 size, unsigned old_type,
                             int checktype)
 {
        int i;
+       u64 end;
        u64 real_removed_size = 0;
 
        if (size > (ULLONG_MAX - start))
                size = ULLONG_MAX - start;
 
+       end = start + size;
+       printk(KERN_DEBUG "e820 remove range: %016Lx - %016Lx ",
+                      (unsigned long long) start,
+                      (unsigned long long) end);
+       e820_print_type(old_type);
+       printk(KERN_CONT "\n");
+
        for (i = 0; i < e820.nr_map; i++) {
                struct e820entry *ei = &e820.map[i];
                u64 final_start, final_end;
index 5d9e40c58628ca2509c2e16718518dda9dac4149..3499b4fabc94b58aca76651c0fc7e297f6571cb0 100644 (file)
@@ -667,6 +667,23 @@ static struct dmi_system_id __initdata bad_bios_dmi_table[] = {
        {}
 };
 
+static void __init trim_bios_range(void)
+{
+       /*
+        * A special case is the first 4Kb of memory;
+        * This is a BIOS owned area, not kernel ram, but generally
+        * not listed as such in the E820 table.
+        */
+       e820_update_range(0, PAGE_SIZE, E820_RAM, E820_RESERVED);
+       /*
+        * special case: Some BIOSen report the PC BIOS
+        * area (640->1Mb) as ram even though it is not.
+        * take them out.
+        */
+       e820_remove_range(BIOS_BEGIN, BIOS_END - BIOS_BEGIN, E820_RAM, 1);
+       sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
+}
+
 /*
  * Determine if we were loaded by an EFI loader.  If so, then we have also been
  * passed the efi memmap, systab, etc., so we should use these data structures
@@ -830,7 +847,7 @@ void __init setup_arch(char **cmdline_p)
        insert_resource(&iomem_resource, &data_resource);
        insert_resource(&iomem_resource, &bss_resource);
 
-
+       trim_bios_range();
 #ifdef CONFIG_X86_32
        if (ppro_with_ram_bug()) {
                e820_update_range(0x70000000ULL, 0x40000ULL, E820_RAM,
index c246d259822d8b5a3d32a35275368a5bcbbf19b8..e404ffe302105f3a7a38107fc4d4e23286799594 100644 (file)
 
 #include "physaddr.h"
 
-int page_is_ram(unsigned long pagenr)
-{
-       resource_size_t addr, end;
-       int i;
-
-       /*
-        * A special case is the first 4Kb of memory;
-        * This is a BIOS owned area, not kernel ram, but generally
-        * not listed as such in the E820 table.
-        */
-       if (pagenr == 0)
-               return 0;
-
-       /*
-        * Second special case: Some BIOSen report the PC BIOS
-        * area (640->1Mb) as ram even though it is not.
-        */
-       if (pagenr >= (BIOS_BEGIN >> PAGE_SHIFT) &&
-                   pagenr < (BIOS_END >> PAGE_SHIFT))
-               return 0;
-
-       for (i = 0; i < e820.nr_map; i++) {
-               /*
-                * Not usable memory:
-                */
-               if (e820.map[i].type != E820_RAM)
-                       continue;
-               addr = (e820.map[i].addr + PAGE_SIZE-1) >> PAGE_SHIFT;
-               end = (e820.map[i].addr + e820.map[i].size) >> PAGE_SHIFT;
-
-
-               if ((pagenr >= addr) && (pagenr < end))
-                       return 1;
-       }
-       return 0;
-}
-
 /*
  * Fix up the linear direct mapping of the kernel to avoid cache attribute
  * conflicts.
index 60c467bfbabd66dbd295721c5afb9cb39b47594d..8b2fa8593c61935f36ffa128d72c7236c198e119 100644 (file)
@@ -265,6 +265,8 @@ static inline int get_page_unless_zero(struct page *page)
        return atomic_inc_not_zero(&page->_count);
 }
 
+extern int page_is_ram(unsigned long pfn);
+
 /* Support for virtually mapped pages */
 struct page *vmalloc_to_page(const void *addr);
 unsigned long vmalloc_to_pfn(const void *addr);
index af96c1e4b54b11b27fe445b834e3106b5b76b472..03c897f7935e100276e41ed83e1e3af3f549bbd9 100644 (file)
@@ -297,6 +297,19 @@ int walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
 
 #endif
 
+static int __is_ram(unsigned long pfn, unsigned long nr_pages, void *arg)
+{
+       return 1;
+}
+/*
+ * This generic page_is_ram() returns true if specified address is
+ * registered as "System RAM" in iomem_resource list.
+ */
+int __weak page_is_ram(unsigned long pfn)
+{
+       return walk_system_ram_range(pfn, 1, NULL, __is_ram) == 1;
+}
+
 /*
  * Find empty slot in the resource tree given range and alignment.
  */