diff options
author | Yinghai Lu <Yinghai.Lu@Sun.COM> | 2008-01-30 07:33:32 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:33:32 -0500 |
commit | 093af8d7f0ba3c6be1485973508584ef081e9f93 (patch) | |
tree | 0a2db2401e09764e654efafbea60f6d5d6894dcd /arch/x86/kernel/setup_32.c | |
parent | 11201e603d28a1cb7a4bb1d65f39e61629c97a28 (diff) |
x86_32: trim memory by updating e820
when MTRRs are not covering the whole e820 table, we need to trim the
RAM and need to update e820.
reuse some code on 64-bit as well.
here need to add early_get_cap and use it in early_cpu_detect, and move
mtrr_bp_init early.
The code successfully trimmed the memory map on Justin's system:
from:
[ 0.000000] BIOS-e820: 0000000100000000 - 000000022c000000 (usable)
to:
[ 0.000000] modified: 0000000100000000 - 0000000228000000 (usable)
[ 0.000000] modified: 0000000228000000 - 000000022c000000 (reserved)
According to Justin it makes quite a difference:
| When I boot the box without any trimming it acts like a 286 or 386,
| takes about 10 minutes to boot (using raptor disks).
Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Tested-by: Justin Piszcz <jpiszcz@lucidpixels.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/setup_32.c')
-rw-r--r-- | arch/x86/kernel/setup_32.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c index 26a56f714d34..83ba3ca5f431 100644 --- a/arch/x86/kernel/setup_32.c +++ b/arch/x86/kernel/setup_32.c | |||
@@ -48,6 +48,7 @@ | |||
48 | 48 | ||
49 | #include <video/edid.h> | 49 | #include <video/edid.h> |
50 | 50 | ||
51 | #include <asm/mtrr.h> | ||
51 | #include <asm/apic.h> | 52 | #include <asm/apic.h> |
52 | #include <asm/e820.h> | 53 | #include <asm/e820.h> |
53 | #include <asm/mpspec.h> | 54 | #include <asm/mpspec.h> |
@@ -758,6 +759,11 @@ void __init setup_arch(char **cmdline_p) | |||
758 | 759 | ||
759 | max_low_pfn = setup_memory(); | 760 | max_low_pfn = setup_memory(); |
760 | 761 | ||
762 | /* update e820 for memory not covered by WB MTRRs */ | ||
763 | mtrr_bp_init(); | ||
764 | if (mtrr_trim_uncached_memory(max_pfn)) | ||
765 | max_low_pfn = setup_memory(); | ||
766 | |||
761 | #ifdef CONFIG_VMI | 767 | #ifdef CONFIG_VMI |
762 | /* | 768 | /* |
763 | * Must be after max_low_pfn is determined, and before kernel | 769 | * Must be after max_low_pfn is determined, and before kernel |