aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup.c
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2010-01-21 22:21:04 -0500
committerH. Peter Anvin <hpa@zytor.com>2010-02-01 19:58:17 -0500
commit1b5576e69a5fe168c08a159685ac366316ac9bbc (patch)
tree0f5948f32578e1b74edb86ff8008ef42faa7f32f /arch/x86/kernel/setup.c
parent53df8fdc15fb646b0219e43c989c2cdab1ab100c (diff)
x86: Remove BIOS data range from e820
In preparation for moving to the generic page_is_ram(), make explicit what we expect to be reserved and not reserved. Tested-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Yinghai Lu <yinghai@kernel.org> LKML-Reference: <20100122033004.335813103@intel.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/kernel/setup.c')
-rw-r--r--arch/x86/kernel/setup.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index cdb6a8a506dd..f9b1f4e5ab74 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -650,6 +650,23 @@ static struct dmi_system_id __initdata bad_bios_dmi_table[] = {
650 {} 650 {}
651}; 651};
652 652
653static void __init trim_bios_range(void)
654{
655 /*
656 * A special case is the first 4Kb of memory;
657 * This is a BIOS owned area, not kernel ram, but generally
658 * not listed as such in the E820 table.
659 */
660 e820_update_range(0, PAGE_SIZE, E820_RAM, E820_RESERVED);
661 /*
662 * special case: Some BIOSen report the PC BIOS
663 * area (640->1Mb) as ram even though it is not.
664 * take them out.
665 */
666 e820_remove_range(BIOS_BEGIN, BIOS_END - BIOS_BEGIN, E820_RAM, 1);
667 sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
668}
669
653/* 670/*
654 * Determine if we were loaded by an EFI loader. If so, then we have also been 671 * Determine if we were loaded by an EFI loader. If so, then we have also been
655 * passed the efi memmap, systab, etc., so we should use these data structures 672 * passed the efi memmap, systab, etc., so we should use these data structures
@@ -813,7 +830,7 @@ void __init setup_arch(char **cmdline_p)
813 insert_resource(&iomem_resource, &data_resource); 830 insert_resource(&iomem_resource, &data_resource);
814 insert_resource(&iomem_resource, &bss_resource); 831 insert_resource(&iomem_resource, &bss_resource);
815 832
816 833 trim_bios_range();
817#ifdef CONFIG_X86_32 834#ifdef CONFIG_X86_32
818 if (ppro_with_ram_bug()) { 835 if (ppro_with_ram_bug()) {
819 e820_update_range(0x70000000ULL, 0x40000ULL, E820_RAM, 836 e820_update_range(0x70000000ULL, 0x40000ULL, E820_RAM,