File makedumpfile-Revert-Calculate-page_offset-from-pt_load.patch of Package makedumpfile.openSUSE_Leap_42.3_Update

From: Petr Tesarik <ptesarik@suse.com>
Date: Thu, 21 Dec 2017 13:39:47 +0100
Subject: Revert "x86_64: Calculate page_offset from pt_load"
References: bsc#1068925, bsc#1040469, bsc#1099121
Upstream: never, upstream needs newer kernel

This reverts commit 0c9dd01d8ee2e4ec1821a11f5e174fdba56012b8.
---
 arch/x86_64.c |   24 ++++--------------------
 1 file changed, 4 insertions(+), 20 deletions(-)

--- a/arch/x86_64.c
+++ b/arch/x86_64.c
@@ -44,24 +44,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) {
-			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)
 {
@@ -189,8 +171,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->vmalloc_start = VMALLOC_START_ORIG;
openSUSE Build Service is sponsored by