1 From: Gerald Schaefer <geraldsc@de.ibm.com>
2 Subject: kernel: Fix range for add_active_range() in setup_memory()
5 Symptom: BUG_ON in move_freepages(), when the kernelcore parameter is
6 specified and the last memory chunk is set offline.
7 Problem: add_active_range() expects start_pfn + size as end_pfn value,
8 i.e. not the pfn of the last page frame but the one behind that.
9 We used the pfn of the last page frame so far.
10 Solution: Use start_pfn + size as end_pfn value.
12 Acked-by: John Jolly <jjolly@suse.de>
14 arch/s390/kernel/setup.c | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-)
17 Index: linux-sles11/arch/s390/kernel/setup.c
18 ===================================================================
19 --- linux-sles11.orig/arch/s390/kernel/setup.c
20 +++ linux-sles11/arch/s390/kernel/setup.c
21 @@ -615,13 +615,13 @@ setup_memory(void)
22 if (memory_chunk[i].type != CHUNK_READ_WRITE)
24 start_chunk = PFN_DOWN(memory_chunk[i].addr);
25 - end_chunk = start_chunk + PFN_DOWN(memory_chunk[i].size) - 1;
26 + end_chunk = start_chunk + PFN_DOWN(memory_chunk[i].size);
27 end_chunk = min(end_chunk, end_pfn);
28 if (start_chunk >= end_chunk)
30 add_active_range(0, start_chunk, end_chunk);
31 pfn = max(start_chunk, start_pfn);
32 - for (; pfn <= end_chunk; pfn++)
33 + for (; pfn < end_chunk; pfn++)
34 page_set_storage_key(PFN_PHYS(pfn), PAGE_DEFAULT_KEY);