Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113349
b: refs/heads/master
c: bb577f9
h: refs/heads/master
i:
  113347: d334617
v: v3
  • Loading branch information
Hugh Dickins authored and Ingo Molnar committed Sep 7, 2008
1 parent ea862fe commit 3dce2be
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5394f80f92642c61fc2a95385be85f2fdcfb5adb
refs/heads/master: bb577f980ef35e2b0d00aeed566724e5032aa5eb
17 changes: 17 additions & 0 deletions trunk/arch/x86/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ static void __init setup_bios_corruption_check(void)
}

static int __read_mostly bios_corruption_check = 1;
static struct timer_list periodic_check_timer;

void check_for_bios_corruption(void)
{
Expand Down Expand Up @@ -650,6 +651,22 @@ void check_for_bios_corruption(void)
dump_stack();
}

static void periodic_check_for_corruption(unsigned long data)
{
check_for_bios_corruption();
mod_timer(&periodic_check_timer, jiffies + 60*HZ);
}

void start_periodic_check_for_corruption(void)
{
if (!bios_corruption_check)
return;

init_timer(&periodic_check_timer);
periodic_check_timer.function = &periodic_check_for_corruption;
periodic_check_for_corruption(0);
}

static int set_bios_corruption_check(char *arg)
{
char *end;
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/x86/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,8 +848,6 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
* Oops. The kernel tried to access some bad page. We'll have to
* terminate things with extreme prejudice.
*/
check_for_bios_corruption();

#ifdef CONFIG_X86_32
bust_spinlocks(1);
#else
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/x86/mm/init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,8 @@ void __init mem_init(void)
int codesize, reservedpages, datasize, initsize;
int tmp;

start_periodic_check_for_corruption();

#ifdef CONFIG_FLATMEM
BUG_ON(!mem_map);
#endif
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/x86/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,8 @@ void __init mem_init(void)
{
long codesize, reservedpages, datasize, initsize;

start_periodic_check_for_corruption();

pci_iommu_alloc();

/* clear_bss() already clear the empty_zero_page */
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ extern int root_mountflags;
* able to scatter it around anywhere in the kernel.
*/
void check_for_bios_corruption(void);
void start_periodic_check_for_corruption(void);
#else
static inline void check_for_bios_corruption(void)
{
Expand Down

0 comments on commit 3dce2be

Please sign in to comment.