mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kdump, vmcoreinfo: Export value to tell if 5-level is enabled
@ 2018-03-02  5:18 Baoquan He
  2018-03-02  7:36 ` Kirill A. Shutemov
  2018-03-12  9:30 ` [tip:x86/mm] kdump, vmcoreinfo: Export pgtable_l5_enabled value tip-bot for Baoquan He
  0 siblings, 2 replies; 3+ messages in thread
From: Baoquan He @ 2018-03-02  5:18 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, tglx, kirill.shutemov, hpa, dyoung, x86, ebiederm,
	douly.fnst, vgoyal, 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

Signed-off-by: Baoquan He <bhe@redhat.com>
---
 arch/x86/kernel/machine_kexec_64.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 1f790cf9d38f..5f3545eaa76a 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -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);
-- 
2.13.6

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kdump, vmcoreinfo: Export value to tell if 5-level is enabled
  2018-03-02  5:18 [PATCH] kdump, vmcoreinfo: Export value to tell if 5-level is enabled Baoquan He
@ 2018-03-02  7:36 ` Kirill A. Shutemov
  2018-03-12  9:30 ` [tip:x86/mm] kdump, vmcoreinfo: Export pgtable_l5_enabled value tip-bot for Baoquan He
  1 sibling, 0 replies; 3+ messages in thread
From: Kirill A. Shutemov @ 2018-03-02  7:36 UTC (permalink / raw)
  To: Baoquan He
  Cc: linux-kernel, mingo, tglx, kirill.shutemov, hpa, dyoung, x86,
	ebiederm, douly.fnst, vgoyal

On Fri, Mar 02, 2018 at 01:18:01PM +0800, Baoquan He wrote:
> 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
> 
> Signed-off-by: Baoquan He <bhe@redhat.com>

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

-- 
 Kirill A. Shutemov

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/mm] kdump, vmcoreinfo: Export pgtable_l5_enabled value
  2018-03-02  5:18 [PATCH] kdump, vmcoreinfo: Export value to tell if 5-level is enabled Baoquan He
  2018-03-02  7:36 ` Kirill A. Shutemov
@ 2018-03-12  9:30 ` tip-bot for Baoquan He
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Baoquan He @ 2018-03-12  9:30 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: kirill.shutemov, peterz, torvalds, bhe, tglx, linux-kernel, hpa, mingo

Commit-ID:  c100a583601d357f923c41af5434dc1f8d07890f
Gitweb:     https://git.kernel.org/tip/c100a583601d357f923c41af5434dc1f8d07890f
Author:     Baoquan He <bhe@redhat.com>
AuthorDate: Fri, 2 Mar 2018 13:18:01 +0800
Committer:  Ingo Molnar <mingo@kernel.org>
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

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: douly.fnst@cn.fujitsu.com
Cc: dyoung@redhat.com
Cc: ebiederm@xmission.com
Cc: kirill.shutemov@linux.intel.com
Cc: vgoyal@redhat.com
Link: http://lkml.kernel.org/r/20180302051801.19594-1-bhe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/machine_kexec_64.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 3b7427aa7d85..02f913cb27b5 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-12  9:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-02  5:18 [PATCH] kdump, vmcoreinfo: Export value to tell if 5-level is enabled Baoquan He
2018-03-02  7:36 ` Kirill A. Shutemov
2018-03-12  9:30 ` [tip:x86/mm] kdump, vmcoreinfo: Export pgtable_l5_enabled value tip-bot for Baoquan He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome