diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-09-16 03:29:09 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-16 03:43:07 -0400 |
commit | 5649b7c30316a51792808422ac03ee825d26aa5e (patch) | |
tree | 32d56a7e0dab8bbd423e2d1392057771aed2d929 /arch | |
parent | e3bbaa3cb6ac5a245e5ecc28b09f9b7b93b2dd8a (diff) |
x86: add DMI quirk for AMI BIOS which corrupts address 0xc000 during resume
Alan Jenkins and Andy Wettstein reported a suspend/resume memory
corruption bug and extensively documented it here:
http://bugzilla.kernel.org/show_bug.cgi?id=11237
The bug is that the BIOS overwrites 1K of memory at 0xc000 physical,
without registering it in e820 as reserved or giving the kernel any
idea about this.
Detect AMI BIOSen and reserve that 1K.
We paint this bug around with a very broad brush (reserving that 1K on all
AMI BIOS systems), as the bug was extremely hard to find and needed several
weeks and lots of debugging and patching.
The bug was found via the CONFIG_X86_CHECK_BIOS_CORRUPTION=y debug feature,
if similar bugs are suspected then this feature can be enabled on other
systems as well to scan low memory for corrupted memory.
Reported-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Reported-by: Andy Wettstein <ajw1980@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/setup.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index ec7e56c1b984..3109ca37a67c 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -729,6 +729,29 @@ void start_periodic_check_for_corruption(void) | |||
729 | } | 729 | } |
730 | #endif | 730 | #endif |
731 | 731 | ||
732 | static int __init dmi_low_memory_corruption(const struct dmi_system_id *d) | ||
733 | { | ||
734 | printk(KERN_NOTICE | ||
735 | "%s detected: BIOS corrupts 0xc000, working it around.\n", | ||
736 | d->ident); | ||
737 | |||
738 | reserve_early(0xc000, 0xc400, "BIOS quirk"); | ||
739 | |||
740 | return 0; | ||
741 | } | ||
742 | |||
743 | /* List of systems that have known low memory corruption BIOS problems */ | ||
744 | static struct dmi_system_id __initdata bad_bios_dmi_table[] = { | ||
745 | { | ||
746 | .callback = dmi_low_memory_corruption, | ||
747 | .ident = "AMI BIOS", | ||
748 | .matches = { | ||
749 | DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."), | ||
750 | }, | ||
751 | }, | ||
752 | {} | ||
753 | }; | ||
754 | |||
732 | /* | 755 | /* |
733 | * Determine if we were loaded by an EFI loader. If so, then we have also been | 756 | * Determine if we were loaded by an EFI loader. If so, then we have also been |
734 | * passed the efi memmap, systab, etc., so we should use these data structures | 757 | * passed the efi memmap, systab, etc., so we should use these data structures |
@@ -752,6 +775,8 @@ void __init setup_arch(char **cmdline_p) | |||
752 | printk(KERN_INFO "Command line: %s\n", boot_command_line); | 775 | printk(KERN_INFO "Command line: %s\n", boot_command_line); |
753 | #endif | 776 | #endif |
754 | 777 | ||
778 | dmi_check_system(bad_bios_dmi_table); | ||
779 | |||
755 | early_cpu_init(); | 780 | early_cpu_init(); |
756 | early_ioremap_init(); | 781 | early_ioremap_init(); |
757 | 782 | ||
@@ -1037,3 +1062,5 @@ void __init setup_arch(char **cmdline_p) | |||
1037 | #endif | 1062 | #endif |
1038 | #endif | 1063 | #endif |
1039 | } | 1064 | } |
1065 | |||
1066 | |||