Messages in this thread | | | Date | Wed, 16 Apr 2008 02:36:24 +0200 | From | Ingo Molnar <> | Subject | Re: [patch] mm: sparsemem memory_present() memory corruption fix |
| |
* Christoph Lameter <clameter@sgi.com> wrote:
> On Wed, 16 Apr 2008, Ingo Molnar wrote: > > > if a !PAE x86 kernel is booted on a 32-bit system with more than 4GB > > of RAM, then we call memory_present() with a start/end that goes > > outside the scope of MAX_PHYSMEM_BITS. > > Well okay this fixes it but is this the right fix? The arch should not > call memory_present() with an invalid pfn.
it is the right fix. The architecture memory setup code doesnt even _know_ the limits at this place in an open-coded way (and shouldnt know them) - and even later on we use pfn_valid() to determine whether to attempt to get to a struct page and free it into the buddy.
[ Of course the architecture code in general 'knows' about the limits - but still it's cleaner to have a dumb enumeration interface here combined with a resilient core code - that's always going to be less fragile. ]
btw., i just did some bug history analysis, the calls were originally added when sparsemem support was added:
| commit 215c3409eed16c89b6d11ea1126bd9d4f36b9afd | Author: Andy Whitcroft <apw@shadowen.org> | Date: Fri Jan 6 00:12:06 2006 -0800 | | [PATCH] i386 sparsemem for single node systems
in v2.6.15-1003-g215c340. (so this is appears to be an unfixed bug in v2.6.16 as well)
Ingo
| |