提交 00de54c8 编写于 作者: H Heiko Carstens 提交者: Martin Schwidefsky

s390/mem_detect: fix memory type of first block

Fix a long-standing but currently irrelevant bug: the memory detection
code performs a tprot instruction on address zero to figure out if the
first memory chunk is readable or writable. Due to low address
protection the result is "read-only". If the memory detection code
would actually care, it would have to ignore the first memory
increment, but it adds the memory increment to writable memory anyway.

If memblock debugging is enabled this leads to an extra rather
surprising call which registers memory. To avoid this get rid of the
first misleading tprot call and simply assume that the first memory
increment is writable. Otherwise we wouldn't have reached the memory
detection code anyway.
Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 a2ce2a95
...@@ -41,7 +41,8 @@ void __init detect_memory_memblock(void) ...@@ -41,7 +41,8 @@ void __init detect_memory_memblock(void)
memblock_set_bottom_up(true); memblock_set_bottom_up(true);
do { do {
size = 0; size = 0;
type = tprot(addr); /* assume lowcore is writable */
type = addr ? tprot(addr) : CHUNK_READ_WRITE;
do { do {
size += rzm; size += rzm;
if (max_physmem_end && addr + size >= max_physmem_end) if (max_physmem_end && addr + size >= max_physmem_end)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册