]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
x86-32: compute initial mapping size more accurately
authorYinghai Lu <yinghai@kernel.org>
Thu, 12 Mar 2009 23:04:42 +0000 (16:04 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Sun, 15 Mar 2009 00:23:47 +0000 (17:23 -0700)
Impact: simplification

We only need to map the kernel in head_32.S, not the whole of
lowmem.  We use 512MB as a reasonable (but arbitrary) limit on
the maximum size of the kernel image.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
arch/x86/include/asm/page_32_types.h
arch/x86/kernel/head_32.S

index f1e4a79a6e415702ab6930cedce937afc3e71d54..0f915ae649a717e99ebdfc079652b25fda315e72 100644 (file)
 #define __VIRTUAL_MASK_SHIFT   32
 #endif /* CONFIG_X86_PAE */
 
+/*
+ * Kernel image size is limited to 512 MB (see in arch/x86/kernel/head_32.S)
+ */
+#define KERNEL_IMAGE_SIZE      (512 * 1024 * 1024)
+
 #ifndef __ASSEMBLY__
 
 /*
index db6652710e98a3e9aaa5cd7bfe12238fd022d638..3ce5456dfbe6b091f3ccd2a9ab28cf0cc0ac3fd6 100644 (file)
@@ -54,7 +54,7 @@
  *
  * This should be a multiple of a page.
  */
-LOW_PAGES = 1<<(32-PAGE_SHIFT_asm)
+LOW_PAGES = (KERNEL_IMAGE_SIZE + PAGE_SIZE_asm - 1)>>PAGE_SHIFT
 
 /*
  * To preserve the DMA pool in PAGEALLOC kernels, we'll allocate