----- Original Message -----
Currently, Crash only enable support for kernel-only 5-level page
tables by
entering the command line option "--machdep vm=5level". Since Linux 4.17,
the Linux kernel can be both 4level and 5level page tables. This command line
can't work well for this.
Using the "pgtable_l5_enabled" got from vmcore to detect whether the kernel
proper for 5 level page tables automatically.
Hello Dou,
Presumably by the time arch_crash_save_vmcoreinfo calls pgtable_l5_enabled(),
things have been initialized up appropriately, and so this should work OK for
kdump-generated vmcores. But have you looked into how this should be accomplished
for for live systems? Since kernel commit 51be1335 reverts __pgtable_l5_enabled
from being __initdata to __ro_after_init, would it be as simple as just reading
__pgtable_l5_enabled at POST_RELOC time?
Thanks,
Dave
Signed-off-by: Dou Liyang <douly.fnst(a)cn.fujitsu.com>
---
x86_64.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/x86_64.c b/x86_64.c
index 6d1ae2f..be6164b 100644
--- a/x86_64.c
+++ b/x86_64.c
@@ -203,6 +203,10 @@ x86_64_init(int when)
machdep->machspec->kernel_image_size = dtol(string, QUIET, NULL);
free(string);
}
+ if ((string = pc->read_vmcoreinfo("NUMBER(pgtable_l5_enabled)"))) {
+ machdep->flags |= VM_5LEVEL;
+ free(string);
+ }
if (SADUMP_DUMPFILE() || QEMU_MEM_DUMP_NO_VMCOREINFO() ||
VMSS_DUMPFILE())
/* Need for calculation of kaslr_offset and phys_base */
--
2.14.3