diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/sparse.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mm/sparse.c b/mm/sparse.c index f6a43c09c322..98d6b39c3472 100644 --- a/mm/sparse.c +++ b/mm/sparse.c | |||
@@ -149,8 +149,18 @@ static inline int sparse_early_nid(struct mem_section *section) | |||
149 | /* Record a memory area against a node. */ | 149 | /* Record a memory area against a node. */ |
150 | void __init memory_present(int nid, unsigned long start, unsigned long end) | 150 | void __init memory_present(int nid, unsigned long start, unsigned long end) |
151 | { | 151 | { |
152 | unsigned long max_arch_pfn = 1UL << (MAX_PHYSMEM_BITS-PAGE_SHIFT); | ||
152 | unsigned long pfn; | 153 | unsigned long pfn; |
153 | 154 | ||
155 | /* | ||
156 | * Sanity checks - do not allow an architecture to pass | ||
157 | * in larger pfns than the maximum scope of sparsemem: | ||
158 | */ | ||
159 | if (start >= max_arch_pfn) | ||
160 | return; | ||
161 | if (end >= max_arch_pfn) | ||
162 | end = max_arch_pfn; | ||
163 | |||
154 | start &= PAGE_SECTION_MASK; | 164 | start &= PAGE_SECTION_MASK; |
155 | for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) { | 165 | for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) { |
156 | unsigned long section = pfn_to_section_nr(pfn); | 166 | unsigned long section = pfn_to_section_nr(pfn); |