提交 d7736ff5 编写于 作者: M Michael Holzheu 提交者: Martin Schwidefsky

s390/dump: Fix dump memory detection

Dumps created by kdump or zfcpdump can contain invalid memory holes when
dumping z/VM systems that have memory pressure.

For example:

   # zgetdump -i /proc/vmcore.
   Memory map:
   0000000000000000 - 0000000000bfffff (12 MB)
   0000000000e00000 - 00000000014fffff (7 MB)
   000000000bd00000 - 00000000f3bfffff (3711 MB)

The memory detection function find_memory_chunks() issues tprot to
find valid memory chunks. In case of CMM it can happen that pages are
marked as unstable via set_page_unstable() in arch_free_page().
If z/VM has released that pages, tprot returns -EFAULT and indicates
a memory hole.

So fix this and switch off CMM in case of kdump or zfcpdump.

Cc: <stable@vger.kernel.org>
Signed-off-by: NMichael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 b7c5b1aa
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/setup.h>
#include <asm/ipl.h>
#define ESSA_SET_STABLE 1 #define ESSA_SET_STABLE 1
#define ESSA_SET_UNUSED 2 #define ESSA_SET_UNUSED 2
...@@ -41,6 +43,14 @@ void __init cmma_init(void) ...@@ -41,6 +43,14 @@ void __init cmma_init(void)
if (!cmma_flag) if (!cmma_flag)
return; return;
/*
* Disable CMM for dump, otherwise the tprot based memory
* detection can fail because of unstable pages.
*/
if (OLDMEM_BASE || ipl_info.type == IPL_TYPE_FCP_DUMP) {
cmma_flag = 0;
return;
}
asm volatile( asm volatile(
" .insn rrf,0xb9ab0000,%1,%1,0,0\n" " .insn rrf,0xb9ab0000,%1,%1,0,0\n"
"0: la %0,0\n" "0: la %0,0\n"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册