提交 fb2e7c5e 编写于 作者: G Gerald Schaefer 提交者: Martin Schwidefsky

[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: NGerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 58e20d8d
...@@ -604,13 +604,13 @@ setup_memory(void) ...@@ -604,13 +604,13 @@ setup_memory(void)
if (memory_chunk[i].type != CHUNK_READ_WRITE) if (memory_chunk[i].type != CHUNK_READ_WRITE)
continue; continue;
start_chunk = PFN_DOWN(memory_chunk[i].addr); start_chunk = PFN_DOWN(memory_chunk[i].addr);
end_chunk = start_chunk + PFN_DOWN(memory_chunk[i].size) - 1; end_chunk = start_chunk + PFN_DOWN(memory_chunk[i].size);
end_chunk = min(end_chunk, end_pfn); end_chunk = min(end_chunk, end_pfn);
if (start_chunk >= end_chunk) if (start_chunk >= end_chunk)
continue; continue;
add_active_range(0, start_chunk, end_chunk); add_active_range(0, start_chunk, end_chunk);
pfn = max(start_chunk, start_pfn); pfn = max(start_chunk, start_pfn);
for (; pfn <= end_chunk; pfn++) for (; pfn < end_chunk; pfn++)
page_set_storage_key(PFN_PHYS(pfn), PAGE_DEFAULT_KEY); page_set_storage_key(PFN_PHYS(pfn), PAGE_DEFAULT_KEY);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册