aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-08-24 20:32:04 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2010-08-24 20:32:04 -0400
commitd0cd7425fab774a480cce17c2f649984312d0b55 (patch)
treec52d913ae9987b9648f89b696819cfc93dfb3229 /arch/x86/kernel/setup.c
parent76be97c1fc945db08aae1f1b746012662d643e97 (diff)
x86, bios: By default, reserve the low 64K for all BIOSes
The laundry list of BIOSes that need the low 64K reserved is getting very long, so make it the default across all BIOSes. This also allows the code to be simplified and unified with the reservation code for the first 4K. This resolves kernel bugzilla 16661 and who knows what else... Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> LKML-Reference: <tip-*@git.kernel.org>
Diffstat (limited to 'arch/x86/kernel/setup.c')
-rw-r--r--arch/x86/kernel/setup.c84
1 files changed, 7 insertions, 77 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index c3a4fbb2b996..eb87f1c83f91 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -618,88 +618,20 @@ static __init void reserve_ibft_region(void)
618 reserve_early_overlap_ok(addr, addr + size, "ibft"); 618 reserve_early_overlap_ok(addr, addr + size, "ibft");
619} 619}
620 620
621#ifdef CONFIG_X86_RESERVE_LOW_64K
622static int __init dmi_low_memory_corruption(const struct dmi_system_id *d)
623{
624 printk(KERN_NOTICE
625 "%s detected: BIOS may corrupt low RAM, working around it.\n",
626 d->ident);
627
628 e820_update_range(0, 0x10000, E820_RAM, E820_RESERVED);
629 sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
630
631 return 0;
632}
633#endif
634
635/* List of systems that have known low memory corruption BIOS problems */
636static struct dmi_system_id __initdata bad_bios_dmi_table[] = {
637#ifdef CONFIG_X86_RESERVE_LOW_64K
638 {
639 .callback = dmi_low_memory_corruption,
640 .ident = "AMI BIOS",
641 .matches = {
642 DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
643 },
644 },
645 {
646 .callback = dmi_low_memory_corruption,
647 .ident = "Phoenix BIOS",
648 .matches = {
649 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies"),
650 },
651 },
652 {
653 .callback = dmi_low_memory_corruption,
654 .ident = "Phoenix/MSC BIOS",
655 .matches = {
656 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix/MSC"),
657 },
658 },
659 /*
660 * AMI BIOS with low memory corruption was found on Intel DG45ID and
661 * DG45FC boards.
662 * It has a different DMI_BIOS_VENDOR = "Intel Corp.", for now we will
663 * match only DMI_BOARD_NAME and see if there is more bad products
664 * with this vendor.
665 */
666 {
667 .callback = dmi_low_memory_corruption,
668 .ident = "AMI BIOS",
669 .matches = {
670 DMI_MATCH(DMI_BOARD_NAME, "DG45ID"),
671 },
672 },
673 {
674 .callback = dmi_low_memory_corruption,
675 .ident = "AMI BIOS",
676 .matches = {
677 DMI_MATCH(DMI_BOARD_NAME, "DG45FC"),
678 },
679 },
680 /*
681 * The Dell Inspiron Mini 1012 has DMI_BIOS_VENDOR = "Dell Inc.", so
682 * match on the product name.
683 */
684 {
685 .callback = dmi_low_memory_corruption,
686 .ident = "Phoenix BIOS",
687 .matches = {
688 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1012"),
689 },
690 },
691#endif
692 {}
693};
694
695static void __init trim_bios_range(void) 621static void __init trim_bios_range(void)
696{ 622{
697 /* 623 /*
698 * A special case is the first 4Kb of memory; 624 * A special case is the first 4Kb of memory;
699 * This is a BIOS owned area, not kernel ram, but generally 625 * This is a BIOS owned area, not kernel ram, but generally
700 * not listed as such in the E820 table. 626 * not listed as such in the E820 table.
627 *
628 * This typically reserves additional memory (64KiB by default)
629 * since some BIOSes are known to corrupt low memory. See the
630 * Kconfig help text for X86_LOW_RESERVE.
701 */ 631 */
702 e820_update_range(0, PAGE_SIZE, E820_RAM, E820_RESERVED); 632 e820_update_range(0, ALIGN(CONFIG_X86_LOW_RESERVE << 10, PAGE_SIZE),
633 E820_RAM, E820_RESERVED);
634
703 /* 635 /*
704 * special case: Some BIOSen report the PC BIOS 636 * special case: Some BIOSen report the PC BIOS
705 * area (640->1Mb) as ram even though it is not. 637 * area (640->1Mb) as ram even though it is not.
@@ -863,8 +795,6 @@ void __init setup_arch(char **cmdline_p)
863 795
864 dmi_scan_machine(); 796 dmi_scan_machine();
865 797
866 dmi_check_system(bad_bios_dmi_table);
867
868 /* 798 /*
869 * VMware detection requires dmi to be available, so this 799 * VMware detection requires dmi to be available, so this
870 * needs to be done after dmi_scan_machine, for the BP. 800 * needs to be done after dmi_scan_machine, for the BP.