Re: Corrupted low memory in v3.9+

From: H. Peter Anvin
Date: Mon Nov 11 2013 - 18:31:49 EST


On 11/11/2013 03:35 AM, Ingo Molnar wrote:
>
> If we reserve everything in low memory, all the time (which I very much
> argue we should do) then the checker becomes a no-op and can be removed.
>

Oops! I had misunderstood how the checker worked -- I thought it
checked the *reserved* memory, but it in fact reserves memory
*independently* and then checks it.

The problem is fundamentally that setup_bios_corruption_check(); is
called too early in setup_arch() -- quite possibly due to other code
movement around it:

#ifdef CONFIG_X86_CHECK_BIOS_CORRUPTION
setup_bios_corruption_check();
#endif

reserve_real_mode();

trim_platform_memory_ranges();
trim_low_memory_range();

init_mem_mapping();


setup_bios_corruption_check() should presumably be called between
trim_low_memory_range() and init_mem_mapping(). I'm actually surprised
that we don't trip on this *all the time* since the realmode trampoline
falls in this area...

At the same time, we should change the default for
CONFIG_X86_RESERVE_LOW to 640, and perhaps move it under EXPERT.

What do you guys think?

-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/