ARM: 5929/1: Add checks to detect overlap of memory regions.
authorFenkart/Bostandzhyan <andreas.fenkart@streamunlimited.com>
Sun, 7 Feb 2010 20:47:58 +0000 (21:47 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 15 Feb 2010 21:40:33 +0000 (21:40 +0000)
Tested-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mm/init.c

index 3a20772394741453034dee7d0ebbec7164c54dfb..7829cb5425f56e460a62390158114db98f4acc10 100644 (file)
@@ -686,6 +686,23 @@ void __init mem_init(void)
 #undef MLM
 #undef MLK_ROUNDUP
 
+       /*
+        * Check boundaries twice: Some fundamental inconsistencies can
+        * be detected at build time already.
+        */
+#ifdef CONFIG_MMU
+       BUILD_BUG_ON(VMALLOC_END                        > CONSISTENT_BASE);
+       BUG_ON(VMALLOC_END                              > CONSISTENT_BASE);
+
+       BUILD_BUG_ON(TASK_SIZE                          > MODULES_VADDR);
+       BUG_ON(TASK_SIZE                                > MODULES_VADDR);
+#endif
+
+#ifdef CONFIG_HIGHMEM
+       BUILD_BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE > PAGE_OFFSET);
+       BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE      > PAGE_OFFSET);
+#endif
+
        if (PAGE_SIZE >= 16384 && num_physpages <= 128) {
                extern int sysctl_overcommit_memory;
                /*