aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGerald Schaefer <gerald.schaefer@de.ibm.com>2008-11-14 12:18:00 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-11-14 12:18:51 -0500
commitfb2e7c5e33b341699f139b2ed972dca0a463a670 (patch)
tree84363091311ffd8755a921ce3b34487c8ef3d8cc /arch
parent58e20d8d344b0ee083febb18c2b021d2427e56ca (diff)
[S390] Fix range for add_active_range() in setup_memory()
add_active_range() expects start_pfn + size as end_pfn value, i.e. not the pfn of the last page frame but the one behind that. We used the pfn of the last page frame so far, which can lead to a BUG_ON in move_freepages(), when the kernelcore parameter is specified (page_zone(start_page) != page_zone(end_page)). Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/kernel/setup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 62122bad1e33..400b040df7fa 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -604,13 +604,13 @@ setup_memory(void)
604 if (memory_chunk[i].type != CHUNK_READ_WRITE) 604 if (memory_chunk[i].type != CHUNK_READ_WRITE)
605 continue; 605 continue;
606 start_chunk = PFN_DOWN(memory_chunk[i].addr); 606 start_chunk = PFN_DOWN(memory_chunk[i].addr);
607 end_chunk = start_chunk + PFN_DOWN(memory_chunk[i].size) - 1; 607 end_chunk = start_chunk + PFN_DOWN(memory_chunk[i].size);
608 end_chunk = min(end_chunk, end_pfn); 608 end_chunk = min(end_chunk, end_pfn);
609 if (start_chunk >= end_chunk) 609 if (start_chunk >= end_chunk)
610 continue; 610 continue;
611 add_active_range(0, start_chunk, end_chunk); 611 add_active_range(0, start_chunk, end_chunk);
612 pfn = max(start_chunk, start_pfn); 612 pfn = max(start_chunk, start_pfn);
613 for (; pfn <= end_chunk; pfn++) 613 for (; pfn < end_chunk; pfn++)
614 page_set_storage_key(PFN_PHYS(pfn), PAGE_DEFAULT_KEY); 614 page_set_storage_key(PFN_PHYS(pfn), PAGE_DEFAULT_KEY);
615 } 615 }
616 616