lkml.org 
[lkml]   [2008]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC] x86: check for and defend against BIOS memory corruption
Hugh Dickins wrote:
> Not quite the output we were expecting! I've not got around to trying
> it yet, so beware, but I think Jeremy's patch needs the following on top.
> Or you may prefer to wait until one of us reports that it is now working
> as intended.
>
> --- a/arch/x86/kernel/setup.c 2008-08-29 11:17:16.000000000 +0100
> +++ b/arch/x86/kernel/setup.c 2008-08-29 11:19:24.000000000 +0100
> @@ -636,11 +636,12 @@ void check_for_bios_corruption(void)
> unsigned long *addr = __va(scan_areas[i].addr);
> unsigned long size = scan_areas[i].size;
>
> - for(; size; addr++, size--) {
> + for(; size; addr++, size -= sizeof(unsigned long)) {
>

Oops, yes.

> if (!*addr)
> continue;
> printk(KERN_ERR "Corrupted low memory at %p (%lx phys) = %08lx\n",
> addr, __pa(addr), *addr);
> + *addr = 0;
>

Good idea.

> corruption = 1;
> }
> }


J


\
 
 \ /
  Last update: 2008-08-29 16:11    [W:0.351 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site