aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup.c
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2010-10-25 10:28:14 -0400
committerRobert Richter <robert.richter@amd.com>2010-10-25 10:29:12 -0400
commitdbd1e66e04558a582e673bc4a9cd933ce0228d93 (patch)
tree85f3633276282cde0a3ac558d988704eaa3e68af /arch/x86/kernel/setup.c
parent328b8f1ba50b708a1b3c0acd7c41ee1b356822f6 (diff)
parent4a60cfa9457749f7987fd4f3c956dbba5a281129 (diff)
Merge commit 'linux-2.6/master' (early part) into oprofile/core
This branch depends on these apic patches: apic, x86: Use BIOS settings for IBS and MCE threshold interrupt LVT offsets apic, x86: Check if EILVT APIC registers are available (AMD only) Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'arch/x86/kernel/setup.c')
-rw-r--r--arch/x86/kernel/setup.c121
1 files changed, 35 insertions, 86 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 00e167870f71..a59f6a6df5e2 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -83,7 +83,6 @@
83#include <asm/dmi.h> 83#include <asm/dmi.h>
84#include <asm/io_apic.h> 84#include <asm/io_apic.h>
85#include <asm/ist.h> 85#include <asm/ist.h>
86#include <asm/vmi.h>
87#include <asm/setup_arch.h> 86#include <asm/setup_arch.h>
88#include <asm/bios_ebda.h> 87#include <asm/bios_ebda.h>
89#include <asm/cacheflush.h> 88#include <asm/cacheflush.h>
@@ -107,7 +106,7 @@
107#include <asm/percpu.h> 106#include <asm/percpu.h>
108#include <asm/topology.h> 107#include <asm/topology.h>
109#include <asm/apicdef.h> 108#include <asm/apicdef.h>
110#include <asm/k8.h> 109#include <asm/amd_nb.h>
111#ifdef CONFIG_X86_64 110#ifdef CONFIG_X86_64
112#include <asm/numa_64.h> 111#include <asm/numa_64.h>
113#endif 112#endif
@@ -126,7 +125,6 @@ unsigned long max_pfn_mapped;
126RESERVE_BRK(dmi_alloc, 65536); 125RESERVE_BRK(dmi_alloc, 65536);
127#endif 126#endif
128 127
129unsigned int boot_cpu_id __read_mostly;
130 128
131static __initdata unsigned long _brk_start = (unsigned long)__brk_base; 129static __initdata unsigned long _brk_start = (unsigned long)__brk_base;
132unsigned long _brk_end = (unsigned long)__brk_base; 130unsigned long _brk_end = (unsigned long)__brk_base;
@@ -619,79 +617,7 @@ static __init void reserve_ibft_region(void)
619 reserve_early_overlap_ok(addr, addr + size, "ibft"); 617 reserve_early_overlap_ok(addr, addr + size, "ibft");
620} 618}
621 619
622#ifdef CONFIG_X86_RESERVE_LOW_64K 620static unsigned reserve_low = CONFIG_X86_RESERVE_LOW << 10;
623static int __init dmi_low_memory_corruption(const struct dmi_system_id *d)
624{
625 printk(KERN_NOTICE
626 "%s detected: BIOS may corrupt low RAM, working around it.\n",
627 d->ident);
628
629 e820_update_range(0, 0x10000, E820_RAM, E820_RESERVED);
630 sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
631
632 return 0;
633}
634#endif
635
636/* List of systems that have known low memory corruption BIOS problems */
637static struct dmi_system_id __initdata bad_bios_dmi_table[] = {
638#ifdef CONFIG_X86_RESERVE_LOW_64K
639 {
640 .callback = dmi_low_memory_corruption,
641 .ident = "AMI BIOS",
642 .matches = {
643 DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
644 },
645 },
646 {
647 .callback = dmi_low_memory_corruption,
648 .ident = "Phoenix BIOS",
649 .matches = {
650 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies"),
651 },
652 },
653 {
654 .callback = dmi_low_memory_corruption,
655 .ident = "Phoenix/MSC BIOS",
656 .matches = {
657 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix/MSC"),
658 },
659 },
660 /*
661 * AMI BIOS with low memory corruption was found on Intel DG45ID and
662 * DG45FC boards.
663 * It has a different DMI_BIOS_VENDOR = "Intel Corp.", for now we will
664 * match only DMI_BOARD_NAME and see if there is more bad products
665 * with this vendor.
666 */
667 {
668 .callback = dmi_low_memory_corruption,
669 .ident = "AMI BIOS",
670 .matches = {
671 DMI_MATCH(DMI_BOARD_NAME, "DG45ID"),
672 },
673 },
674 {
675 .callback = dmi_low_memory_corruption,
676 .ident = "AMI BIOS",
677 .matches = {
678 DMI_MATCH(DMI_BOARD_NAME, "DG45FC"),
679 },
680 },
681 /*
682 * The Dell Inspiron Mini 1012 has DMI_BIOS_VENDOR = "Dell Inc.", so
683 * match on the product name.
684 */
685 {
686 .callback = dmi_low_memory_corruption,
687 .ident = "Phoenix BIOS",
688 .matches = {
689 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1012"),
690 },
691 },
692#endif
693 {}
694};
695 621
696static void __init trim_bios_range(void) 622static void __init trim_bios_range(void)
697{ 623{
@@ -699,8 +625,14 @@ static void __init trim_bios_range(void)
699 * A special case is the first 4Kb of memory; 625 * A special case is the first 4Kb of memory;
700 * This is a BIOS owned area, not kernel ram, but generally 626 * This is a BIOS owned area, not kernel ram, but generally
701 * not listed as such in the E820 table. 627 * not listed as such in the E820 table.
628 *
629 * This typically reserves additional memory (64KiB by default)
630 * since some BIOSes are known to corrupt low memory. See the
631 * Kconfig help text for X86_RESERVE_LOW.
702 */ 632 */
703 e820_update_range(0, PAGE_SIZE, E820_RAM, E820_RESERVED); 633 e820_update_range(0, ALIGN(reserve_low, PAGE_SIZE),
634 E820_RAM, E820_RESERVED);
635
704 /* 636 /*
705 * special case: Some BIOSen report the PC BIOS 637 * special case: Some BIOSen report the PC BIOS
706 * area (640->1Mb) as ram even though it is not. 638 * area (640->1Mb) as ram even though it is not.
@@ -710,6 +642,28 @@ static void __init trim_bios_range(void)
710 sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); 642 sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
711} 643}
712 644
645static int __init parse_reservelow(char *p)
646{
647 unsigned long long size;
648
649 if (!p)
650 return -EINVAL;
651
652 size = memparse(p, &p);
653
654 if (size < 4096)
655 size = 4096;
656
657 if (size > 640*1024)
658 size = 640*1024;
659
660 reserve_low = size;
661
662 return 0;
663}
664
665early_param("reservelow", parse_reservelow);
666
713/* 667/*
714 * Determine if we were loaded by an EFI loader. If so, then we have also been 668 * Determine if we were loaded by an EFI loader. If so, then we have also been
715 * passed the efi memmap, systab, etc., so we should use these data structures 669 * passed the efi memmap, systab, etc., so we should use these data structures
@@ -736,10 +690,10 @@ void __init setup_arch(char **cmdline_p)
736 printk(KERN_INFO "Command line: %s\n", boot_command_line); 690 printk(KERN_INFO "Command line: %s\n", boot_command_line);
737#endif 691#endif
738 692
739 /* VMI may relocate the fixmap; do this before touching ioremap area */ 693 /*
740 vmi_init(); 694 * If we have OLPC OFW, we might end up relocating the fixmap due to
741 695 * reserve_top(), so do this before touching the ioremap area.
742 /* OFW also may relocate the fixmap */ 696 */
743 olpc_ofw_detect(); 697 olpc_ofw_detect();
744 698
745 early_trap_init(); 699 early_trap_init();
@@ -840,9 +794,6 @@ void __init setup_arch(char **cmdline_p)
840 794
841 x86_report_nx(); 795 x86_report_nx();
842 796
843 /* Must be before kernel pagetables are setup */
844 vmi_activate();
845
846 /* after early param, so could get panic from serial */ 797 /* after early param, so could get panic from serial */
847 reserve_early_setup_data(); 798 reserve_early_setup_data();
848 799
@@ -865,8 +816,6 @@ void __init setup_arch(char **cmdline_p)
865 816
866 dmi_scan_machine(); 817 dmi_scan_machine();
867 818
868 dmi_check_system(bad_bios_dmi_table);
869
870 /* 819 /*
871 * VMware detection requires dmi to be available, so this 820 * VMware detection requires dmi to be available, so this
872 * needs to be done after dmi_scan_machine, for the BP. 821 * needs to be done after dmi_scan_machine, for the BP.