Skip to contentSkip to conversation

kdump, vmcoreinfo: Export value to tell if 5-level is enabled

PATCH In review Baoquan He 3 participants 3 messages Mar 2, 2018 – Mar 12, 2018 x86

lore
Share & tools
lore

Baoquan He

author
#0 lore raw

PATCH 1/1 kdump, vmcoreinfo: Export value to tell if 5-level is enabled

Userspace utility needs to know if the corrupted kernel is in 5-level paging mode. So write 'pgtable_l5_enabled' to vmcoreinfo. It covers below three cases:
pgtable_l5_enabled == 0 when
Compile kernel with CONFIG_X86_5LEVEL=n
Compile with CONFIG_X86_5LEVEL=y while cpu has no 'la57' flag

pgtable_l5_enabled != 0 when
Compile with CONFIG_X86_5LEVEL=y and cpu has 'la57' flag

---
 arch/x86/kernel/machine_kexec_64.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/kernel/machine_kexec_64.c +1 -0
index 1f790cf9d38f..5f3545eaa76a 100644
@@ -350,6 +350,7 @@ void arch_crash_save_vmcoreinfo(void)
 {
 	VMCOREINFO_NUMBER(phys_base);
 	VMCOREINFO_SYMBOL(init_top_pgt);
+	VMCOREINFO_NUMBER(pgtable_l5_enabled);
 
 #ifdef CONFIG_NUMA
 	VMCOREINFO_SYMBOL(node_data);
Signature · 1 line
2.13.6
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Baoquan He

Userspace utility needs to know if the corrupted kernel is in 5-level paging mode. So write 'pgtable_l5_enabled' to vmcoreinfo. It covers below three cases:
pgtable_l5_enabled == 0 when
Compile kernel with CONFIG_X86_5LEVEL=n
Compile with CONFIG_X86_5LEVEL=y while cpu has no 'la57' flag

pgtable_l5_enabled != 0 when
Compile with CONFIG_X86_5LEVEL=y and cpu has 'la57' flag

Signature · 1 line
 Kirill A. Shutemov
#2 lore raw

[tip:x86/mm] kdump, vmcoreinfo: Export pgtable_l5_enabled value

In reply to Baoquan He
kdump, vmcoreinfo: Export pgtable_l5_enabled value
Commit-ID:  c100a583601d357f923c41af5434dc1f8d07890f
Gitweb:     https://git.kernel.org/tip/c100a583601d357f923c41af5434dc1f8d07890f
Author:     Baoquan He <[email protected]>
AuthorDate: Fri, 2 Mar 2018 13:18:01 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 12 Mar 2018 09:43:56 +0100

kdump, vmcoreinfo: Export pgtable_l5_enabled value

User-space utilities examining crash-kernels need to know if the crashed kernel was in 5-level paging mode or not.

So write 'pgtable_l5_enabled' to vmcoreinfo, which covers these three cases:

pgtable_l5_enabled == 0 when:
- Compiled with !CONFIG_X86_5LEVEL
- Compiled with CONFIG_X86_5LEVEL=y while CPU has no 'la57' flag

pgtable_l5_enabled != 0 when:
- Compiled with CONFIG_X86_5LEVEL=y and CPU has 'la57' flag

---
 arch/x86/kernel/machine_kexec_64.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/kernel/machine_kexec_64.c +1 -0
index 3b7427aa7d85..02f913cb27b5 100644
@@ -350,6 +350,7 @@ void arch_crash_save_vmcoreinfo(void)
 {
 	VMCOREINFO_NUMBER(phys_base);
 	VMCOREINFO_SYMBOL(init_top_pgt);
+	VMCOREINFO_NUMBER(pgtable_l5_enabled);
 
 #ifdef CONFIG_NUMA
 	VMCOREINFO_SYMBOL(node_data);