Commit 401721ec authored by Baoquan He's avatar Baoquan He Committed by Linus Torvalds
Browse files

kexec: export the value of phys_base instead of symbol address

Currently in x86_64, the symbol address of phys_base is exported to
vmcoreinfo.  Dave Anderson complained this is really useless for his
Crash implementation.  Because in user-space utility Crash and
Makedumpfile which exported vmcore information is mainly used for, value
of phys_base is needed to covert virtual address of exported kernel
symbol to physical address.  Especially init_level4_pgt, if we want to
access and go over the page table to look up a PA corresponding to VA,
firstly we need calculate

  page_dir = SYMBOL(init_level4_pgt) - __START_KERNEL_map + phys_base;

Now in Crash and Makedumpfile, we have to analyze the vmcore elf program
header to get value of phys_base.  As Dave said, it would be preferable
if it were readily availabl in vmcoreinfo rather than depending upon the
PT_LOAD semantics.

Hence in this patch change to export the value of phys_base instead of
its virtual address.

And people also complained that KERNEL_IMAGE_SIZE exporting is x86_64
only, should be moved into arch dependent function
arch_crash_save_vmcoreinfo.  Do the moving in this patch.


Signed-off-by: default avatarBaoquan He <>
Cc: Thomas Garnier <>
Cc: Baoquan He <>
Cc: Thomas Gleixner <>
Cc: Ingo Molnar <>
Cc: "H . Peter Anvin" <>
Cc: Eric Biederman <>
Cc: Xunlei Pang <>
Cc: HATAYAMA Daisuke <>
Cc: Kees Cook <>
Cc: Eugene Surovegin <>
Cc: Dave Young <>
Cc: AKASHI Takahiro <>
Cc: Atsushi Kumagai <>
Cc: Dave Anderson <>
Cc: Pratyush Anand <>
Cc: Vivek Goyal <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 69f58384
......@@ -328,7 +328,7 @@ void machine_kexec(struct kimage *image)
void arch_crash_save_vmcoreinfo(void)
......@@ -337,6 +337,7 @@ void arch_crash_save_vmcoreinfo(void)
/* arch-dependent functionality related to kexec file-based syscall */
......@@ -1467,9 +1467,6 @@ static int __init crash_save_vmcoreinfo_init(void)
#ifdef CONFIG_X86
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment