aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2008-09-07 04:51:33 -0400
committerIngo Molnar <mingo@elte.hu>2008-09-07 11:40:00 -0400
commitbb577f980ef35e2b0d00aeed566724e5032aa5eb (patch)
tree2c9016f7811fb3ea80bbbc8d9856c217110695b7
parent5394f80f92642c61fc2a95385be85f2fdcfb5adb (diff)
x86: add periodic corruption check
Perodically check for corruption in low phusical memory. Don't bother checking at fault time, since it won't show anything useful. Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/setup.c17
-rw-r--r--arch/x86/mm/fault.c2
-rw-r--r--arch/x86/mm/init_32.c2
-rw-r--r--arch/x86/mm/init_64.c2
-rw-r--r--include/linux/kernel.h1
5 files changed, 22 insertions, 2 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index ee89ebc5aabc..c239b3780973 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -623,6 +623,7 @@ static void __init setup_bios_corruption_check(void)
623} 623}
624 624
625static int __read_mostly bios_corruption_check = 1; 625static int __read_mostly bios_corruption_check = 1;
626static struct timer_list periodic_check_timer;
626 627
627void check_for_bios_corruption(void) 628void check_for_bios_corruption(void)
628{ 629{
@@ -650,6 +651,22 @@ void check_for_bios_corruption(void)
650 dump_stack(); 651 dump_stack();
651} 652}
652 653
654static void periodic_check_for_corruption(unsigned long data)
655{
656 check_for_bios_corruption();
657 mod_timer(&periodic_check_timer, jiffies + 60*HZ);
658}
659
660void start_periodic_check_for_corruption(void)
661{
662 if (!bios_corruption_check)
663 return;
664
665 init_timer(&periodic_check_timer);
666 periodic_check_timer.function = &periodic_check_for_corruption;
667 periodic_check_for_corruption(0);
668}
669
653static int set_bios_corruption_check(char *arg) 670static int set_bios_corruption_check(char *arg)
654{ 671{
655 char *end; 672 char *end;
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 5140bdf03020..455f3fe67b42 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -848,8 +848,6 @@ no_context:
848 * Oops. The kernel tried to access some bad page. We'll have to 848 * Oops. The kernel tried to access some bad page. We'll have to
849 * terminate things with extreme prejudice. 849 * terminate things with extreme prejudice.
850 */ 850 */
851 check_for_bios_corruption();
852
853#ifdef CONFIG_X86_32 851#ifdef CONFIG_X86_32
854 bust_spinlocks(1); 852 bust_spinlocks(1);
855#else 853#else
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index d37f29376b0c..657a16ad61ba 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -907,6 +907,8 @@ void __init mem_init(void)
907 int codesize, reservedpages, datasize, initsize; 907 int codesize, reservedpages, datasize, initsize;
908 int tmp; 908 int tmp;
909 909
910 start_periodic_check_for_corruption();
911
910#ifdef CONFIG_FLATMEM 912#ifdef CONFIG_FLATMEM
911 BUG_ON(!mem_map); 913 BUG_ON(!mem_map);
912#endif 914#endif
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index d3746efb060d..f4db5276fa21 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -769,6 +769,8 @@ void __init mem_init(void)
769{ 769{
770 long codesize, reservedpages, datasize, initsize; 770 long codesize, reservedpages, datasize, initsize;
771 771
772 start_periodic_check_for_corruption();
773
772 pci_iommu_alloc(); 774 pci_iommu_alloc();
773 775
774 /* clear_bss() already clear the empty_zero_page */ 776 /* clear_bss() already clear the empty_zero_page */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 8017129e6b63..00bb251c6451 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -246,6 +246,7 @@ extern int root_mountflags;
246 * able to scatter it around anywhere in the kernel. 246 * able to scatter it around anywhere in the kernel.
247 */ 247 */
248void check_for_bios_corruption(void); 248void check_for_bios_corruption(void);
249void start_periodic_check_for_corruption(void);
249#else 250#else
250static inline void check_for_bios_corruption(void) 251static inline void check_for_bios_corruption(void)
251{ 252{