Skip to content

Commit

Permalink
x86-32: compute initial mapping size more accurately
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yinghai Lu authored and H. Peter Anvin committed Mar 15, 2009
1 parent 6de6cb4 commit 7543c1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions arch/x86/include/asm/page_32_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
#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__

/*
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/head_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7543c1d

Please sign in to comment.