linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Revert "kdump, vmcoreinfo: report memory sections virtual addresses"
@ 2016-11-08  1:29 Baoquan He
  2016-11-08  1:29 ` [PATCH 2/2] kexec: Change to export the value of phys_base instead of symbol address Baoquan He
  0 siblings, 1 reply; 2+ messages in thread
From: Baoquan He @ 2016-11-08  1:29 UTC (permalink / raw)
  To: linux-kernel, kexec
  Cc: mingo, tglx, hpa, ebiederm, akpm, thgarnie, dyoung,
	takahiro.akashi, ats-kumagai, anderson, panand, Baoquan He

This reverts commit 0549a3c02efb350776bc869685a361045efd3a29.

Commit 0549a3c tells user space utility - makedumpfile the randomized
base address of these memmory sections when mm kaslr enabled. However
below patchset makes makedumpfile not need them any more. Besides we
should use VMCOREINFO_NUMBER to export value of variable so that we
can use the existing number_table mechanism of Makedumpfile to fetch
it. So revert it now. If needed, can add it later.

http://lists.infradead.org/pipermail/kexec/2016-October/017540.html
Signed-off-by: Baoquan He <bhe@redhat.com>
---
 arch/x86/kernel/machine_kexec_64.c | 3 ---
 include/linux/kexec.h              | 6 ------
 2 files changed, 9 deletions(-)

diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 8c1f218..5a294e4 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -337,9 +337,6 @@ void arch_crash_save_vmcoreinfo(void)
 #endif
 	vmcoreinfo_append_str("KERNELOFFSET=%lx\n",
 			      kaslr_offset());
-	VMCOREINFO_PAGE_OFFSET(PAGE_OFFSET);
-	VMCOREINFO_VMALLOC_START(VMALLOC_START);
-	VMCOREINFO_VMEMMAP_START(VMEMMAP_START);
 }
 
 /* arch-dependent functionality related to kexec file-based syscall */
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 406c33d..d743777 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -259,12 +259,6 @@ phys_addr_t paddr_vmcoreinfo_note(void);
 	vmcoreinfo_append_str("NUMBER(%s)=%ld\n", #name, (long)name)
 #define VMCOREINFO_CONFIG(name) \
 	vmcoreinfo_append_str("CONFIG_%s=y\n", #name)
-#define VMCOREINFO_PAGE_OFFSET(value) \
-	vmcoreinfo_append_str("PAGE_OFFSET=%lx\n", (unsigned long)value)
-#define VMCOREINFO_VMALLOC_START(value) \
-	vmcoreinfo_append_str("VMALLOC_START=%lx\n", (unsigned long)value)
-#define VMCOREINFO_VMEMMAP_START(value) \
-	vmcoreinfo_append_str("VMEMMAP_START=%lx\n", (unsigned long)value)
 
 extern struct kimage *kexec_image;
 extern struct kimage *kexec_crash_image;
-- 
2.5.5

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

* [PATCH 2/2] kexec: Change to export the value of phys_base instead of symbol address
  2016-11-08  1:29 [PATCH 1/2] Revert "kdump, vmcoreinfo: report memory sections virtual addresses" Baoquan He
@ 2016-11-08  1:29 ` Baoquan He
  0 siblings, 0 replies; 2+ messages in thread
From: Baoquan He @ 2016-11-08  1:29 UTC (permalink / raw)
  To: linux-kernel, kexec
  Cc: mingo, tglx, hpa, ebiederm, akpm, thgarnie, dyoung,
	takahiro.akashi, ats-kumagai, anderson, panand, Baoquan He

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: Baoquan He <bhe@redhat.com>
---
 arch/x86/kernel/machine_kexec_64.c | 3 ++-
 kernel/kexec_core.c                | 3 ---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 5a294e4..307b1f4 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -328,7 +328,7 @@ void machine_kexec(struct kimage *image)
 
 void arch_crash_save_vmcoreinfo(void)
 {
-	VMCOREINFO_SYMBOL(phys_base);
+	VMCOREINFO_NUMBER(phys_base);
 	VMCOREINFO_SYMBOL(init_level4_pgt);
 
 #ifdef CONFIG_NUMA
@@ -337,6 +337,7 @@ void arch_crash_save_vmcoreinfo(void)
 #endif
 	vmcoreinfo_append_str("KERNELOFFSET=%lx\n",
 			      kaslr_offset());
+	VMCOREINFO_NUMBER(KERNEL_IMAGE_SIZE);
 }
 
 /* arch-dependent functionality related to kexec file-based syscall */
diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index 5616755..8ad3a29e 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -1467,9 +1467,6 @@ static int __init crash_save_vmcoreinfo_init(void)
 #endif
 	VMCOREINFO_NUMBER(PG_head_mask);
 	VMCOREINFO_NUMBER(PAGE_BUDDY_MAPCOUNT_VALUE);
-#ifdef CONFIG_X86
-	VMCOREINFO_NUMBER(KERNEL_IMAGE_SIZE);
-#endif
 #ifdef CONFIG_HUGETLB_PAGE
 	VMCOREINFO_NUMBER(HUGETLB_PAGE_DTOR);
 #endif
-- 
2.5.5

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

end of thread, other threads:[~2016-11-08  1:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-08  1:29 [PATCH 1/2] Revert "kdump, vmcoreinfo: report memory sections virtual addresses" Baoquan He
2016-11-08  1:29 ` [PATCH 2/2] kexec: Change to export the value of phys_base instead of symbol address Baoquan He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).