diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-02-21 05:04:11 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-02-26 06:55:56 -0500 |
commit | 88f3aec7afd9ae3e6f6d221801996b69aad1e3a4 (patch) | |
tree | 676a32c7bd248a15f2926bc6dcd03ace4971d442 /arch/x86/kernel | |
parent | 3b57bc461fd5019aef4cfc77d4faf56ebe95449c (diff) |
x86: fix spontaneous reboot with allyesconfig bzImage
recently the 64-bit allyesconfig bzImage kernel started spontaneously
rebooting during early bootup.
after a few fun hours spent with early init debugging, it turns out
that we've got this rather annoying limit on the size of the kernel
image:
#define KERNEL_TEXT_SIZE (40*1024*1024)
which limit my vmlinux just happened to pass:
text data bss dec hex filename
29703744 4222751 8646224 42572719 2899baf vmlinux
40 MB is 42572719 bytes, so my vmlinux was just 1.5% above this limit :-/
So it happily crashed right in head_64.S, which - as we all know - is
the most debuggable code in the whole architecture ;-)
So increase the limit to allow an up to 128MB kernel image to be mapped.
(should anyone be that crazy or lazy)
We have a full 4K of pagetable (level2_kernel_pgt) allocated for these
mappings already, so there's no RAM overhead and the limit was rather
pointless and arbitrary.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/head_64.S | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index eb415043a929..b037b15be7f8 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S | |||
@@ -379,18 +379,24 @@ NEXT_PAGE(level2_ident_pgt) | |||
379 | /* Since I easily can, map the first 1G. | 379 | /* Since I easily can, map the first 1G. |
380 | * Don't set NX because code runs from these pages. | 380 | * Don't set NX because code runs from these pages. |
381 | */ | 381 | */ |
382 | PMDS(0x0000000000000000, __PAGE_KERNEL_LARGE_EXEC, PTRS_PER_PMD) | 382 | PMDS(0, __PAGE_KERNEL_LARGE_EXEC, PTRS_PER_PMD) |
383 | 383 | ||
384 | NEXT_PAGE(level2_kernel_pgt) | 384 | NEXT_PAGE(level2_kernel_pgt) |
385 | /* 40MB kernel mapping. The kernel code cannot be bigger than that. | 385 | /* |
386 | When you change this change KERNEL_TEXT_SIZE in page.h too. */ | 386 | * 128 MB kernel mapping. We spend a full page on this pagetable |
387 | /* (2^48-(2*1024*1024*1024)-((2^39)*511)-((2^30)*510)) = 0 */ | 387 | * anyway. |
388 | PMDS(0x0000000000000000, __PAGE_KERNEL_LARGE_EXEC|_PAGE_GLOBAL, KERNEL_TEXT_SIZE/PMD_SIZE) | 388 | * |
389 | /* Module mapping starts here */ | 389 | * The kernel code+data+bss must not be bigger than that. |
390 | .fill (PTRS_PER_PMD - (KERNEL_TEXT_SIZE/PMD_SIZE)),8,0 | 390 | * |
391 | * (NOTE: at +128MB starts the module area, see MODULES_VADDR. | ||
392 | * If you want to increase this then increase MODULES_VADDR | ||
393 | * too.) | ||
394 | */ | ||
395 | PMDS(0, __PAGE_KERNEL_LARGE_EXEC|_PAGE_GLOBAL, | ||
396 | KERNEL_TEXT_SIZE/PMD_SIZE) | ||
391 | 397 | ||
392 | NEXT_PAGE(level2_spare_pgt) | 398 | NEXT_PAGE(level2_spare_pgt) |
393 | .fill 512,8,0 | 399 | .fill 512, 8, 0 |
394 | 400 | ||
395 | #undef PMDS | 401 | #undef PMDS |
396 | #undef NEXT_PAGE | 402 | #undef NEXT_PAGE |