Re: [PATCH RFC] x86: check for and defend against BIOS memory corruption

Rafał Miłecki
2008-08-29T11:54:56Z

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 1815 bytes --]

2008/8/29 Hugh Dickins <hugh@veritas.com>:>> On Fri, 29 Aug 2008, RafaÅ‚ MiÅ‚ecki wrote:>>>> Out of current discussion I tried using s2ram on patched kernel (I did>> not try s2ram earlier, my problem was (un)plugging HDMI - some ACPI>> code probably).>>>> Corruption output is quite huge, I attached it to bug report:>> http://bugzilla.kernel.org/show_bug.cgi?id=11237>> http://bugzilla.kernel.org/attachment.cgi?id=17526>> 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)) {> if (!*addr)> continue;> printk(KERN_ERR "Corrupted low memory at %p (%lx phys) = %08lx\n",> addr, __pa(addr), *addr);> + *addr = 0;> corruption = 1;> }> }
I tried your patch anyway (after applying Jeremy's patch of course)and it doesn't seem to work. The only output is:scanning 2 areas for BIOS corruptionafter using s2ram. I do not get anyCorrupted low memory at*
-- RafaÅ‚ MiÅ‚eckiÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éÝ¶\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dÊ‡Ú™ë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥