Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] Revert "[PATCH V2 1/4] x86_64: Calculate page_offset from pt_load"
@ 2017-05-23  2:54 Hatayama, Daisuke
  2017-05-23  3:23 ` Pratyush Anand
  0 siblings, 1 reply; 9+ messages in thread
From: Hatayama, Daisuke @ 2017-05-23  2:54 UTC (permalink / raw)
  To: 'ats-kumagai@wm.jp.nec.com'
  Cc: 'panand@redhat.com', 'kexec@lists.infradead.org',
	'bhe@redhat.com'

This reverts commit 0c9dd01d8ee2e4ec1821a11f5e174fdba56012b8 because
the logic works well only on the kdump ELF format. It doesn't work
well on sadump vmcores and qemu/KVM guest vmcores created by virsh
dump --memory-only command where info->page_offset results in 0. These
formats have to depend on kernel version dependency in the current
situation.

Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Pratyush Anand <panand@redhat.com>
---
 arch/x86_64.c | 25 ++++---------------------
 1 file changed, 4 insertions(+), 21 deletions(-)

diff --git a/arch/x86_64.c b/arch/x86_64.c
index e978a36..13f0c3f 100644
--- a/arch/x86_64.c
+++ b/arch/x86_64.c
@@ -33,25 +33,6 @@ get_xen_p2m_mfn(void)
 	return NOT_FOUND_LONG_VALUE;
 }
 
-static int
-get_page_offset_x86_64(void)
-{
-	int i;
-	unsigned long long phys_start;
-	unsigned long long virt_start;
-
-	for (i = 0; get_pt_load(i, &phys_start, NULL, &virt_start, NULL); i++) {
-		if (virt_start < __START_KERNEL_map
-				&& phys_start != NOT_PADDR) {
-			info->page_offset = virt_start - phys_start;
-			return TRUE;
-		}
-	}
-
-	ERRMSG("Can't get any pt_load to calculate page offset.\n");
-	return FALSE;
-}
-
 int
 get_phys_base_x86_64(void)
 {
@@ -179,8 +160,10 @@ get_versiondep_info_x86_64(void)
 	else
 		info->max_physmem_bits  = _MAX_PHYSMEM_BITS_2_6_31;
 
-	if (!get_page_offset_x86_64())
-		return FALSE;
+	if (info->kernel_version < KERNEL_VERSION(2, 6, 27))
+		info->page_offset = __PAGE_OFFSET_ORIG;
+	else
+		info->page_offset = __PAGE_OFFSET_2_6_27;
 
 	if (info->kernel_version < KERNEL_VERSION(2, 6, 31)) {
 		info->vmemmap_start = VMEMMAP_START_ORIG;
-- 
1.8.3.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

end of thread, other threads:[~2017-05-25  1:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-23  2:54 [PATCH 2/2] Revert "[PATCH V2 1/4] x86_64: Calculate page_offset from pt_load" Hatayama, Daisuke
2017-05-23  3:23 ` Pratyush Anand
2017-05-23  4:12   ` Pratyush Anand
2017-05-23  7:25     ` Hatayama, Daisuke
2017-05-23  8:35       ` Pratyush Anand
2017-05-24  2:09         ` Hatayama, Daisuke
2017-05-24  5:43           ` Pratyush Anand
2017-05-24  6:21             ` Pratyush Anand
2017-05-25  1:11               ` Hatayama, Daisuke

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